PDA

View Full Version : CWnd style using OpenGL



Condor
05-06-2002, 10:56 PM
Hello,
I've got one more question.
What style should have a window (derived from CWnd) in which the OpenGL technology is used?
I place this window on a dialog using the standart CWnd::Create() function. So I should pass in the window style as an argument.
I have found some information ragarding to the preferable style. It is worth using WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles plus starndart styles like WS_VISIBLE and WS_CHILD. However using mentioned styles together I met with a problem: sometimes the window stops responding. It occurs when the SetPixelFormat() is invoked. Without WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles it goes fine.
Where is a problem?
Thank you in advance,
Condor

Furrage
05-07-2002, 06:54 AM
You must use WS_CLIPCHILDREN and WS_CLIPSIBLINGS in an OpenGL window. If it is a child window you must use WS_CHILD. I think you need WS_VISIBLE or you wont see the window. If you get problems with SetPixelFormat() it should be something else. Are you using ChoosePixelFormat to make sure your are selecting the right pixel format?

I understand there's a site dedicated to using OpenGL with MFC ( http://www.mfcogl.com ). This thread also had other links related to using MFC with OpenGL ( http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/008303.html ).

V-man
05-07-2002, 01:02 PM
It depends if you are making a SDI or MDI window, If its SDI (one window) then you dont need clipchildren and so on. Also, you should plug in CS_OWNDC for the class style (for Win95/98/Me)


V-man