fixed vsync option

This commit is contained in:
Magnus Auvinen 2009-01-21 20:55:07 +00:00
parent d3928f559f
commit 0c9dfd81fd
2 changed files with 5 additions and 8 deletions

View file

@ -194,6 +194,7 @@ static int try_init()
}
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, config.gfx_vsync);
/* set caption */
SDL_WM_SetCaption("Teeworlds", "Teeworlds");
@ -258,7 +259,7 @@ int gfx_init()
}
atexit(SDL_Quit);
if(!no_gfx)
{
#ifdef CONF_FAMILY_WINDOWS
@ -326,8 +327,6 @@ int gfx_init()
/*if(config.dbg_stress)
gfx_minimize();*/
/* set vsync as needed */
gfx_set_vsync(config.gfx_vsync);
return 0;
}
@ -416,11 +415,6 @@ int gfx_get_video_modes(VIDEO_MODE *list, int maxcount)
return num_modes;
}
void gfx_set_vsync(int val)
{
/* TODO: SDL*/
}
int gfx_unload_texture(int index)
{
if(index == invalid_texture)

View file

@ -497,7 +497,10 @@ void MENUS::render_settings_graphics(RECT main_view)
ui_hsplit_t(&main_view, 20.0f, &button, &main_view);
if (ui_do_button(&config.gfx_vsync, "V-Sync", config.gfx_vsync, &button, ui_draw_checkbox, 0))
{
config.gfx_vsync ^= 1;
need_restart = true;
}
ui_hsplit_t(&main_view, 20.0f, &button, &main_view);
if (ui_do_button(&config.gfx_fsaa_samples, "FSAA samples", config.gfx_fsaa_samples, &button, ui_draw_checkbox_number, 0))