35 #include "../ref_gl/gl_local.h"
53 if ( strcmp(
buffer,
"gdi generic" ) == 0 )
62 #define WINDOW_CLASS_NAME "Quake 2"
80 wc.hCursor = LoadCursor (
NULL,IDC_ARROW);
81 wc.hbrBackground = (
void *)COLOR_GRAYTEXT;
85 if (!RegisterClass (&wc) )
90 exstyle = WS_EX_TOPMOST;
91 stylebits = WS_POPUP|WS_VISIBLE;
104 AdjustWindowRect (&
r, stylebits, FALSE);
106 w =
r.right -
r.left;
107 h =
r.bottom -
r.top;
162 const char *win_fs[] = {
"W",
"FS" };
189 memset( &dm, 0,
sizeof( dm ) );
191 dm.dmSize =
sizeof( dm );
193 dm.dmPelsWidth =
width;
195 dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
200 dm.dmFields |= DM_BITSPERPEL;
206 int bitspixel = GetDeviceCaps( hdc, BITSPIXEL );
214 if ( ChangeDisplaySettings( &dm, CDS_FULLSCREEN ) == DISP_CHANGE_SUCCESSFUL )
237 dm.dmPelsWidth =
width * 2;
239 dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
244 dm.dmFields |= DM_BITSPERPEL;
251 if ( ChangeDisplaySettings( &dm, CDS_FULLSCREEN ) != DISP_CHANGE_SUCCESSFUL )
257 ChangeDisplaySettings( 0, 0 );
281 ChangeDisplaySettings( 0, 0 );
304 if ( qwglMakeCurrent && !qwglMakeCurrent(
NULL,
NULL ) )
334 ChangeDisplaySettings( 0, 0 );
349 #define OSR2_BUILD_NUMBER 1111
353 vinfo.dwOSVersionInfoSize =
sizeof(vinfo);
357 if ( GetVersionEx( &vinfo) )
359 if ( vinfo.dwMajorVersion > 4 )
363 else if ( vinfo.dwMajorVersion == 4 )
365 if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
369 else if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
392 PIXELFORMATDESCRIPTOR pfd =
394 sizeof(PIXELFORMATDESCRIPTOR),
421 if ( stereo->
value != 0 )
424 pfd.dwFlags |= PFD_STEREO;
454 if ( (pixelformat = qwglChoosePixelFormat(
glw_state.
hDC, &pfd)) == 0 )
459 if ( qwglSetPixelFormat(
glw_state.
hDC, pixelformat, &pfd) == FALSE )
464 qwglDescribePixelFormat(
glw_state.
hDC, pixelformat,
sizeof( pfd ), &pfd );
468 if ( ( pixelformat = ChoosePixelFormat(
glw_state.
hDC, &pfd)) == 0 )
473 if ( SetPixelFormat(
glw_state.
hDC, pixelformat, &pfd) == FALSE )
478 DescribePixelFormat(
glw_state.
hDC, pixelformat,
sizeof( pfd ), &pfd );
480 if ( !( pfd.dwFlags & PFD_GENERIC_ACCELERATED ) )
498 if ( !( pfd.dwFlags & PFD_STEREO ) && ( stereo->
value != 0 ) )
532 ri.
Con_Printf(
PRINT_ALL,
"GL PFD: color(%d-bits) Z(%d-bit)\n", (
int ) pfd.cColorBits, (
int ) pfd.cDepthBits );
568 qglDrawBuffer( GL_BACK_LEFT );
572 qglDrawBuffer( GL_BACK_RIGHT );
576 qglDrawBuffer( GL_BACK );
592 assert( err == GL_NO_ERROR );