static qboolean GLW_StartDriverAndSetMode( const char *drivername, int mode, qboolean fullscreen ) { rserr_t err; if (GLimp_sdl_init_video() == qfalse) return qfalse; // don't ever bother going into fullscreen with a voodoo card #if 1 // JDC: I reenabled this if ( Q_stristr( drivername, "Voodoo" ) ) { ri.Cvar_Set( "r_fullscreen", "0" ); r_fullscreen->modified = qfalse; fullscreen = qfalse; } #endif if (fullscreen && in_nograb->value) { ri.Printf( PRINT_ALL, "Fullscreen not allowed with in_nograb 1\n"); ri.Cvar_Set( "r_fullscreen", "0" ); r_fullscreen->modified = qfalse; fullscreen = qfalse; } err = GLW_SetMode( drivername, mode, fullscreen ); switch ( err ) { case RSERR_INVALID_FULLSCREEN: ri.Printf( PRINT_ALL, "...WARNING: fullscreen unavailable in this mode\n" ); return qfalse; case RSERR_INVALID_MODE: ri.Printf( PRINT_ALL, "...WARNING: could not set the given mode (%d)\n", mode ); return qfalse; default: break; } return qtrue; }
// *INDENT-OFF* int QGL_Init() { ri.Printf(PRINT_ALL, "...initializing QGL\n"); if(GLimp_sdl_init_video() == qfalse) return qfalse; qglBindTexture = dllBindTexture = GPA( "glBindTexture" ); qglBlendFunc = dllBlendFunc = GPA( "glBlendFunc" ); qglClear = dllClear = GPA( "glClear" ); qglClearColor = dllClearColor = GPA( "glClearColor" ); qglClearDepth = dllClearDepth = GPA( "glClearDepth" ); qglClearStencil = dllClearStencil = GPA( "glClearStencil" ); qglColorMask = dllColorMask = GPA( "glColorMask" ); qglCopyPixels = dllCopyPixels = GPA( "glCopyPixels" ); qglCopyTexImage1D = dllCopyTexImage1D = GPA( "glCopyTexImage1D" ); qglCopyTexImage2D = dllCopyTexImage2D = GPA( "glCopyTexImage2D" ); qglCopyTexSubImage1D = dllCopyTexSubImage1D = GPA( "glCopyTexSubImage1D" ); qglCopyTexSubImage2D = dllCopyTexSubImage2D = GPA( "glCopyTexSubImage2D" ); qglCullFace = dllCullFace = GPA( "glCullFace" ); qglDeleteTextures = dllDeleteTextures = GPA( "glDeleteTextures" ); qglDepthFunc = dllDepthFunc = GPA( "glDepthFunc" ); qglDepthMask = dllDepthMask = GPA( "glDepthMask" ); qglDepthRange = dllDepthRange = GPA( "glDepthRange" ); qglDisable = dllDisable = GPA( "glDisable" ); qglDrawArrays = dllDrawArrays = GPA( "glDrawArrays" ); qglDrawBuffer = dllDrawBuffer = GPA( "glDrawBuffer" ); qglDrawElements = dllDrawElements = GPA( "glDrawElements" ); qglEnable = dllEnable = GPA( "glEnable" ); qglFinish = dllFinish = GPA( "glFinish" ); qglFlush = dllFlush = GPA( "glFlush" ); qglFrontFace = dllFrontFace = GPA( "glFrontFace" ); qglGenTextures = dllGenTextures = GPA( "glGenTextures" ); qglGetBooleanv = dllGetBooleanv = GPA( "glGetBooleanv" ); qglGetError = dllGetError = GPA( "glGetError" ); qglGetFloatv = dllGetFloatv = GPA( "glGetFloatv" ); qglGetIntegerv = dllGetIntegerv = GPA( "glGetIntegerv" ); qglGetString = dllGetString = GPA( "glGetString" ); qglGetTexParameterfv = dllGetTexParameterfv = GPA( "glGetTexParameterfv" ); qglGetTexParameteriv = dllGetTexParameteriv = GPA( "glGetTexParameteriv" ); qglHint = dllHint = GPA( "glHint" ); qglIsEnabled = dllIsEnabled = GPA( "glIsEnabled" ); qglIsTexture = dllIsTexture = GPA( "glIsTexture" ); qglLineWidth = dllLineWidth = GPA( "glLineWidth" ); qglPolygonMode = dllPolygonMode = GPA( "glPolygonMode" ); qglPolygonOffset = dllPolygonOffset = GPA( "glPolygonOffset" ); qglReadPixels = dllReadPixels = GPA( "glReadPixels" ); qglScissor = dllScissor = GPA( "glScissor" ); qglStencilFunc = dllStencilFunc = GPA( "glStencilFunc" ); qglStencilMask = dllStencilMask = GPA( "glStencilMask" ); qglStencilOp = dllStencilOp = GPA( "glStencilOp" ); qglTexImage1D = dllTexImage1D = GPA( "glTexImage1D" ); qglTexImage2D = dllTexImage2D = GPA( "glTexImage2D" ); qglTexParameterf = dllTexParameterf = GPA( "glTexParameterf" ); qglTexParameterfv = dllTexParameterfv = GPA( "glTexParameterfv" ); qglTexParameteri = dllTexParameteri = GPA( "glTexParameteri" ); qglTexParameteriv = dllTexParameteriv = GPA( "glTexParameteriv" ); qglTexSubImage1D = dllTexSubImage1D = GPA( "glTexSubImage1D" ); qglTexSubImage2D = dllTexSubImage2D = GPA( "glTexSubImage2D" ); qglViewport = dllViewport = GPA( "glViewport" ); // check logging QGL_EnableLogging(r_logFile->integer); return qtrue; }