+rtexture_t *loadingscreentexture = NULL;
+static float loadingscreentexture_vertex3f[12];
+static float loadingscreentexture_texcoord2f[8];
+
+static void SCR_ClearLoadingScreenTexture()
+{
+ if(loadingscreentexture)
+ R_FreeTexture(loadingscreentexture);
+ loadingscreentexture = NULL;
+}
+
+extern rtexturepool_t *r_main_texturepool;
+static void SCR_SetLoadingScreenTexture()
+{
+ int w, h;
+ float loadingscreentexture_w;
+ float loadingscreentexture_h;
+
+ SCR_ClearLoadingScreenTexture();
+
+ if (gl_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;
+ }
+
+ 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_vertex3f[2] = loadingscreentexture_vertex3f[5] = loadingscreentexture_vertex3f[8] = loadingscreentexture_vertex3f[11] = 0;
+ loadingscreentexture_vertex3f[0] = loadingscreentexture_vertex3f[9] = 0;
+ loadingscreentexture_vertex3f[1] = loadingscreentexture_vertex3f[4] = 0;
+ loadingscreentexture_vertex3f[3] = loadingscreentexture_vertex3f[6] = vid_conwidth.integer;
+ loadingscreentexture_vertex3f[7] = loadingscreentexture_vertex3f[10] = vid_conheight.integer;
+ loadingscreentexture_texcoord2f[0] = 0;loadingscreentexture_texcoord2f[1] = loadingscreentexture_h;
+ loadingscreentexture_texcoord2f[2] = loadingscreentexture_w;loadingscreentexture_texcoord2f[3] = loadingscreentexture_h;
+ loadingscreentexture_texcoord2f[4] = loadingscreentexture_w;loadingscreentexture_texcoord2f[5] = 0;
+ loadingscreentexture_texcoord2f[6] = 0;loadingscreentexture_texcoord2f[7] = 0;
+}