author Sam Lantinga
Sun, 05 Apr 2020 08:58:47 -0700
changeset 13689 c3055b205671
parent 7856 cb37776926ad
permissions -rw-r--r--
Fixed bug 5015 - SDL_RenderReadPixels on DirectX 11.1 backend seems to be broken


It appears that I cannot use SDL_RenderReadPixels on a bound framebuffer (SDL_Texture set as render target) as it simply results in gibberish data. However, drawing that framebuffer into the default target (window surface) does render it correctly. Other backends (OpenGL, software, Direct3D) do work fine.

It looks to me like D3D11_RenderReadPixels just gets the general backbuffer and not the current render target and its backbuffer.

Here is the patch which actually fetches the current render target and its underlying ID3D11Resource which is ID3D11Texture2D.
     1 Future work roadmap:
     2  *
     4  * Check 1.2 revisions:
     5 	3554 - Need to resolve semantics for locking keys on different platforms
     6 	4874 - Do we want screen rotation?  At what level?
     7 	4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98
     8 	4865 - See if this is still needed (mouse coordinate clamping)
     9 	4866 - See if this is still needed (blocking window repositioning)