Archived

This topic is now archived and is closed to further replies.

dr_slash_uh

Windows size and Screen size

Recommended Posts

I was wondering if someone can tell me how to find the actual size of the of the client area of a window using opengl. I set the window size to 800X600 but when i use the mouse to capture the coordinates it becomes 791x553. Is there a formula I must use to figure it out. I do have a menu bar that is taking away from some of the height though. Thanks

Share this post


Link to post
Share on other sites
GetClientRect()

assuming you're using windows of course. Unless I've gotten my functions twisted, GetWindowRect is the size of the window, GetClientRect gets the size of the window you can actually draw on.

[edit] figured I'd be more helpful and show usage too:
RECT clientRect;
GetClientRect(hWnd,&clientRect);

-Arek the Absolute

[edited by - Arek the Absolute on March 29, 2004 9:02:47 PM]

Share this post


Link to post
Share on other sites
One other note .. GetWindowRect returns the coords of the window in screen (desktop) space, while GetClientRect returns coords relative to the window (ie. upper left always 0,0)

Share this post


Link to post
Share on other sites