video: Set up default before calling GL_DefaultProfileConfig(). This way, the implementation can opt to do nothing to accept SDL's defaults.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 182b3c7..6696e6c 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -3149,24 +3149,24 @@ SDL_GL_ResetAttributes()
_this->gl_config.retained_backing = 1;
_this->gl_config.accelerated = -1; /* accelerated or not, both are fine */
- if (_this->GL_DefaultProfileConfig) {
- _this->GL_DefaultProfileConfig(_this, &_this->gl_config.profile_mask,
- &_this->gl_config.major_version,
- &_this->gl_config.minor_version);
- } else {
#if SDL_VIDEO_OPENGL
- _this->gl_config.major_version = 2;
- _this->gl_config.minor_version = 1;
- _this->gl_config.profile_mask = 0;
+ _this->gl_config.major_version = 2;
+ _this->gl_config.minor_version = 1;
+ _this->gl_config.profile_mask = 0;
#elif SDL_VIDEO_OPENGL_ES2
- _this->gl_config.major_version = 2;
- _this->gl_config.minor_version = 0;
- _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;
+ _this->gl_config.major_version = 2;
+ _this->gl_config.minor_version = 0;
+ _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;
#elif SDL_VIDEO_OPENGL_ES
- _this->gl_config.major_version = 1;
- _this->gl_config.minor_version = 1;
- _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;
+ _this->gl_config.major_version = 1;
+ _this->gl_config.minor_version = 1;
+ _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;
#endif
+
+ if (_this->GL_DefaultProfileConfig) {
+ _this->GL_DefaultProfileConfig(_this, &_this->gl_config.profile_mask,
+ &_this->gl_config.major_version,
+ &_this->gl_config.minor_version);
}
_this->gl_config.flags = 0;