[SDL] Getting the client size in SDL OpenGL Window

Glen Ritchie glen.ritchie at jcu.edu.au
Sun Jan 16 19:52:32 PST 2005


I was wondering if there was a way to get the size of the client window. Under
Win32 you can use the function GetClientRect. 

When a window is created the actual client area height is the height of the
window you created minus the titlebar and borders( same with width). You may say
createWindow(800, 600) but the client area is actually smaller. Becase i am
using a windowed application and require that the movement of the mouse in one
pixel equals the movement of an item in opengl in ortho mode i need the client
area to pass to glViewport.

Is there any way to get this information in SDL or do i just need to do an
#ifdef statements to check what system is compiling and get it using the OS
depending commands?

Thanks.
Glen Ritchie
Student Developer





More information about the SDL mailing list