From: havoc Date: Sun, 29 Nov 2009 17:19:08 +0000 (+0000) Subject: added a few more CHECKGLERROR lines, and the possibility of not having X-Git-Tag: xonotic-v0.1.0preview~1116 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8606b20768b156b318b6d1a752ff7399cca69085;p=xonotic%2Fdarkplaces.git added a few more CHECKGLERROR lines, and the possibility of not having qglPolygonStipple git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9530 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index 80cf0036..021487cf 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -2091,28 +2091,34 @@ void CL_UpdateScreen(void) f = pow((float)cl_updatescreen_quality, cl_minfps_qualitypower.value) * cl_minfps_qualityscale.value; r_refdef.view.quality = bound(cl_minfps_qualitymin.value, f, cl_minfps_qualitymax.value); - if(scr_stipple.integer) + if (qglPolygonStipple) { - GLubyte stipple[128]; - int i, s, width, parts; - static int frame = 0; - ++frame; - - s = scr_stipple.integer; - parts = (s & 007); - width = (s & 070) >> 3; - - qglEnable(GL_POLYGON_STIPPLE); // 0x0B42 - for(i = 0; i < 128; ++i) + if(scr_stipple.integer) { - int line = i/4; - stipple[i] = (((line >> width) + frame) & ((1 << parts) - 1)) ? 0x00 : 0xFF; + GLubyte stipple[128]; + int i, s, width, parts; + static int frame = 0; + ++frame; + + s = scr_stipple.integer; + parts = (s & 007); + width = (s & 070) >> 3; + + qglEnable(GL_POLYGON_STIPPLE);CHECKGLERROR // 0x0B42 + for(i = 0; i < 128; ++i) + { + int line = i/4; + stipple[i] = (((line >> width) + frame) & ((1 << parts) - 1)) ? 0x00 : 0xFF; + } + qglPolygonStipple(stipple);CHECKGLERROR + } + else + { + qglDisable(GL_POLYGON_STIPPLE);CHECKGLERROR } - qglPolygonStipple(stipple); } - else - qglDisable(GL_POLYGON_STIPPLE); + CHECKGLERROR if (R_Stereo_Active()) { matrix4x4_t originalmatrix = r_refdef.view.matrix; @@ -2157,11 +2163,13 @@ void CL_UpdateScreen(void) } else SCR_DrawScreen(); + CHECKGLERROR SCR_CaptureVideo(); // quality adjustment according to render time - qglFlush(); + CHECKGLERROR + qglFlush(); // FIXME: should we really be using qglFlush here? cl_updatescreen_rendertime += ((Sys_DoubleTime() - rendertime1) - cl_updatescreen_rendertime) * bound(0, cl_minfps_fade.value, 1); if (cl_minfps.value > 0 && cl_updatescreen_rendertime > 0 && !cls.timedemo && (!cls.capturevideo.active || !cls.capturevideo.realtime)) cl_updatescreen_quality = 1 / (cl_updatescreen_rendertime * cl_minfps.value);