]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
Add GL_ExtensionSupported in vid_null.c because vid_shared.c relies on
[xonotic/darkplaces.git] / cl_screen.c
index b3b8c4b860bf987df09fbe93d592ee7da9cacf12..d6ba9bb831692527c6056b5cc3c00c9235bc317f 100644 (file)
@@ -2153,6 +2153,9 @@ static void SCR_DrawScreen (void)
                }
        }
 
+       // Don't apply debugging stuff like r_showsurfaces to the UI
+       r_refdef.view.showdebug = false;
+
        if (!r_stereo_sidebyside.integer && !r_stereo_horizontal.integer && !r_stereo_vertical.integer)
        {
                r_refdef.view.width = vid.width;
@@ -2273,17 +2276,8 @@ static void SCR_SetLoadingScreenTexture(void)
 
        SCR_ClearLoadingScreenTexture();
 
-       if (vid.support.arb_texture_non_power_of_two)
-       {
-               w = vid.width; h = vid.height;
-               loadingscreentexture_w = loadingscreentexture_h = 1;
-       }
-       else
-       {
-               w = CeilPowerOf2(vid.width); h = CeilPowerOf2(vid.height);
-               loadingscreentexture_w = vid.width / (float) w;
-               loadingscreentexture_h = vid.height / (float) h;
-       }
+       w = vid.width; h = vid.height;
+       loadingscreentexture_w = loadingscreentexture_h = 1;
 
        loadingscreentexture = R_LoadTexture2D(r_main_texturepool, "loadingscreentexture", w, h, NULL, TEXTYPE_COLORBUFFER, TEXF_RENDERTARGET | TEXF_FORCENEAREST | TEXF_CLAMP, -1, NULL);
        R_Mesh_CopyToTexture(loadingscreentexture, 0, 0, 0, 0, vid.width, vid.height);
@@ -2599,10 +2593,9 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
        SCR_DrawLoadingScreen_SharedSetup(clear);
        SCR_DrawLoadingScreen(clear);
 #else
-       if (qglDrawBuffer)
-               qglDrawBuffer(GL_BACK);
+       qglDrawBuffer(GL_BACK);
        SCR_DrawLoadingScreen_SharedSetup(clear);
-       if (vid.stereobuffer && qglDrawBuffer)
+       if (vid.stereobuffer)
        {
                qglDrawBuffer(GL_BACK_LEFT);
                SCR_DrawLoadingScreen(clear);
@@ -2611,8 +2604,7 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
        }
        else
        {
-               if (qglDrawBuffer)
-                       qglDrawBuffer(GL_BACK);
+               qglDrawBuffer(GL_BACK);
                SCR_DrawLoadingScreen(clear);
        }
 #endif
@@ -2797,20 +2789,8 @@ void CL_UpdateScreen(void)
        SCR_SetUpToDrawConsole();
 
 #ifndef USE_GLES2
-       if (qglDrawBuffer)
-       {
-               CHECKGLERROR
-               qglDrawBuffer(GL_BACK);CHECKGLERROR
-               // set dithering mode
-               if (gl_dither.integer)
-               {
-                       qglEnable(GL_DITHER);CHECKGLERROR
-               }
-               else
-               {
-                       qglDisable(GL_DITHER);CHECKGLERROR
-               }
-       }
+       CHECKGLERROR
+       qglDrawBuffer(GL_BACK);CHECKGLERROR
 #endif
 
        R_Viewport_InitOrtho(&viewport, &identitymatrix, 0, 0, vid.width, vid.height, 0, 0, vid_conwidth.integer, vid_conheight.integer, -10, 100, NULL);
@@ -2827,34 +2807,11 @@ void CL_UpdateScreen(void)
        // calculate r_refdef.view.quality
        r_refdef.view.quality = cl_updatescreen_quality;
 
-#ifndef USE_GLES2
-       if (qglPolygonStipple)
+       if(scr_stipple.integer)
        {
-               if(scr_stipple.integer)
-               {
-                       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
-               }
+               Con_Print("FIXME: scr_stipple not implemented\n");
+               Cvar_SetValueQuick(&scr_stipple, 0);
        }
-#endif
 
 #ifndef USE_GLES2
        if (R_Stereo_Active())
@@ -2900,8 +2857,7 @@ void CL_UpdateScreen(void)
        SCR_CaptureVideo();
 #endif
 
-       if (qglFlush)
-               qglFlush(); // FIXME: should we really be using qglFlush here?
+       qglFlush(); // ensure that the commands are submitted to the GPU before we do other things
 
        if (!vid_activewindow)
                VID_SetMouse(false, false, false);