From 89131435f8ef7596ce77761bedb5a8aa214e6f61 Mon Sep 17 00:00:00 2001 From: Gabriel Jacobo Date: Thu, 10 Oct 2013 00:49:57 -0300 Subject: [PATCH] Adds gl_profile_mask to test framework, uses it in testgles --- include/SDL_test_common.h | 1 + src/test/SDL_test_common.c | 3 +++ test/testgles.c | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/SDL_test_common.h b/include/SDL_test_common.h index f07acf7c1..57f31146e 100644 --- a/include/SDL_test_common.h +++ b/include/SDL_test_common.h @@ -108,6 +108,7 @@ typedef struct int gl_major_version; int gl_minor_version; int gl_debug; + int gl_profile_mask; } SDLTest_CommonState; #include "begin_code.h" diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 4e9429e63..981e3cdcb 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -695,6 +695,9 @@ SDLTest_CommonInit(SDLTest_CommonState * state) 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; diff --git a/test/testgles.c b/test/testgles.c index 69322a234..4e1bc074c 100644 --- a/test/testgles.c +++ b/test/testgles.c @@ -161,6 +161,7 @@ main(int argc, char *argv[]) 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 @@ main(int argc, char *argv[]) } /* 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]) {