Windows GL issue :

Started by
11 comments, last by Al Gorithm 20 years, 10 months ago
My test application is working perfectly, and I was getting ready to put it aside to start porting my engine, but there are a few remaining things I would like to ask . . . "OpenGl Game Programming" does certain things a way I''m not used to . . . and I don''t understand why it is done this way. Can someone please explain? Thanks.

1) I don''t understand why the Devmode stuff is used for fullscreen mode when (to me) there is no discernable difference between than and a maximized popup window. Is it all "under the hood" stuff with the display device? The text certainly implies this with ". . . which contains information about the devic initialization and environment of an output device" If so, can someone please tell me what exactly this does? Thanks.

2) The AdjustWindowRectEx() function - I am unable to tell a difference between my application including this function and without. . . the book says it calculates the required size of window rectangle, based off the desired client-rectangle size. It says additionally that the window borders will not overlap the rendering area. I compiled my test application with this function included, but notice no difference . . .

Thanks in advance.
Christopher Pugh
Advertisement
1) If you just use a window, you only have access to whatever display mode the desktop is in. If you want a 32-bit mode and the desktop is in 16-bit mode, you''re out of luck with a windowed app.

2) The AdjustWindowRectEx takes into account extra window decorations like the title bar, borders, menu, etc. When you create a window, the values you specify are for the whole window, including the decorations. The AdjustWindowRectEx gives you a size that accounts for the decorations and results in a client area that is the desired width and height.

AdjustWindowRectEx doesn''t change the window size. It just gives you a rectangle that you can use with a MoveWindow call to resize the window (or pass to the CreateWindow function, if it hasn''t been called. I don''t remember which way the book does it - Adjust/Create or Create/Adjust/Move.)

Hope that helps!

Thank You Very Much!

This topic is closed to new replies.

Advertisement