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

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit 2955f8dadb0c521218b634eb98da41de9c429a51
Author: SmileTheory <[email protected]>
Date:   Thu Aug 3 14:20:33 2017 -0700

    Reject OpenGL contexts w/ software renderer when core context requested.
---
 code/sdl/sdl_glimp.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c
index abb66ec..454c2bf 100644
--- a/code/sdl/sdl_glimp.c
+++ b/code/sdl/sdl_glimp.c
@@ -499,7 +499,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/ioquake3.git

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to