diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 758e064a05..d4a2ded63b 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -347,7 +347,7 @@ reset() { _glBlendEquation = NULL; if (has_extension("GL_EXT_blend_minmax") || is_at_least_version(1, 2)) { - _glBlendEquation = (PFNGLBLENDEQUATIONEXTPROC) + _glBlendEquation = (PFNGLBLENDEQUATIONPROC) get_extension_func(GLPREFIX_QUOTED, "BlendEquationEXT"); if (_glBlendEquation == NULL) { GLCAT.warning() @@ -360,7 +360,7 @@ reset() { _glBlendColor = NULL; if (has_extension("GL_EXT_blend_color") || is_at_least_version(1, 2)) { - _glBlendColor = (PFNGLBLENDCOLOREXTPROC) + _glBlendColor = (PFNGLBLENDCOLORPROC) get_extension_func(GLPREFIX_QUOTED, "BlendColorEXT"); if (_glBlendColor == NULL) { GLCAT.warning() @@ -3993,6 +3993,7 @@ get_fog_mode_type(Fog::Mode m) { GLenum CLP(GraphicsStateGuardian):: get_blend_equation_type(ColorBlendAttrib::Mode mode) { switch (mode) { + case ColorBlendAttrib::M_none: case ColorBlendAttrib::M_add: return GL_FUNC_ADD; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index e0ea396bd3..98f51dbfe7 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -39,6 +39,16 @@ class PlaneNode; class Light; +// These typedefs are declared in glext.h, but we must repeat them +// here, mainly because they will not be included from glext.h if the +// system GL version matches or exceeds the GL version in which these +// functions are defined, and the system gl.h sometimes doesn't +// declare these typedefs. +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + //////////////////////////////////////////////////////////////////// // Class : GLGraphicsStateGuardian // Description : A GraphicsStateGuardian specialized for rendering @@ -279,8 +289,8 @@ public: PFNGLACTIVETEXTUREPROC _glActiveTexture; PFNGLMULTITEXCOORD2FVPROC _glMultiTexCoord2fv; - PFNGLBLENDEQUATIONEXTPROC _glBlendEquation; - PFNGLBLENDCOLOREXTPROC _glBlendColor; + PFNGLBLENDEQUATIONPROC _glBlendEquation; + PFNGLBLENDCOLORPROC _glBlendColor; GLenum _edge_clamp; GLenum _border_clamp; diff --git a/panda/src/glxdisplay/glxGraphicsStateGuardian.h b/panda/src/glxdisplay/glxGraphicsStateGuardian.h index 1d640a1e4f..78fb11d208 100644 --- a/panda/src/glxdisplay/glxGraphicsStateGuardian.h +++ b/panda/src/glxdisplay/glxGraphicsStateGuardian.h @@ -30,6 +30,13 @@ // includes gl.h). #include "glxext.h" +// These typedefs are declared in glxext.h, but we must repeat them +// here, mainly because they will not be included from glxext.h if the +// system GLX version matches or exceeds the GLX version in which +// these functions are defined, and the system glx.h sometimes doesn't +// declare these typedefs. +typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); + //////////////////////////////////////////////////////////////////// // Class : glxGraphicsStateGuardian // Description : A tiny specialization on GLGraphicsStateGuardian to