[iortcw] 83/89: All: Rend2: Reject OpenGL contexts w/ software renderer when core context requested

Simon McVittie smcv at debian.org
Fri Sep 8 10:44:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to tag 1.51b
in repository iortcw.

commit efb55f8aaf80185b3973d3a31224d486b386f797
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Sat Aug 5 08:09:02 2017 -0400

    All: Rend2: Reject OpenGL contexts w/ software renderer when core context requested
---
 MP/code/sdl/sdl_glimp.c | 17 ++++++++++++++++-
 SP/code/sdl/sdl_glimp.c | 17 ++++++++++++++++-
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/MP/code/sdl/sdl_glimp.c b/MP/code/sdl/sdl_glimp.c
index c3d91ef..c8a5ebe 100644
--- a/MP/code/sdl/sdl_glimp.c
+++ b/MP/code/sdl/sdl_glimp.c
@@ -550,7 +550,22 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 			}
 			else
 			{
-				ri.Printf(PRINT_ALL, "SDL_GL_CreateContext succeeded, but: %s\n", SDL_GetError());
+				const char *renderer;
+
+				ri.Printf(PRINT_ALL, "SDL_GL_CreateContext succeeded.\n");
+
+				renderer = (const char *)qglGetString(GL_RENDERER);
+				if (renderer && (strstr(renderer, "Software Renderer") || strstr(renderer, "Software Rasterizer")))
+				{
+					ri.Printf(PRINT_ALL, "GL_RENDERER is %s, rejecting context\n", renderer);
+
+					SDL_GL_DeleteContext(SDL_glContext);
+					SDL_glContext = NULL;
+
+					SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, profileMask);
+					SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, majorVersion);
+					SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minorVersion);
+				}
 			}
 		}
 		else
diff --git a/SP/code/sdl/sdl_glimp.c b/SP/code/sdl/sdl_glimp.c
index c3d91ef..c8a5ebe 100644
--- a/SP/code/sdl/sdl_glimp.c
+++ b/SP/code/sdl/sdl_glimp.c
@@ -550,7 +550,22 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 			}
 			else
 			{
-				ri.Printf(PRINT_ALL, "SDL_GL_CreateContext succeeded, but: %s\n", SDL_GetError());
+				const char *renderer;
+
+				ri.Printf(PRINT_ALL, "SDL_GL_CreateContext succeeded.\n");
+
+				renderer = (const char *)qglGetString(GL_RENDERER);
+				if (renderer && (strstr(renderer, "Software Renderer") || strstr(renderer, "Software Rasterizer")))
+				{
+					ri.Printf(PRINT_ALL, "GL_RENDERER is %s, rejecting context\n", renderer);
+
+					SDL_GL_DeleteContext(SDL_glContext);
+					SDL_glContext = NULL;
+
+					SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, profileMask);
+					SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, majorVersion);
+					SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minorVersion);
+				}
 			}
 		}
 		else

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list