We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3123 - Renderer clipping with SDL_RenderSetClipRect broken in SDL hg
Summary: Renderer clipping with SDL_RenderSetClipRect broken in SDL hg
Status: RESOLVED DUPLICATE of bug 3117
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-16 13:00 UTC by Davide Coppola
Modified: 2015-09-16 20:37 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Coppola 2015-09-16 13:00:17 UTC
I recently tried to build the game I'm working on against SDL hg and I noticed the renderer clipping is totally broken or at least it doesn't work any more as it did in the latest SDL stable (2.0.3).

I wrote a simple test program to verify the problem wasn't in my game, you can check it out here: http://pastebin.com/WX9tq7rk

You can see the results of building the same program against SDL 2.0.3 and hg here: http://imgur.com/a/8pDrD

After noticing this bug report: https://bugzilla.libsdl.org/show_bug.cgi?id=2927 I hacked the code a little to find out the patch derived from that report is causing the problem.

For example in SDL_renderer_gl.c replacing
 data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h);
with the old code
data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h);
Fixes the bug.

I don't know if the problem is in that particular line of code (and in all the similar ones in the other renderers), in SDL_GetRendererOutputSize or in the viewport, but hopefully this will give you a starting point to investigate the issue further.
Comment 1 Philipp Wiesemann 2015-09-16 20:19:37 UTC
Maybe related to bug 3117.
Comment 2 Davide Coppola 2015-09-16 20:33:22 UTC
(In reply to Philipp Wiesemann from comment #1)
> Maybe related to bug 3117.

yes, it's definitely the same bug.

The quick patch suggested there works as well, but the code will need to be fixed for every renderer.
Comment 3 Davide Coppola 2015-09-16 20:37:20 UTC
Marked as duplicate of #3117.

*** This bug has been marked as a duplicate of bug 3117 ***