Load glBlendEquation and glBlendColor using cogl_get_proc_address

These are defined since OpenGL 1.2 and since Windows doesn't export
any functions defined after 1.1 we need to load them dynamically.
This commit is contained in:
Neil Roberts 2009-06-04 11:50:06 +01:00
parent db4fb91fe3
commit 00ac53042e
4 changed files with 22 additions and 0 deletions

View File

@ -52,6 +52,8 @@
#define glActiveTexture ctx->pf_glActiveTexture
#define glClientActiveTexture ctx->pf_glClientActiveTexture
#define glBlendFuncSeparate ctx->pf_glBlendFuncSeparate
#define glBlendEquation ctx->pf_glBlendEquation
#define glBlendColor ctx->pf_glBlendColor
#define glBlendEquationSeparate ctx->pf_glBlendEquationSeparate
#endif

View File

@ -170,6 +170,8 @@ typedef struct
COGL_PFNGLACTIVETEXTUREPROC pf_glActiveTexture;
COGL_PFNGLCLIENTACTIVETEXTUREPROC pf_glClientActiveTexture;
COGL_PFNGLBLENDEQUATIONPROC pf_glBlendEquation;
COGL_PFNGLBLENDCOLORPROC pf_glBlendColor;
COGL_PFNGLBLENDFUNCSEPARATEPROC pf_glBlendFuncSeparate;
COGL_PFNGLBLENDEQUATIONSEPARATEPROC pf_glBlendEquationSeparate;
} CoglContext;

View File

@ -1032,6 +1032,17 @@ typedef void
(GLenum modeRGB,
GLenum modeAlpha);
typedef void
(APIENTRYP COGL_PFNGLBLENDEQUATIONPROC)
(GLenum mode);
typedef void
(APIENTRYP COGL_PFNGLBLENDCOLORPROC)
(GLclampf red,
GLclampf green,
GLclampf blue,
GLclampf alpha);
G_END_DECLS
#endif

View File

@ -486,6 +486,13 @@ _cogl_features_init (void)
(COGL_PFNGLCLIENTACTIVETEXTUREPROC)
cogl_get_proc_address ("glClientActiveTexture");
ctx->pf_glBlendEquation =
(COGL_PFNGLBLENDEQUATIONPROC)
cogl_get_proc_address ("glBlendEquation");
ctx->pf_glBlendColor =
(COGL_PFNGLBLENDCOLORPROC)
cogl_get_proc_address ("glBlendColor");
/* Available in 1.4 */
ctx->pf_glBlendFuncSeparate =
(COGL_PFNGLBLENDFUNCSEPARATEPROC)