Delay in ChoosePixelFormat

Hi,

I’m running the following code, and get a 10 sec. delay between the two 'cout’s:

   
void setupPixelFormat(HDC hDC)
{
    PIXELFORMATDESCRIPTOR pfd = {
        sizeof(PIXELFORMATDESCRIPTOR),  // size 
        1,                              // version 
        PFD_SUPPORT_OPENGL |
        PFD_DRAW_TO_WINDOW |
        PFD_DOUBLEBUFFER,               // support double-buffering 
        PFD_TYPE_RGBA,                  // color type 
        16,                             // prefered color depth 
        0, 0, 0, 0, 0, 0,               // color bits (ignored) 
        0,                              // no alpha buffer 
        0,                              // alpha bits (ignored) 
        0,                              // no accumulation buffer 
        0, 0, 0, 0,                     // accum bits (ignored) 
        16,                             // depth buffer 
        0,                              // no stencil buffer 
        0,                              // no auxiliary buffers 
        PFD_MAIN_PLANE,                 // main layer 
        0,                              // reserved 
        0, 0, 0,                        // no layer, visible, damage masks 
    };
    int pixelFormat;

cout << "before ChoosePixelFormat
";
    pixelFormat = ChoosePixelFormat(hDC, &pfd);
    if ( pixelFormat == 0 ) 
	{
        MessageBox(WindowFromDC(hDC), "ChoosePixelFormat failed.", "Error",
                MB_ICONERROR | MB_OK);
        exit(1);
    }
cout << "after ChoosePixelFormat
";

    if ( SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE ) 
	{
        MessageBox(WindowFromDC(hDC), "SetPixelFormat failed.", "Error",
                MB_ICONERROR | MB_OK);
        exit(1);
    }
}

I’m running .Net 2003 on win2k pro, with GeForce 2.

Thanks.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.