07-24-2002, 01:27 PM
Hi guys...tell me what Im doing wrong, Im trying to render a child window with OGL, but having problems...let me post some code.
I create the parent and child window like:
// PARENT
hwnd = CreateWindow (szAppName, szAppName, WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPED ,
0, 0, 800, 600, NULL, NULL,hInstance, NULL);
// CHILD
oglViewHwnd = CreateWindow ("ChildOne", "ChildOne", WS_CHILD | WS_VISIBLE, 100, 100,
200, 200, hwnd , NULL,hInstance, NULL);
Now, my 'init' function works like:
HDC hdc = GetDC(m_Hwnd);
SetDCPixelFormat(hdc);
m_Hrc = wglCreateContext(hdc);
wglMakeCurrent(hdc, m_Hrc);
Reshape(); // Resize the window for first time
ReleaseDC(m_Hwnd,hdc);
Any special reason for this to not work?
Thx.
I create the parent and child window like:
// PARENT
hwnd = CreateWindow (szAppName, szAppName, WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPED ,
0, 0, 800, 600, NULL, NULL,hInstance, NULL);
// CHILD
oglViewHwnd = CreateWindow ("ChildOne", "ChildOne", WS_CHILD | WS_VISIBLE, 100, 100,
200, 200, hwnd , NULL,hInstance, NULL);
Now, my 'init' function works like:
HDC hdc = GetDC(m_Hwnd);
SetDCPixelFormat(hdc);
m_Hrc = wglCreateContext(hdc);
wglMakeCurrent(hdc, m_Hrc);
Reshape(); // Resize the window for first time
ReleaseDC(m_Hwnd,hdc);
Any special reason for this to not work?
Thx.