Skip to content

Commit

Permalink
Windows: If we don't care about OpenGL accel and FULL fails, try NO a…
Browse files Browse the repository at this point in the history
…ccel.
  • Loading branch information
icculus committed Nov 7, 2011
1 parent 12e18bf commit 4e5ebc2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/video/wincommon/SDL_wingl.c
Expand Up @@ -176,6 +176,7 @@ int WIN_GL_SetupWindow(_THIS)
int i;
int iAttribs[64];
int *iAttr;
int *iAccelAttr = NULL;
float fAttribs[1] = { 0 };
const GLubyte *(WINAPI *glGetStringFunc)(GLenum);
const char *wglext;
Expand Down Expand Up @@ -232,6 +233,7 @@ int WIN_GL_SetupWindow(_THIS)
probably what they wanted (and if you didn't care and got FULL, that's
a perfectly valid result in any case. */
*iAttr++ = WGL_ACCELERATION_ARB;
iAccelAttr = iAttr;
if (this->gl_config.accelerated) {
*iAttr++ = WGL_FULL_ACCELERATION_ARB;
} else {
Expand Down Expand Up @@ -301,6 +303,12 @@ int WIN_GL_SetupWindow(_THIS)

/* Choose and set the closest available pixel format */
pixel_format = ChoosePixelFormatARB(this, iAttribs, fAttribs);
/* App said "don't care about accel" and FULL accel failed. Try NO. */
if ( ( !pixel_format ) && ( this->gl_config.accelerated < 0 ) ) {
*iAccelAttr = WGL_NO_ACCELERATION_ARB;
pixel_format = ChoosePixelFormatARB(this, iAttribs, fAttribs);
*iAccelAttr = WGL_FULL_ACCELERATION_ARB; /* if we try again. */
}
if ( !pixel_format ) {
pixel_format = ChoosePixelFormat(GL_hdc, &GL_pfd);
}
Expand Down

0 comments on commit 4e5ebc2

Please sign in to comment.