Mouse position

Hi there,

Is there a way to find out where the mouse is relative to the topleft of the sdl screen?
My application does not run fullscreen so I have a X windows titlebar but I don’t know
it’s height. How can I keep this code platform independent and still find out where the
mouse is on my sdl window?

Thanks in advance,
Rob

Hi there,

Is there a way to find out where the mouse is relative to the topleft of the sdl screen?
My application does not run fullscreen so I have a X windows titlebar but I don’t know
it’s height. How can I keep this code platform independent and still find out where the
mouse is on my sdl window?

The mouse position in SDL mouse motion events is relative to the SDL window.
You can also get the mouse position with SDL_GetMouseState()

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment