PDA

View Full Version : lost scene



justjohnny
01-24-2010, 07:23 PM
I'm a beginner w/ Windows programming.
I started with an example from the OpenGL SuperBible and am working to pare it down to skeleton code for later use. I have been referencing the Text3D example from the text.

My static scene is initially drawn when the program starts.
But any resizing causes the window to appear black.

Any advice would be appreciated.
thanks.

Y-tension
01-25-2010, 01:52 PM
Well...you need to redraw it! When a window is resized, windows sends a WM_PAINT message that may erase the contents of your window. Simply handle the message and...redraw! Of course this is valid if you use win32 libraries for window management. If you use another toolkit there is a similar method for sure. And don't forget to use glViewport to set the drawing region to the new size of the window.

justjohnny
01-25-2010, 04:28 PM
This turned out to be a problem in the rendering code, not with the windows message handling as suspected. thanks anyway.