Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Cleanups to Windows WGL_EXT_swap_control_tear code.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 2, 2012
1 parent e5c2fb9 commit c7c5d97
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/video/windows/SDL_windowsopengl.c
Expand Up @@ -611,26 +611,29 @@ WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
int
WIN_GL_SetSwapInterval(_THIS, int interval)
{
int retval = -1;
if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) {
SDL_SetError("Negative swap interval unsupported in this GL");
} else if (_this->gl_data->wglSwapIntervalEXT) {
_this->gl_data->wglSwapIntervalEXT(interval);
return 0;
if (_this->gl_data->wglSwapIntervalEXT(interval) == TRUE) {
retval = 0;
} else {
WIN_SetError("wglSwapIntervalEXT()");
}
} else {
SDL_Unsupported();
return -1;
}
return retval;
}

int
WIN_GL_GetSwapInterval(_THIS)
{
int retval = 0;
if (_this->gl_data->wglGetSwapIntervalEXT) {
return _this->gl_data->wglGetSwapIntervalEXT();
} else {
/*SDL_Unsupported();*/
return 0; /* just say we're unsync'd. */
retval = _this->gl_data->wglGetSwapIntervalEXT();
}
return retval;
}

void
Expand Down

0 comments on commit c7c5d97

Please sign in to comment.