Problem with ChoosePixelFormat

Started by
5 comments, last by Brocketino 19 years, 1 month ago
I just installed windows XP and now the execution of my opengl applications halts at the ChoosePixelFormat call ( ChoosePixelFormat never returns? ) in the initialization process. Does anyone know how to fix this problem? The problem only occurs if i'm not switching to fullscreen, could it have something to do with the 'style' of the window? Right now i'm using WS_OVERLAPPEDWINDOW, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE. [Edited by - Brocketino on March 10, 2005 11:19:02 AM]
Advertisement
My window function uses the same styles and works fine, so that can be ruled out as the problem.

Have you tried using GetLastError() to get more info on the problem? It helped me when developing my window functions.
Quote:Original post by moonshine
Have you tried using GetLastError() to get more info on the problem? It helped me when developing my window functions.


I can't use GetLastError because the ChoosePixelFormat never returns!
It would probably help if you would post the code where you get the DC and the PIXELFORMATDESCRIPTOR, and then show the line where you actually call ChoosePixelFormat().
Quote:Original post by mumpo
It would probably help if you would post the code where you get the DC and the PIXELFORMATDESCRIPTOR, and then show the line where you actually call ChoosePixelFormat().


k. Here it is:)

BOOL CGLScene::Create(HWND hwnd, int bpp){	  int PixelFormat;		  static PIXELFORMATDESCRIPTOR pfd = { 	  sizeof(PIXELFORMATDESCRIPTOR),	  1,	  PFD_DRAW_TO_WINDOW | 	  PFD_SUPPORT_OPENGL | 	  PFD_DOUBLEBUFFER,	  PFD_TYPE_RGBA,	  bpp,	  0,0,0,0,0,0,	  0,	  0,	  0,	  0,0,0,0,	  32,	  0,	  0,	  PFD_MAIN_PLANE,	  0,	  0,0,0 };	  if(!(m_hdc = GetDC( hwnd ))) 		  return FALSE;	  if(!(PixelFormat = ChoosePixelFormat( m_hdc, &pfd )))		  return FALSE;	  if(!(SetPixelFormat(m_hdc,PixelFormat,&pfd)))		  return FALSE;          if(!(m_hrc = wglCreateContext(m_hdc)))		  return FALSE;	  if(!(wglMakeCurrent(m_hdc,m_hrc)))		  return FALSE;          return TRUE;}
Quote:Original post by Brocketino
...I just installed windows XP...


You did update all your drivers too, correct? If not, that could be a problem.
It's working now - installed the latest drivers for my graphic card.

This topic is closed to new replies.

Advertisement