Adds gl_profile_mask to test framework, uses it in testgles
authorGabriel Jacobo <gabomdq@gmail.com>
Thu, 10 Oct 2013 00:49:57 -0300
changeset 7796 75c80f36038e
parent 7795 6acc7df4a175
child 7797 40543ce6e842
Adds gl_profile_mask to test framework, uses it in testgles
include/SDL_test_common.h
src/test/SDL_test_common.c
test/testgles.c
--- a/include/SDL_test_common.h	Thu Oct 10 00:30:03 2013 -0300
+++ b/include/SDL_test_common.h	Thu Oct 10 00:49:57 2013 -0300
@@ -108,6 +108,7 @@
     int gl_major_version;
     int gl_minor_version;
     int gl_debug;
+    int gl_profile_mask;
 } SDLTest_CommonState;
 
 #include "begin_code.h"
--- a/src/test/SDL_test_common.c	Thu Oct 10 00:30:03 2013 -0300
+++ b/src/test/SDL_test_common.c	Thu Oct 10 00:49:57 2013 -0300
@@ -695,6 +695,9 @@
         if (state->gl_debug) {
             SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
         }
+        if (state->gl_profile_mask) {
+            SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, state->gl_profile_mask);
+        }
 
         if (state->verbose & VERBOSE_MODES) {
             SDL_Rect bounds;
--- a/test/testgles.c	Thu Oct 10 00:30:03 2013 -0300
+++ b/test/testgles.c	Thu Oct 10 00:49:57 2013 -0300
@@ -161,6 +161,7 @@
     state->gl_depth_size = depth;
     state->gl_major_version = 1;
     state->gl_minor_version = 1;
+    state->gl_profile_mask = SDL_GL_CONTEXT_PROFILE_ES;
     if (fsaa) {
         state->gl_multisamplebuffers=1;
         state->gl_multisamplesamples=fsaa;
@@ -179,8 +180,6 @@
     }
 
     /* Create OpenGL ES contexts */
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
-
     for (i = 0; i < state->num_windows; i++) {
         context[i] = SDL_GL_CreateContext(state->windows[i]);
         if (!context[i]) {