View Full Version : wglMakeCurrent -> GL_INVALID_VALUE

02-05-2009, 04:31 PM
Lately I've been getting a GL_INVALID_VALUE error on a few of my wglMakeCurrent calls when startup up my app. I think this is related to the 181.20 nvidia drivers, but I'm not sure..
I can't find any documentation about why wglMakeCurrent could throw this error.
Anyone have any ideas?

02-06-2009, 04:10 PM
Further investigation seems to say that this occurs if I try to do a wglMakeCurrent on a window DC that is a width or height of 0, or isn't visible (ShowWindow(WM_HIDE)). Older drivers never complained about this. Is this illegal?
I do this to create my 'startup' DC/RC so I can create my real windows with wglChoosePixelFormatARB etc.
Should I make the startup window visible?(1x1 in the corner or something).

02-11-2009, 04:42 AM
i never had problems with hidden window. example:

hdc = GetDC(hwnd);
pixelFormat = ChoosePixelFormat(hdc,&pfd);

try it on other hardware to know for sure.