about summary refs log tree commit diff
path: root/src/engine/client/gfx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/client/gfx.cpp')
-rw-r--r--src/engine/client/gfx.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/client/gfx.cpp b/src/engine/client/gfx.cpp
index db020cef..1e5aa19e 100644
--- a/src/engine/client/gfx.cpp
+++ b/src/engine/client/gfx.cpp
@@ -111,6 +111,8 @@ bool gfx_init()
 		dbg_msg("game", "failed to create gl context");
 		return false;
 	}
+
+	
 	// Init vertices
 	if (g_pVertices)
 		mem_free(g_pVertices);
@@ -160,6 +162,9 @@ bool gfx_init()
 	// create null texture, will get id=0
 	gfx_load_texture_raw(4,4,IMG_RGBA,null_texture_data);
 
+	// set vsync as needed
+	gfx_set_vsync(config.vsync);
+
 	return true;
 }
 
@@ -168,6 +173,11 @@ int gfx_get_video_modes(video_mode *list, int maxcount)
 	return context.getvideomodes((opengl::videomode *)list, maxcount);
 }
 
+void gfx_set_vsync(int val)
+{
+	context.set_vsync(val);
+}
+
 int gfx_unload_texture(int index)
 {
 	textures[index].tex.clear();