I’m new to OpenGL programming and I’m running into a problem after following the example from NeHe’s page on creating a blank OpenGL window. After compiling and linking my program successfully, when I run the executable, I get an error saying “Can’t Set the PixelFormat”. I’m guessing that if anyone can help me, they’ll need the source to do so. Here’s the descriptor as well as the call to SetPixelFormat.
Thanks in advance.
static PIXELFORMATDESCRIPTOR pfd=
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW |
PFD_SUPPORT_OPENGL |
PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
bits,
0, 0, 0, 0, 0, 0,
0,
0,
0,
0, 0, 0, 0,
16,
0,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0
};
if(!SetPixelFormat(hDC,PixelFormat,&pfd)))
{
KillGLWindow();
MessageBox(NULL,“Can’t Set The PixelFormat.”,“ERROR”,MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}