Fix gl_swapinterval

This commit is contained in:
Yamagi Burmeister 2012-10-06 09:03:47 +02:00
parent 74f19d5962
commit 687ca61dfa
4 changed files with 7 additions and 17 deletions

View file

@ -229,10 +229,15 @@ GLimp_InitGraphics(qboolean fullscreen)
/* Set the icon */ /* Set the icon */
SetSDLIcon(); SetSDLIcon();
/* Enable vsync */
if (gl_swapinterval->value)
{
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
}
while (1) while (1)
{ {
if ((surface = if ((surface = SDL_SetVideoMode(vid.width, vid.height, 0, flags)) == NULL)
SDL_SetVideoMode(vid.width, vid.height, 0, flags)) == NULL)
{ {
if (counter == 1) if (counter == 1)
{ {

View file

@ -148,7 +148,6 @@ void GL_BeginRendering(int *x, int *y, int *width, int *height);
void GL_EndRendering(void); void GL_EndRendering(void);
void R_SetDefaultState(void); void R_SetDefaultState(void);
void R_UpdateSwapInterval(void);
extern float gldepthmin, gldepthmax; extern float gldepthmin, gldepthmax;

View file

@ -1464,9 +1464,6 @@ R_BeginFrame(float camera_separation)
gl_texturesolidmode->modified = false; gl_texturesolidmode->modified = false;
} }
/* swapinterval stuff */
R_UpdateSwapInterval();
/* clear screen if desired */ /* clear screen if desired */
R_Clear(); R_Clear();
} }

View file

@ -219,16 +219,5 @@ R_SetDefaultState(void)
R_SetTexturePalette(d_8to24table); R_SetTexturePalette(d_8to24table);
} }
R_UpdateSwapInterval();
}
void
R_UpdateSwapInterval(void)
{
if (gl_swapinterval->modified)
{
gl_swapinterval->modified = false;
}
} }