diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-01-21 20:55:07 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-01-21 20:55:07 +0000 |
| commit | 0c9dfd81fdd5752bad476bfd3332d6213fbb15da (patch) | |
| tree | c52155469e8ddcdc3b1c423e42d262dcb48a4f75 /src | |
| parent | d3928f559fbad11ad43114f5b1fc54aeeeeb5b3f (diff) | |
| download | zcatch-0c9dfd81fdd5752bad476bfd3332d6213fbb15da.tar.gz zcatch-0c9dfd81fdd5752bad476bfd3332d6213fbb15da.zip | |
fixed vsync option
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/client/ec_gfx.c | 10 | ||||
| -rw-r--r-- | src/game/client/components/menus_settings.cpp | 3 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c index 5a61f7c7..64840b2b 100644 --- a/src/engine/client/ec_gfx.c +++ b/src/engine/client/ec_gfx.c @@ -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) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 15d9e507..b240c607 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -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)) |