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 1156 - inverted image in OpenGL
Summary: inverted image in OpenGL
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.0
Hardware: x86 Windows Vista
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 08:04 UTC by misiekaleksander
Modified: 2011-03-01 08:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description misiekaleksander 2011-03-01 08:04:55 UTC
In SDL for example point (0.0) is upper left.
In OpenGL point (0.0) is lower left so when I load texture and use OpenGL coordinates I have to upper down image. 
Here is related topic: http://forums.libsdl.org/viewtopic.php?t=7026

Here is the same problem other people: 
http://www.gamedev.net/topic/576552-sdl-inverted-image/
http://boardreader.com/thread/SDL_Image_OpenGL_Inverted_f4pkX3zsj.html
http://www.gamedev.net/topic/188170-opengl-texture-mapping-question-sdl/
http://bhsphd.spaces.live.com/blog/cns!1844003DFD14BA7D!312.entry 

Here is solution:
http://www.gribblegames.com/articles/game_programming/sdlgl/invert_sdl_surfaces.html
Comment 1 Sam Lantinga 2011-03-01 08:28:09 UTC
Yep, this is not a bug per-se, 2D and 3D APIs just have different coordinate systems.

You can either flip the pixels, or you can flip your texture coordinates, or you can flip your view matrix, and any are fine solutions.