PDA

View Full Version : Opengl Window problem in Win 32... Please help....



Fastian
06-24-2001, 10:14 PM
Hi,

I register a WNDCLASS object before creating an OpenGL window. It works... everything is fine, opengl is drawn....

Then I want to create another dialog window so I again register this object with some different properties and different class name and now....OpenGL is no longer displayed in the actual Window... Am I missing something here... What am I doing wrong... can someone help???

heres the code snapshot...:





WNDCLASS WndClass;

// actual OpenGL Window class.

WndClass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC ;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hInstance = hInstance;
WndClass.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_AUTOPIPE);
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);

WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
WndClass.lpszMenuName = 0;
WndClass.lpszClassName = "OpenGL";
// WndClass.lpfnWndProc = InitAppWndProc;
WndClass.lpfnWndProc = DefWindowProc;
status = RegisterClass(&WndClass);


// Dialog window class
// this is where the trouble starts


WndClass.style = CS_DBLCLKS;
WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
WndClass.lpszClassName = _appClasses[0];
status = RegisterClass(&WndClass);



[This message has been edited by Fastian (edited 06-25-2001).]

[This message has been edited by Fastian (edited 06-25-2001).]

[This message has been edited by Fastian (edited 06-25-2001).]

Fastian
06-25-2001, 08:55 PM
Please ... can no body hekp me???? http://www.opengl.org/discussion_boards/ubb/frown.gif


Fastian...

dallas
06-26-2001, 05:04 PM
even though you are giving differing class names, the same instance of window is being used.
windows is getting confused, or at the very least "overwriting" the previous instance with the new class name.

Fastian
06-26-2001, 09:25 PM
Well I figured it out.... Later in the program another window was being drawn on top of my opengl window, so i remoived it to solve the problem. Thanx for your help.