]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
the beginnings of a cgGL rendering path experiment, does not work yet
[xonotic/darkplaces.git] / cl_screen.c
index 50ff6448a72b5e08007adba8a54b45075e28ff5a..3363a7eb866a458c6fe7971ad23ffd1b3dcf183f 100644 (file)
@@ -61,7 +61,6 @@ cvar_t shownetgraph = {CVAR_SAVE, "shownetgraph", "0", "shows a graph of packet
 cvar_t cl_demo_mousegrab = {0, "cl_demo_mousegrab", "0", "Allows reading the mouse input while playing demos. Useful for camera mods developed in csqc. (0: never, 1: always)"};
 cvar_t timedemo_screenshotframelist = {0, "timedemo_screenshotframelist", "", "when performing a timedemo, take screenshots of each frame in this space-separated list - example: 1 201 401"};
 
-extern cvar_t r_glsl;
 extern cvar_t v_glslgamma;
 extern cvar_t sbar_info_pos;
 #define WANT_SCREENSHOT_HWGAMMA (scr_screenshot_hwgamma.integer && vid_usinghwgamma)
@@ -1719,7 +1718,7 @@ static void SCR_SetLoadingScreenTexture(void)
 
        SCR_ClearLoadingScreenTexture();
 
-       if (gl_support_arb_texture_non_power_of_two)
+       if (vid.support.arb_texture_non_power_of_two)
        {
                w = vid.width; h = vid.height;
                loadingscreentexture_w = loadingscreentexture_h = 1;
@@ -1731,11 +1730,8 @@ static void SCR_SetLoadingScreenTexture(void)
                loadingscreentexture_h = vid.height / (float) h;
        }
 
-       loadingscreentexture = R_LoadTexture2D(r_main_texturepool, "loadingscreentexture", w, h, NULL, TEXTYPE_BGRA, TEXF_FORCENEAREST | TEXF_CLAMP | TEXF_ALWAYSPRECACHE, NULL);
-       R_Mesh_TexBind(0, R_GetTexture(loadingscreentexture));
-       GL_ActiveTexture(0);
-       CHECKGLERROR
-       qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, vid.width, vid.height);CHECKGLERROR
+       loadingscreentexture = R_LoadTexture2D(r_main_texturepool, "loadingscreentexture", w, h, NULL, TEXTYPE_BGRA, TEXF_FORCENEAREST | TEXF_CLAMP, NULL);
+       R_Mesh_CopyToTexture(R_GetTexture(loadingscreentexture), 0, 0, 0, 0, vid.width, vid.height);
 
        loadingscreentexture_vertex3f[2] = loadingscreentexture_vertex3f[5] = loadingscreentexture_vertex3f[8] = loadingscreentexture_vertex3f[11] = 0;
        loadingscreentexture_vertex3f[0] = loadingscreentexture_vertex3f[9] = 0;
@@ -1859,7 +1855,7 @@ static void SCR_DrawLoadingStack(void)
                R_Mesh_VertexPointer(verts, 0, 0);
                R_Mesh_ColorPointer(colors, 0, 0);
                R_Mesh_ResetTextureState();
-               R_SetupGenericShader(false);
+               R_SetupShader_Generic(NULL, NULL, GL_MODULATE, 1);
                verts[2] = verts[5] = verts[8] = verts[11] = 0;
                verts[0] = verts[9] = 0;
                verts[1] = verts[4] = vid_conheight.integer - 8;
@@ -1902,7 +1898,7 @@ static void SCR_DrawLoadingScreen_SharedSetup (qboolean clear)
                qglClear(GL_COLOR_BUFFER_BIT);CHECKGLERROR
        R_Textures_Frame();
        R_Mesh_Start();
-       R_Mesh_Matrix(&identitymatrix);
+       R_EntityMatrix(&identitymatrix);
        // draw the loading plaque
        loadingscreenpic = Draw_CachePic ("gfx/loading");
        x = (vid_conwidth.integer - loadingscreenpic->width)/2;
@@ -1926,19 +1922,18 @@ static void SCR_DrawLoadingScreen (qboolean clear)
        GL_DepthRange(0, 1);
        GL_PolygonOffset(0, 0);
        GL_DepthTest(false);
-       R_SetupGenericShader(true);
        R_Mesh_ColorPointer(NULL, 0, 0);
        if(loadingscreentexture)
        {
                R_Mesh_VertexPointer(loadingscreentexture_vertex3f, 0, 0);
                R_Mesh_ResetTextureState();
-               R_Mesh_TexBind(0, R_GetTexture(loadingscreentexture));
+               R_SetupShader_Generic(loadingscreentexture, NULL, GL_MODULATE, 1);
                R_Mesh_TexCoordPointer(0, 2, loadingscreentexture_texcoord2f, 0, 0);
                R_Mesh_Draw(0, 4, 0, 2, polygonelement3i, polygonelement3s, 0, 0);
        }
        R_Mesh_VertexPointer(loadingscreenpic_vertex3f, 0, 0);
        R_Mesh_ResetTextureState();
-       R_Mesh_TexBind(0, R_GetTexture(loadingscreenpic->tex));
+       R_SetupShader_Generic(loadingscreenpic->tex, NULL, GL_MODULATE, 1);
        R_Mesh_TexCoordPointer(0, 2, loadingscreenpic_texcoord2f, 0, 0);
        R_Mesh_Draw(0, 4, 0, 2, polygonelement3i, polygonelement3s, 0, 0);
        SCR_DrawLoadingStack();
@@ -2072,16 +2067,6 @@ void CL_UpdateScreen(void)
        if (scr_fov.value > 170)
                Cvar_Set ("fov","170");
 
-       // validate r_textureunits cvar
-       if (r_textureunits.integer > gl_textureunits)
-               Cvar_SetValueQuick(&r_textureunits, gl_textureunits);
-       if (r_textureunits.integer < 1)
-               Cvar_SetValueQuick(&r_textureunits, 1);
-
-       // validate gl_combine cvar
-       if (gl_combine.integer && !gl_combine_extension)
-               Cvar_SetValueQuick(&gl_combine, 0);
-
        // intermission is always full screen
        if (cl.intermission)
                sb_lines = 0;