PDA

View Full Version : wglMakeCurrent -> GL_INVALID_VALUE



MalcolmB
02-05-2009, 03: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?

MalcolmB
02-06-2009, 03: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).

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

ShowWindow(hwnd,SW_HIDE);
hdc = GetDC(hwnd);
pixelFormat = ChoosePixelFormat(hdc,&pfd);
SetPixelFormat(hdc,pixelFormat,&pfd);
wglMakeCurrent(hdc,wglCreateContext(hdc));

try it on other hardware to know for sure.