[SDL] OpenGL viewport issue
braddabug at comcast.net
Tue May 27 18:45:18 PDT 2008
I added a call to GetClientRect(), and it looks like you're right- when I
request a window that's 768 pixels high GetClientRect() reports the client
area is 755 pixels high. But what I don't understand is when I create a
window that's 600 pixels high the client area is also 600 pixels high.
If I use the results of GetClientRect() to call glViewport() then everything
works fine until I move the window and I get the opposite problem,
everything on the screen is several pixels too low, and there's a bar going
across the screen the color of the background.
Hey, I just tried something. I set my desktop resolution height to 600 and
created a 1024 pixel high window, and the client height is reported as 755,
and when I move the window I see a HUGE bar across the top of the screen,
probably 269 pixels high, if I had to guess. It really seems like this has
more to do with the height of the window vs the desktop resolution rather
than the titlebar and frame around the window. What's going on?
> You need to be aware that under Windows, the "window size" you set up the
> window with is the size of the entire window, including the frame and
> title bar. You need to work with the "client size", which is the size of
> the actual area enclosed by the frame. Is your code compensating for this?
> ----- Original Message ----
> From: BradDaBug <braddabug at comcast.net>
> To: sdl at lists.libsdl.org
> Sent: Tuesday, May 27, 2008 4:54:26 PM
> Subject: Re: [SDL] OpenGL viewport issue
>>I'm calling glViewport() shortly after calling SDL_SetVideoMode() when I
>>create the window. The window isn't resizable, so screen creation should
>>the only time I need to call those functions.
> SDL mailing list
> SDL at lists.libsdl.org
View this message in context: http://www.nabble.com/OpenGL-viewport-issue-tp17495823p17503721.html
Sent from the SDL mailing list archive at Nabble.com.
More information about the SDL