Cleanups to Windows WGL_EXT_swap_control_tear code.
This commit is contained in:
parent
2cd5fc4e97
commit
55a52db07d
1 changed files with 10 additions and 7 deletions
|
@ -611,26 +611,29 @@ WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
|
||||||
int
|
int
|
||||||
WIN_GL_SetSwapInterval(_THIS, int interval)
|
WIN_GL_SetSwapInterval(_THIS, int interval)
|
||||||
{
|
{
|
||||||
|
int retval = -1;
|
||||||
if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) {
|
if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) {
|
||||||
SDL_SetError("Negative swap interval unsupported in this GL");
|
SDL_SetError("Negative swap interval unsupported in this GL");
|
||||||
} else if (_this->gl_data->wglSwapIntervalEXT) {
|
} else if (_this->gl_data->wglSwapIntervalEXT) {
|
||||||
_this->gl_data->wglSwapIntervalEXT(interval);
|
if (_this->gl_data->wglSwapIntervalEXT(interval) == TRUE) {
|
||||||
return 0;
|
retval = 0;
|
||||||
|
} else {
|
||||||
|
WIN_SetError("wglSwapIntervalEXT()");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
WIN_GL_GetSwapInterval(_THIS)
|
WIN_GL_GetSwapInterval(_THIS)
|
||||||
{
|
{
|
||||||
|
int retval = 0;
|
||||||
if (_this->gl_data->wglGetSwapIntervalEXT) {
|
if (_this->gl_data->wglGetSwapIntervalEXT) {
|
||||||
return _this->gl_data->wglGetSwapIntervalEXT();
|
retval = _this->gl_data->wglGetSwapIntervalEXT();
|
||||||
} else {
|
|
||||||
/*SDL_Unsupported();*/
|
|
||||||
return 0; /* just say we're unsync'd. */
|
|
||||||
}
|
}
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue