diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index 90e6d58c8..0545981ed 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -45,6 +45,7 @@ static double realglversion; // this is public so the statistics code can access EXTERN_CVAR(Bool, gl_legacy_mode) extern int currentrenderer; +EXTERN_CVAR(Int, vid_renderer); CVAR(Bool, gl_riskymodernpath, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) //========================================================================== @@ -190,7 +191,8 @@ void gl_LoadExtensions() // Don't even start if it's lower than 2.0 or no framebuffers are available (The framebuffer extension is needed for glGenerateMipmapsEXT!) if ((gl_version < 2.0f || !CheckExtension("GL_EXT_framebuffer_object")) && gl_version < 3.0f) { - I_FatalError("Unsupported OpenGL version.\nAt least OpenGL 2.0 with framebuffer support is required to run " GAMENAME ".\n"); + vid_renderer = 0; + I_FatalError("Unsupported OpenGL version.\nAt least OpenGL 2.0 with framebuffer support is required to run " GAMENAME ".\nFalling back to software renderer.\n"); } gl.es = false; diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index b7d591e48..ce82dceaf 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -854,14 +854,16 @@ bool Win32GLVideo::SetupPixelFormat(int multisample) if (pfd.dwFlags & PFD_GENERIC_FORMAT) { - I_Error("R_OPENGL: OpenGL driver not accelerated!"); + vid_renderer = 0; + I_Error("R_OPENGL: OpenGL driver not accelerated! Falling back to software renderer.\n"); return false; } } if (!::SetPixelFormat(m_hDC, pixelFormat, NULL)) { - I_Error("R_OPENGL: Couldn't set pixel format.\n"); + vid_renderer = 0; + I_Error("R_OPENGL: Couldn't set pixel format. Reverting to software mode...\n"); return false; } return true; @@ -917,7 +919,8 @@ bool Win32GLVideo::InitHardware (HWND Window, int multisample) m_hRC = wglCreateContext(m_hDC); if (m_hRC == NULL) { - I_Error("R_OPENGL: Unable to create an OpenGL render context.\n"); + vid_renderer = 0; + I_Error("R_OPENGL: Unable to create an OpenGL render context. Reverting to software mode...\n"); return false; } } @@ -929,7 +932,8 @@ bool Win32GLVideo::InitHardware (HWND Window, int multisample) } } // We get here if the driver doesn't support the modern context creation API which always means an old driver. - I_Error ("R_OPENGL: Unable to create an OpenGL render context. Insufficient driver support for context creation\n"); + vid_renderer = 0; + I_Error ("R_OPENGL: Unable to create an OpenGL render context. Insufficient driver support for context creation. Reverting to software mode...\n"); return false; }