Just getting back into the world of GPGPU and I find that an NVIDIA driver update has broken my terribly fragile context creation code. It had to break in the end, I guess, so I should get round to doing it properly now.
My previous approach went something along these lines:
// Create the hidden window.
_window = CreateWindow("GLOffWindow", "GLOffWindow",
(WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_POPUP),
0, 0, 0, 0, NULL, NULL, hinstance, NULL);
// Obtain the device context from the hidden window.
_windowDC = GetDC(_window);
// Set up an off-screen pixel format.
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), 1,
(PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER),
PFD_TYPE_RGBA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
PFD_MAIN_PLANE, 0, 0, 0, 0
};
int pixelformat = ChoosePixelFormat(_windowDC, &pfd);
SetPixelFormat(_windowDC, pixelformat, &pfd);
// Create an OpenGL context with the window.
_windowRC = wglCreateContext(_windowDC);
// Associate the OpenGL context with this thread.
wglMakeCurrent(_windowDC, _windowRC);
This now causes a horrible full-screen flicker on exit, and things are running slower than they should be (but perhaps something else has broken in that respect).
Is there a proper way to create an off-screen OpenGL context, or is the only approach (with true acceleration; i.e. so I can get handles on the FBO extension pointers) to create a visible window and live with it?
Many thanks for any input.