Add SDL_GL_ResetAttributes.
--HG-- extra : rebase_source : 0a6fd1c977ab93ba651adaae3fa5a71d7c69fa8e
This commit is contained in:
parent
a09aac7720
commit
d17c440442
4 changed files with 51 additions and 33 deletions
|
@ -477,39 +477,7 @@ SDL_VideoInit(const char *driver_name)
|
|||
/* Set some very sane GL defaults */
|
||||
_this->gl_config.driver_loaded = 0;
|
||||
_this->gl_config.dll_handle = NULL;
|
||||
_this->gl_config.red_size = 3;
|
||||
_this->gl_config.green_size = 3;
|
||||
_this->gl_config.blue_size = 2;
|
||||
_this->gl_config.alpha_size = 0;
|
||||
_this->gl_config.buffer_size = 0;
|
||||
_this->gl_config.depth_size = 16;
|
||||
_this->gl_config.stencil_size = 0;
|
||||
_this->gl_config.double_buffer = 1;
|
||||
_this->gl_config.accum_red_size = 0;
|
||||
_this->gl_config.accum_green_size = 0;
|
||||
_this->gl_config.accum_blue_size = 0;
|
||||
_this->gl_config.accum_alpha_size = 0;
|
||||
_this->gl_config.stereo = 0;
|
||||
_this->gl_config.multisamplebuffers = 0;
|
||||
_this->gl_config.multisamplesamples = 0;
|
||||
_this->gl_config.retained_backing = 1;
|
||||
_this->gl_config.accelerated = -1; /* accelerated or not, both are fine */
|
||||
_this->gl_config.profile_mask = 0;
|
||||
#if SDL_VIDEO_OPENGL
|
||||
_this->gl_config.major_version = 2;
|
||||
_this->gl_config.minor_version = 1;
|
||||
#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;
|
||||
#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;
|
||||
#endif
|
||||
_this->gl_config.flags = 0;
|
||||
|
||||
_this->gl_config.share_with_current_context = 0;
|
||||
SDL_GL_ResetAttributes();
|
||||
|
||||
_this->current_glwin_tls = SDL_TLSCreate();
|
||||
_this->current_glctx_tls = SDL_TLSCreate();
|
||||
|
@ -2547,6 +2515,49 @@ SDL_GL_ExtensionSupported(const char *extension)
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
SDL_GL_ResetAttributes()
|
||||
{
|
||||
if (!_this) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this->gl_config.red_size = 3;
|
||||
_this->gl_config.green_size = 3;
|
||||
_this->gl_config.blue_size = 2;
|
||||
_this->gl_config.alpha_size = 0;
|
||||
_this->gl_config.buffer_size = 0;
|
||||
_this->gl_config.depth_size = 16;
|
||||
_this->gl_config.stencil_size = 0;
|
||||
_this->gl_config.double_buffer = 1;
|
||||
_this->gl_config.accum_red_size = 0;
|
||||
_this->gl_config.accum_green_size = 0;
|
||||
_this->gl_config.accum_blue_size = 0;
|
||||
_this->gl_config.accum_alpha_size = 0;
|
||||
_this->gl_config.stereo = 0;
|
||||
_this->gl_config.multisamplebuffers = 0;
|
||||
_this->gl_config.multisamplesamples = 0;
|
||||
_this->gl_config.retained_backing = 1;
|
||||
_this->gl_config.accelerated = -1; /* accelerated or not, both are fine */
|
||||
_this->gl_config.profile_mask = 0;
|
||||
#if SDL_VIDEO_OPENGL
|
||||
_this->gl_config.major_version = 2;
|
||||
_this->gl_config.minor_version = 1;
|
||||
#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;
|
||||
#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;
|
||||
#endif
|
||||
_this->gl_config.flags = 0;
|
||||
_this->gl_config.framebuffer_srgb_capable = 0;
|
||||
|
||||
_this->gl_config.share_with_current_context = 0;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_GL_SetAttribute(SDL_GLattr attr, int value)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue