Default to allow either accelerated or not

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404320
This commit is contained in:
Sam Lantinga 2009-12-15 20:53:09 +00:00
parent fe2b42f86c
commit 240b5fcaab
7 changed files with 54 additions and 36 deletions

View file

@ -239,7 +239,7 @@ SDL_VideoInit(const char *driver_name, Uint32 flags)
_this->gl_config.multisamplebuffers = 0;
_this->gl_config.multisamplesamples = 0;
_this->gl_config.retained_backing = 1;
_this->gl_config.accelerated = 1;
_this->gl_config.accelerated = -1; /* accelerated or not, both are fine */
_this->gl_config.major_version = 2;
_this->gl_config.minor_version = 1;
@ -3274,7 +3274,7 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
case SDL_GL_ACCELERATED_VISUAL:
{
/* FIXME: How do we get this information? */
*value = _this->gl_config.accelerated;
*value = (_this->gl_config.accelerated != 0);
return 0;
}
default:

View file

@ -133,11 +133,13 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
attr[i++] = NSOpenGLPFANoRecovery;
}
if (_this->gl_config.accelerated) {
attr[i++] = NSOpenGLPFAAccelerated;
} else {
attr[i++] = NSOpenGLPFARendererID;
attr[i++] = kCGLRendererGenericFloatID;
if (_this->gl_config.accelerated >= 0) {
if (_this->gl_config.accelerated) {
attr[i++] = NSOpenGLPFAAccelerated;
} else {
attr[i++] = NSOpenGLPFARendererID;
attr[i++] = kCGLRendererGenericFloatID;
}
}
attr[i++] = NSOpenGLPFAScreenMask;

View file

@ -469,9 +469,12 @@ WIN_GL_SetupWindow(_THIS, SDL_Window * window)
*iAttr++ = _this->gl_config.multisamplesamples;
}
*iAttr++ = WGL_ACCELERATION_ARB;
*iAttr++ = (_this->gl_config.accelerated ? WGL_GENERIC_ACCELERATION_ARB :
WGL_NO_ACCELERATION_ARB);
if (_this->gl_config.accelerated >= 0) {
*iAttr++ = WGL_ACCELERATION_ARB;
*iAttr++ =
(_this->gl_config.accelerated ? WGL_GENERIC_ACCELERATION_ARB :
WGL_NO_ACCELERATION_ARB);
}
*iAttr = 0;

View file

@ -359,7 +359,8 @@ X11_GL_GetVisual(_THIS, Display * display, int screen)
attribs[i++] = _this->gl_config.multisamplesamples;
}
if (_this->gl_data->HAS_GLX_EXT_visual_rating) {
if (_this->gl_config.accelerated >= 0 &&
_this->gl_data->HAS_GLX_EXT_visual_rating) {
attribs[i++] = GLX_VISUAL_CAVEAT_EXT;
attribs[i++] = _this->gl_config.accelerated ? GLX_NONE_EXT :
GLX_SLOW_VISUAL_EXT;