I have a project that allows the user to build a scene which is displayed in Open GL. When the user adds a new models to the scene I have created a file browser that shows a thumbnail in GL as the user searches the models. The problem I am having is that once I return from the file browser the main screen turns black and nothing is displayed and it never comes back.
I have a base class call GLWindow for creating controlling the window. Both the main view and the thumbnail instatiate their own instance. This initialization is the following:
pDC = new CClientDC (pWnd); hDC = pDC->GetSafeHdc(); set up the pixel format hRC = wglCreateContext(hDC);
My destructor is:
wglMakeCurrent (hDC, NULL); wglDeleteContext (hRC); delete pDC
Rendering in both windows uses something similar to:
wglMakeCurrent (hDC, hRC); render scene SwapBuffers (hDC); glFlush();
Can anybody tell me what I am doing wrong? Am I missing a call, or doing something out of order.