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;
135 memset(&dm, 0,
sizeof(dm));
137 dm.dmSize =
sizeof(dm);
138 dm.dmPelsWidth =
width;
140 dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
145 dm.dmFields |= DM_BITSPERPEL;
148 if ( ChangeDisplaySettingsEx(
glw_state.
monInfo.szDevice, &dm,
NULL, CDS_FULLSCREEN,
NULL ) != DISP_CHANGE_SUCCESSFUL )
155 SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_NOREPOSITION | SWP_NOZORDER );
188 const char *win_fs[] = {
"W",
"FS" };
220 int bitspixel = GetDeviceCaps( hdc, BITSPIXEL );
278 if ( qwglMakeCurrent && !qwglMakeCurrent(
NULL,
NULL ) )
323 #define OSR2_BUILD_NUMBER 1111
327 vinfo.dwOSVersionInfoSize =
sizeof(vinfo);
331 if ( GetVersionEx( &vinfo) )
333 if ( vinfo.dwMajorVersion > 4 )
337 else if ( vinfo.dwMajorVersion == 4 )
339 if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
343 else if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
366 PIXELFORMATDESCRIPTOR pfd =
368 sizeof(PIXELFORMATDESCRIPTOR),
395 if ( stereo->
value != 0 )
398 pfd.dwFlags |= PFD_STEREO;
428 if ( (pixelformat = qwglChoosePixelFormat(
glw_state.
hDC, &pfd)) == 0 )
438 qwglDescribePixelFormat(
glw_state.
hDC, pixelformat,
sizeof( pfd ), &pfd );
442 if ( ( pixelformat = ChoosePixelFormat(
glw_state.
hDC, &pfd)) == 0 )
452 DescribePixelFormat(
glw_state.
hDC, pixelformat,
sizeof( pfd ), &pfd );
454 if ( !( pfd.dwFlags & PFD_GENERIC_ACCELERATED ) )
472 if ( !( pfd.dwFlags & PFD_STEREO ) && ( stereo->
value != 0 ) )
506 ri.
Con_Printf(
PRINT_ALL,
"GL PFD: color(%d-bits) Z(%d-bit)\n", (
int ) pfd.cColorBits, (
int ) pfd.cDepthBits );
542 qglDrawBuffer( GL_BACK_LEFT );
546 qglDrawBuffer( GL_BACK_RIGHT );
550 qglDrawBuffer( GL_BACK );
566 assert( err == GL_NO_ERROR );