SDL y co-ordinate reporting

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.

Cheers

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.

Cheers


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Animal Liberation Front
http://www.animal-liberation.com/

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.


It’s not just that that I would be required to work around but oh well.

I’ll look into a contribution to SDL if i have time!

Cheers