You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.0 Reported for operating system, platform: All, All
Comments on the original bug report:
On 2016-05-26 16:00:37 +0000, Simon Hug wrote:
Created attachment 2465
Test case for SDL_RenderClear and ClipRect.
The description of the SDL_RenderClear function in the SDL_render.h header says the following:
"This function clears the entire rendering target, ignoring the viewport."
The word "entire" implies that the clipping rectangle set with SDL_RenderSetClipRect also gets ignored. This is left somewhat ambiguous if only the viewport is mentioned. Minor thing, but let's see what the implementations actually do.
The software renderer ignores the clipping rectangle when clearing. It even has a comment on this: /* By definition the clear ignores the clip rect */
Most other render drivers (opengl, opengles, opengles2, direct3d, and psp [I assume. Can't test it.]) use the scissor test for the ClipRect and don't disable it when clearing. Clearing will only happen within the clipping rectangle for these drivers.
An exception is direct3d11 which uses a clear function that ignores the scissor test.
Attached is a test case that shows a green window when the ClipRect is ignored or a green square on a blue background when ClipRect affects the clearing. The lower half of the window is a target texture or red if unsupported.
On 2016-06-16 11:37:29 +0000, Simon Hug wrote:
Created attachment 2497
Patch that disables the scissor test for various renderers when they clear the render target.
The attached patch changes the code around the clear operation of the opengl, opengles, opengles2, and direct3d renderers to disable and re-enable the scissor test if clipping is active. It also resolves the ambiguity in the comment of SDL_RenderClear in the SDL_render.h header by clearly stating that the clear rectangle gets ignored.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.0
Reported for operating system, platform: All, All
Comments on the original bug report:
On 2016-05-26 16:00:37 +0000, Simon Hug wrote:
On 2016-06-16 11:37:29 +0000, Simon Hug wrote:
On 2016-10-01 18:46:52 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: