Simplification and cleanup of windows opengl initialization.
Removed r_colorbits, use desktop color depth as default value. Nevertheless if there are issues when looking for corresponding pixel format it is still posible to obtain pixel format with color depth that is different from desktop color. No changes to game modules, which means that game UI can still set r_colorbits but it has no effect.
This commit is contained in:
@@ -35,14 +35,11 @@ typedef struct
|
||||
|
||||
HINSTANCE hinstOpenGL; // HINSTANCE for the OpenGL library
|
||||
|
||||
qboolean allowdisplaydepthchange;
|
||||
qboolean pixelFormatSet;
|
||||
|
||||
int desktopBitsPixel;
|
||||
int desktopWidth, desktopHeight;
|
||||
|
||||
qboolean cdsFullscreen;
|
||||
|
||||
FILE *log_fp;
|
||||
} glwstate_t;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3192,25 +3192,10 @@ void QGL_Shutdown( void )
|
||||
*/
|
||||
qboolean QGL_Init( const char *dllname )
|
||||
{
|
||||
char systemDir[1024];
|
||||
char libName[1024];
|
||||
|
||||
GetSystemDirectory( systemDir, sizeof( systemDir ) );
|
||||
|
||||
assert( glw_state.hinstOpenGL == 0 );
|
||||
|
||||
ri.Printf( PRINT_ALL, "...initializing QGL\n" );
|
||||
|
||||
if ( dllname[0] != '!' )
|
||||
{
|
||||
Com_sprintf( libName, sizeof( libName ), "%s\\%s", systemDir, dllname );
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_strncpyz( libName, dllname, sizeof( libName ) );
|
||||
}
|
||||
|
||||
ri.Printf( PRINT_ALL, "...calling LoadLibrary( '%s.dll' ): ", libName );
|
||||
ri.Printf( PRINT_ALL, "...calling LoadLibrary('%s'): ", dllname );
|
||||
|
||||
if ( ( glw_state.hinstOpenGL = LoadLibrary( dllname ) ) == 0 )
|
||||
{
|
||||
|
||||
@@ -38,45 +38,6 @@ extern cvar_t *r_fullscreen;
|
||||
|
||||
LONG WINAPI MainWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
static qboolean s_alttab_disabled;
|
||||
|
||||
static void WIN_DisableAltTab( void )
|
||||
{
|
||||
if ( s_alttab_disabled )
|
||||
return;
|
||||
|
||||
if ( !Q_stricmp( Cvar_VariableString( "arch" ), "winnt" ) )
|
||||
{
|
||||
RegisterHotKey( 0, 0, MOD_ALT, VK_TAB );
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOL old;
|
||||
|
||||
SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, &old, 0 );
|
||||
}
|
||||
s_alttab_disabled = qtrue;
|
||||
}
|
||||
|
||||
static void WIN_EnableAltTab( void )
|
||||
{
|
||||
if ( s_alttab_disabled )
|
||||
{
|
||||
if ( !Q_stricmp( Cvar_VariableString( "arch" ), "winnt" ) )
|
||||
{
|
||||
UnregisterHotKey( 0, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOL old;
|
||||
|
||||
SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, &old, 0 );
|
||||
}
|
||||
|
||||
s_alttab_disabled = qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
VID_AppActivate
|
||||
@@ -287,15 +248,6 @@ LONG WINAPI MainWndProc (
|
||||
vid_ypos = Cvar_Get ("vid_ypos", "22", CVAR_ARCHIVE);
|
||||
r_fullscreen = Cvar_Get ("r_fullscreen", "1", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
|
||||
if ( r_fullscreen->integer )
|
||||
{
|
||||
WIN_DisableAltTab();
|
||||
}
|
||||
else
|
||||
{
|
||||
WIN_EnableAltTab();
|
||||
}
|
||||
|
||||
break;
|
||||
#if 0
|
||||
case WM_DISPLAYCHANGE:
|
||||
@@ -314,10 +266,6 @@ LONG WINAPI MainWndProc (
|
||||
case WM_DESTROY:
|
||||
// let sound and input know about this?
|
||||
g_wv.hWnd = NULL;
|
||||
if ( r_fullscreen->integer )
|
||||
{
|
||||
WIN_EnableAltTab();
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
|
||||
Reference in New Issue
Block a user