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 3233 - OpenGLES graphics upside-down with texture render target
Summary: OpenGLES graphics upside-down with texture render target
Status: RESOLVED DUPLICATE of bug 3347
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.4
Hardware: x86 Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-10 11:55 UTC by Richard Russell
Modified: 2016-10-01 18:42 UTC (History)
0 users

See Also:


Attachments
Output rendered using opengles driver (33.18 KB, image/png)
2016-01-10 11:55 UTC, Richard Russell
Details
Output rendered using opengles2 driver (33.15 KB, image/png)
2016-01-10 11:56 UTC, Richard Russell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Russell 2016-01-10 11:55:24 UTC
Created attachment 2360 [details]
Output rendered using opengles driver

I am wanting to use OpenGLES (on Android) because I need 'glLogicOp' which is not available in OpenGLES2.  However if I force the use of OpenGLES all my graphics are rendered upside-down!  I am using a texture as my render target.

See the attached screenshots.  The only difference is that in one I use this hint and in the other I don't:

  SDL_SetHint (SDL_HINT_RENDER_DRIVER, "opengles") ;

I wonder if this is related to other bugs (e.g. 2700, 2740) which invert the y-coordinate when a render target is used.
Comment 1 Richard Russell 2016-01-10 11:56:26 UTC
Created attachment 2361 [details]
Output rendered using opengles2 driver
Comment 2 Richard Russell 2016-01-10 16:16:56 UTC
Functions affected by this bug include SDL_RenderFillRect, SDL_RenderDrawPoint, SDL_RenderDrawPoints, SDL_RenderDrawLine and SDL_RenderDrawLines.

I can't write a patch because the y-coordinates need to be inverted with respect to the height of the target texture (not the window) and I don't know how to discover that.
Comment 3 Sam Lantinga 2016-10-01 18:42:09 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/16bfa598c1d6

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