From cefc6df98ccaed558eea358974c5dda5752c3dda Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 10 Jul 2004 02:32:30 +0000 Subject: [PATCH] grievre's patch to trade (minor) frame rate for frame (non-)latency --- include/r_cvar.h | 1 + libs/video/renderer/gl/gl_screen.c | 5 +++++ libs/video/targets/vid_common_gl.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/include/r_cvar.h b/include/r_cvar.h index ee0a5b008..fd77424c5 100644 --- a/include/r_cvar.h +++ b/include/r_cvar.h @@ -21,6 +21,7 @@ extern struct cvar_s *gl_dlight_polyblend; extern struct cvar_s *gl_dlight_smooth; extern struct cvar_s *gl_fb_bmodels; extern struct cvar_s *gl_fb_models; +extern struct cvar_s *gl_finish; extern struct cvar_s *gl_keeptjunctions; extern struct cvar_s *gl_lerp_anim; extern struct cvar_s *gl_driver; diff --git a/libs/video/renderer/gl/gl_screen.c b/libs/video/renderer/gl/gl_screen.c index 0d7d9f46e..2ce64bff6 100644 --- a/libs/video/renderer/gl/gl_screen.c +++ b/libs/video/renderer/gl/gl_screen.c @@ -271,4 +271,9 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs) GL_FlushText (); qfglFlush (); + + if (gl_finish->int_val) { + GL_EndRendering (); + begun = 0; + } } diff --git a/libs/video/targets/vid_common_gl.c b/libs/video/targets/vid_common_gl.c index 6be0abdec..2743356c9 100644 --- a/libs/video/targets/vid_common_gl.c +++ b/libs/video/targets/vid_common_gl.c @@ -114,6 +114,7 @@ int gl_max_lights; cvar_t *gl_doublebright; cvar_t *gl_fb_bmodels; +cvar_t *gl_finish; cvar_t *gl_max_size; cvar_t *gl_multitexture; cvar_t *gl_tessellate; @@ -258,6 +259,8 @@ GL_Common_Init_Cvars (void) gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, gl_fb_bmodels_f, "Toggles fullbright color " "support for bmodels"); + gl_finish = Cvar_Get ("gl_finish", "1", CVAR_ARCHIVE, NULL, + "wait for rendering to finish"); gl_max_size = Cvar_Get ("gl_max_size", "0", CVAR_NONE, gl_max_size_f, "Texture dimension"); gl_multitexture = Cvar_Get ("gl_multitexture", "0", CVAR_ARCHIVE,