]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
implemented detection of GL_EXT_blend_subtract
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 11 Jan 2007 04:45:12 +0000 (04:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 11 Jan 2007 04:45:12 +0000 (04:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6682 d7cf8633-e32d-0410-b094-e92efae38249

glquake.h
vid_shared.c

index b27cd252d2d4c7f629fdfc4e8a262b119e4a85fd..32b76f2d5e14aef5bad694053ed06ec1ea975275 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -399,6 +399,23 @@ extern int gl_support_clamptoedge;
 extern void (GLAPIENTRY *qglActiveStencilFaceEXT)(GLenum);
 extern int gl_support_stenciltwoside;
 
+//GL_EXT_blend_minmax
+extern int gl_support_ext_blend_minmax;
+#ifndef GL_FUNC_ADD_EXT
+#define GL_FUNC_ADD_EXT                   0x8006 // also supplied by GL_EXT_blend_subtract
+#define GL_MIN_EXT                        0x8007
+#define GL_MAX_EXT                        0x8008
+#define GL_BLEND_EQUATION_EXT             0x8009 // also supplied by GL_EXT_blend_subtract
+extern void (GLAPIENTRY *qglBlendEquationEXT)(GLenum); // also supplied by GL_EXT_blend_subtract
+#endif
+
+//GL_EXT_blend_subtract
+extern int gl_support_ext_blend_subtract;
+#ifndef GL_FUNC_SUBTRACT_EXT
+#define GL_FUNC_SUBTRACT_EXT              0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B
+#endif
+
 //GL_ARB_texture_non_power_of_two
 extern int gl_support_arb_texture_non_power_of_two;
 
index 200f44587af8683eeb4c44d47e4bdafe888b9ffc..6599d711012b0e3ae12d01989e1fc5410474b068 100644 (file)
@@ -44,6 +44,10 @@ int gl_support_anisotropy = false;
 int gl_max_anisotropy = 1;
 // GL_EXT_stencil_two_side
 int gl_support_stenciltwoside = false;
+// GL_EXT_blend_minmax
+int gl_support_ext_blend_minmax = false;
+// GL_EXT_blend_subtract
+int gl_support_ext_blend_subtract = false;
 // GL_ARB_shader_objects
 int gl_support_shader_objects = false;
 // GL_ARB_shading_language_100
@@ -248,6 +252,8 @@ void (GLAPIENTRY *qglPolygonStipple)(const GLubyte *mask);
 void (GLAPIENTRY *qglLineWidth)(GLfloat width);
 void (GLAPIENTRY *qglPointSize)(GLfloat size);
 
+void (GLAPIENTRY *qglBlendEquationEXT)(GLenum);
+
 void (GLAPIENTRY *qglActiveStencilFaceEXT)(GLenum);
 
 void (GLAPIENTRY *qglDeleteObjectARB)(GLhandleARB obj);
@@ -519,6 +525,12 @@ static dllfunction_t stenciltwosidefuncs[] =
        {NULL, NULL}
 };
 
+static dllfunction_t blendequationfuncs[] =
+{
+       {"glBlendEquationEXT", (void **) &qglBlendEquationEXT},
+       {NULL, NULL}
+};
+
 static dllfunction_t shaderobjectsfuncs[] =
 {
        {"glDeleteObjectARB", (void **) &qglDeleteObjectARB},
@@ -635,6 +647,8 @@ void VID_CheckExtensions(void)
        gl_support_anisotropy = false;
        gl_max_anisotropy = 1;
        gl_support_stenciltwoside = false;
+       gl_support_ext_blend_minmax = false;
+       gl_support_ext_blend_subtract = false;
        gl_support_shader_objects = false;
        gl_support_shading_language_100 = false;
        gl_support_vertex_shader = false;
@@ -692,6 +706,9 @@ void VID_CheckExtensions(void)
        if ((gl_support_anisotropy = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", NULL, "-noanisotropy", false)))
                qglGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max_anisotropy);
 
+       gl_support_ext_blend_minmax = GL_CheckExtension("GL_EXT_blend_minmax", blendequationfuncs, "-noblendminmax", false);
+       gl_support_ext_blend_subtract = GL_CheckExtension("GL_EXT_blend_subtract", blendequationfuncs, "-noblendsubtract", false);
+
 // COMMANDLINEOPTION: GL: -nostenciltwoside disables GL_EXT_stencil_two_side (accelerates shadow rendering)
        gl_support_stenciltwoside = GL_CheckExtension("GL_EXT_stencil_two_side", stenciltwosidefuncs, "-nostenciltwoside", false);