diff --git a/src/cairo-wgl-context.c b/src/cairo-wgl-context.c index 4872374..5a1bad6 100644 --- a/src/cairo-wgl-context.c +++ b/src/cairo-wgl-context.c @@ -259,3 +259,22 @@ cairo_gl_surface_create_for_dc (cairo_device_t *device, return &surface->base.base; } + +static PFNGLACTIVETEXTUREARBPROC _glActiveTextureARB = NULL; +static PFNGLBLENDFUNCSEPARATEPROC _glBlendFuncSeparate = NULL; + +void InitWGLStuff() +{ + _glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress((LPCSTR)"glActiveTextureARB"); + _glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)wglGetProcAddress((LPCSTR)"glBlendFuncSeparate"); +} + +GLAPI void APIENTRY glActiveTexture(GLenum texture) +{ + (*_glActiveTextureARB)(texture); +} + +GLAPI void APIENTRY glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) +{ + (*_glBlendFuncSeparate)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); +} diff --git a/src/win32/cairo-win32-system.c b/src/win32/cairo-win32-system.c index 8785530..a2c01d0 100644 --- a/src/win32/cairo-win32-system.c +++ b/src/win32/cairo-win32-system.c @@ -61,6 +61,8 @@ #include +void InitWGLStuff(); + /* declare to avoid "no previous prototype for 'DllMain'" warning */ BOOL WINAPI DllMain (HINSTANCE hinstDLL, @@ -75,6 +77,7 @@ DllMain (HINSTANCE hinstDLL, switch (fdwReason) { case DLL_PROCESS_ATTACH: CAIRO_MUTEX_INITIALIZE (); + InitWGLStuff(); break; case DLL_PROCESS_DETACH: