mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-04 10:57:40 +00:00
sync D3D_RenderReadPixels with D3D11_RenderReadPixels
- use the result of SDL_ConvertPixels to propagate error - get rid of the verbose error message of D3D11_RenderReadPixels in case SDL_ConvertPixels failed
This commit is contained in:
parent
3bef4a5da6
commit
2cfc83eab7
2 changed files with 5 additions and 14 deletions
|
@ -1271,6 +1271,7 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
|||
RECT d3drect;
|
||||
D3DLOCKED_RECT locked;
|
||||
HRESULT result;
|
||||
int status;
|
||||
|
||||
if (data->currentRenderTarget) {
|
||||
backBuffer = data->currentRenderTarget;
|
||||
|
@ -1305,7 +1306,7 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
|||
return D3D_SetError("LockRect()", result);
|
||||
}
|
||||
|
||||
SDL_ConvertPixels(rect->w, rect->h,
|
||||
status = SDL_ConvertPixels(rect->w, rect->h,
|
||||
D3DFMTToPixelFormat(desc.Format), locked.pBits, locked.Pitch,
|
||||
format, pixels, pitch);
|
||||
|
||||
|
@ -1313,7 +1314,7 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
|||
|
||||
IDirect3DSurface9_Release(surface);
|
||||
|
||||
return 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue