Short of applying a filter, is there a way to invert the Y co-ordinate reported for events in SDL to suite the default behaviour of openGL having y at 0 at the bottom of the screen rather than the top?
I ask as most tutorials/documentation assume this, including some of my drawing routines.
Just invert your glOrtho top/bottom parameters to match opengl to a
computer-background style X,Y coords .On Sun, Nov 8, 2009 at 6:57 PM, Scribe <ali_lowe at sky.com> wrote:
Hi guys,
Short of applying a filter, is there a way to invert the Y co-ordinate
reported for events in SDL to suite the default behaviour of openGL having y
at 0 at the bottom of the screen rather than the top?
I ask as most tutorials/documentation assume this, including some of my
drawing routines.
I have done this, however other than having to deviate from most documentations, GL_SCISSOR_TEST still assumes bottom left, which would require me to rewrite my gui system to require some knowledge of the screen size which is quite troublesome if i’m to keep it easily expandable and user friendly.
Ideally you’d want SDL to be able to match the official opengl spec.
SDL isn’t always used with OpenGL. You can write a simple function to
do the conversion yourself, so its not a problem. You can call this
every time a mouse event is extracted from the event queue and write
wrapper function for SDL_GetMouseState() and
SDL_GetMouseStateRelative(), so you will always have a consistent
mouse co-ordinate system.>
Ideally you’d want SDL to be able to match the official opengl spec.