]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
Split out TaskQueue into its own taskqueue.[ch] module, it doesn't depend on SDL2...
[xonotic/darkplaces.git] / vid_shared.c
index 9f4df42ecbde5b9fb922ce8d82a90a0e86f5a50e..37325bb4bb37da22eb4e18b504711a9a1d8e5f9f 100644 (file)
@@ -1,8 +1,6 @@
 
 #include "quakedef.h"
-#ifdef CONFIG_CD
 #include "cdaudio.h"
-#endif
 #include "image.h"
 
 #ifdef WIN32
@@ -72,9 +70,9 @@ qboolean in_client_mouse = true;
 float in_mouse_x, in_mouse_y;
 float in_windowmouse_x, in_windowmouse_y;
 
-// LordHavoc: if window is hidden, don't update screen
+// LadyHavoc: if window is hidden, don't update screen
 qboolean vid_hidden = true;
-// LordHavoc: if window is not the active window, don't hog as much CPU time,
+// LadyHavoc: if window is not the active window, don't hog as much CPU time,
 // let go of the mouse, turn off sound, and restore system gamma ramps...
 qboolean vid_activewindow = true;
 
@@ -329,7 +327,6 @@ void (GLAPIENTRY *qglPointSize)(GLfloat size);
 void (GLAPIENTRY *qglPolygonMode)(GLenum face, GLenum mode);
 void (GLAPIENTRY *qglPolygonOffset)(GLfloat factor, GLfloat units);
 void (GLAPIENTRY *qglReadBuffer)(GLenum mode);
-void (GLAPIENTRY *qglGetPointerv)(GLenum pname, GLvoid** params);
 void (GLAPIENTRY *qglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
 void (GLAPIENTRY *qglSampleCoverage)(GLclampf value, GLboolean invert);
 void (GLAPIENTRY *qglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
@@ -754,15 +751,7 @@ void GL_Setup(void)
 #endif
 
        vid.support.amd_texture_texture4 = GL_CheckExtension("GL_AMD_texture_texture4", "-notexture4", false);
-       vid.support.arb_draw_buffers = true;
-       vid.support.arb_occlusion_query = true;
-       vid.support.arb_query_buffer_object = true;
-       vid.support.arb_texture_compression = true;
        vid.support.arb_texture_gather = GL_CheckExtension("GL_ARB_texture_gather", "-notexturegather", false);
-       vid.support.ext_blend_minmax = true;
-       vid.support.ext_blend_subtract = true;
-       vid.support.ext_blend_func_separate = true;
-       vid.support.ext_packed_depth_stencil = true;
        vid.support.ext_texture_compression_s3tc = GL_CheckExtension("GL_EXT_texture_compression_s3tc", "-nos3tc", false);
        vid.support.ext_texture_filter_anisotropic = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", "-noanisotropy", false);
 #ifndef USE_GLES2
@@ -777,13 +766,33 @@ void GL_Setup(void)
 // COMMANDLINEOPTION: GL: -notexturegather disables GL_ARB_texture_gather (which provides fetch4 sampling)
 // COMMANDLINEOPTION: GL: -nogldebugoutput disables GL_ARB_debug_output (which provides the gl_debug feature, if enabled)
 
-       if (vid.support.arb_draw_buffers)
-               qglGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint*)&vid.maxdrawbuffers);
-
+#ifdef GL_MAX_DRAW_BUFFERS
+       qglGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint*)&vid.maxdrawbuffers);
+       CHECKGLERROR
+#endif
        qglGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_2d);
-       qglGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, (GLint*)&vid.max_anisotropy);
-       qglGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_cubemap);
-       qglGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_3d);
+       CHECKGLERROR
+#ifdef GL_MAX_CUBE_MAP_TEXTURE_SIZE
+#ifdef USE_GLES2
+       if (GL_CheckExtension("GL_ARB_texture_cube_map", "-nocubemap", false))
+#endif
+       {
+               qglGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_cubemap);
+               Con_DPrintf("GL_MAX_CUBE_MAP_TEXTURE_SIZE = %i\n", vid.maxtexturesize_cubemap);
+       }
+       CHECKGLERROR
+#endif
+#ifdef GL_MAX_3D_TEXTURE_SIZE
+#ifdef USE_GLES2
+       if (GL_CheckExtension("GL_EXT_texture3D", "-notexture3d", false)
+        || GL_CheckExtension("GL_OES_texture3D", "-notexture3d", false))
+#endif
+       {
+               qglGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_3d);
+               Con_DPrintf("GL_MAX_3D_TEXTURE_SIZE = %i\n", vid.maxtexturesize_3d);
+       }
+#endif
+       CHECKGLERROR
 
 #ifdef USE_GLES2
        Con_DPrint("Using GLES2 rendering path\n");
@@ -1101,7 +1110,7 @@ void VID_BuildGammaTables(unsigned short *ramps, int rampsize)
                        ramps[i] = (int)floor(bound(0.0f, Image_sRGBFloatFromLinearFloat(ramps[i] / 65535.0f), 1.0f) * 65535.0f + 0.5f);
        }
 
-       // LordHavoc: this code came from Ben Winslow and Zinx Verituse, I have
+       // LadyHavoc: this code came from Ben Winslow and Zinx Verituse, I have
        // immensely butchered it to work with variable framerates and fit in with
        // the rest of darkplaces.
        //