Hello,
can somebody help me ?
I have problem with initializing of OpenGL window.
The first time after computer restarting, or after 1-2 minutes time break, calling of SetPixelFormat() function takes 10 seconds !
This occures only on ACER notebook with ATI graphic card. I tried to change pixel format, but the result was the same. Graphic driver is the latest. There is W-XP and NOVELL network installed.
This is the source code :
BOOL CPrintGLView::bSetupPixelFormat()
{
static PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};
int pixelformat;
if ( (pixelformat = ChoosePixelFormat(m_pDC->GetSafeHdc(), &pfd)) == 0 )
{
MessageBox(“ChoosePixelFormat failed”);
return FALSE;
}
if (SetPixelFormat(m_pDC->GetSafeHdc(), pixelformat, &pfd) == FALSE)
{
MessageBox(“SetPixelFormat failed”);
return FALSE;
}
return TRUE;
}