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

Summary: OpenGLES graphics upside-down with texture render target
Product: SDL Reporter: Richard Russell <rtrussell>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.4   
Hardware: x86   
OS: Android (All)   
Attachments: Output rendered using opengles driver
Output rendered using opengles2 driver

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 ***