I am using Tao Opengl. I created two opengl windows say window A and window B in the same application. When I deleted the window B (destroy its rendering context
and release device context) something wrong happen on my window A, the window looks like not able to activate the rendering context. Anyway I got call the method Wgl.wglMakeCurrent(deviceContext, renderingContext) every time the window is refreshed. This problem only happen on my laptop with “Intel Graphics Media Accelerator Driver” and it is no problem with my another PC that using nvidia graphic card. Any help is appreciated. Thanks !!!
The snippet code for the Initialization and desroy of opengl context is as follow:
void CreateContext(){
deviceContext = User.GetDC(windowHandle); // Attempt to get the device context
renderingContext = Wgl.wglCreateContext(deviceContext); // Attempt to get the rendering context
}
internal void DestroyContexts()
{
if(renderingContext != IntPtr.Zero)
{
Wgl.wglMakeCurrent(IntPtr.Zero, IntPtr.Zero);
Wgl.wglDeleteContext(renderingContext);
renderingContext = IntPtr.Zero;
}
if(deviceContext != IntPtr.Zero)
{
if(windowHandle != IntPtr.Zero)
{
User.ReleaseDC(windowHandle, deviceContext);
}
deviceContext = IntPtr.Zero;
}
return;
}