PDA

View Full Version : Opengl in MFC



Maximus
04-25-2003, 06:22 AM
I used VC to render the Opengl picture,but every time I minimize the window, the picture would disappear.
I have filled the OnSize message,so changing the size has no problem.What other message have I missed to fill,how to fill?
Thanks.

nexusone
04-25-2003, 06:32 AM
You need to redraw on resize, look at nehe.gamedev.net code for windows.


Originally posted by Maximus:
I used VC to render the Opengl picture,but every time I minimize the window, the picture would disappear.
I have filled the OnSize message,so changing the size has no problem.What other message have I missed to fill,how to fill?
Thanks.

Maximus
04-25-2003, 06:48 AM
Thanks.But another problem occured.Every time I opened the menu list,and when the window is maximized, the picture would disappear after the menu overlapped the picture.What can I do.

ppinter1
04-25-2003, 10:35 AM
As suggested, start with a simple example like NeHe's or Display3DS (http://p-squared.com/Display3DS.php) .

Look at the small mainline called Display3DS.cpp which shows how to handle file dialogs and timer event handling easily.

04-25-2003, 11:40 PM
You should structure your code in such a way that drawing is done in response to WM_PAINT messages.

X3J16


Originally posted by Maximus:
Thanks.But another problem occured.Every time I opened the menu list,and when the window is maximized, the picture would disappear after the menu overlapped the picture.What can I do.

J P
04-26-2003, 03:44 AM
Look at some of the examples at www.mfcogl.com (http://www.mfcogl.com)