-#ifdef _WINDOWS\r
-BOOL bSetupPixelFormat(HDC hDC)\r
-{\r
- int pixelformat;\r
- static PIXELFORMATDESCRIPTOR pfd = \r
- {\r
- sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd\r
- 1, // version number\r
- PFD_DRAW_TO_WINDOW | // support window\r
- PFD_SUPPORT_OPENGL | // support OpenGL\r
- PFD_DOUBLEBUFFER, // double buffered\r
- PFD_TYPE_RGBA, // RGBA type\r
- 16, // 16-bit color depth (adjusted later)\r
- 0, 0, 0, 0, 0, 0, // color bits ignored\r
- 0, // no alpha buffer\r
- 0, // shift bit ignored\r
- 0, // no accumulation buffer\r
- 0, 0, 0, 0, // accum bits ignored\r
- 0, // z-buffer \r
- 0,\r
- 0, // no auxiliary buffer\r
- PFD_MAIN_PLANE, // main layer\r
- 0, // reserved\r
- 0, 0, 0 // layer masks ignored\r
- };\r
- \r
- pfd.cColorBits=iColDepth; // set user color depth\r
- pfd.cDepthBits=iZBufferDepth; // set user zbuffer (by psx mask)\r
-\r
- if((pixelformat=ChoosePixelFormat(hDC,&pfd))==0) \r
- {\r
- MessageBox(NULL,"ChoosePixelFormat failed","Error",MB_OK);\r
- return FALSE;\r
- }\r
-\r
- if(SetPixelFormat(hDC,pixelformat, &pfd)==FALSE)\r
- {\r
- MessageBox(NULL,"SetPixelFormat failed","Error",MB_OK);\r
- return FALSE;\r
- }\r
-\r
- return TRUE;\r
-}\r
-#endif\r