diff --git a/GL/windows/glwrap.c b/GL/windows/glwrap.c index 388445ab5..c1698d6cf 100755 --- a/GL/windows/glwrap.c +++ b/GL/windows/glwrap.c @@ -1,5 +1,13 @@ -#include +#include +#include +#include + +#define WINDOWS_LEAN_AND_CLEAN +//typedef int BOOL; +//typedef unsigned short ATOM; +//typedef unsigned char BYTE; +#include /* * GLX implementation that uses Win32's OpenGL */ @@ -49,3 +57,45 @@ GLuint __glFloorLog2(GLuint val) } return c; } + + +/* + * Wrapper functions + */ + +#define RESOLVE(procname, symbol) \ + static Bool init = TRUE; \ + static procname proc = NULL; \ + if (init) { \ + proc = (procname)wglGetProcAddress(symbol); \ + init = FALSE; \ + } \ + if (proc == NULL) { \ + __glXErrorCallBack(NULL, 0); \ + return; \ + } + + + + +GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ) +{ + RESOLVE(PFNGLGETCOLORTABLEPROC, "glGetColorTableEXT"); + proc(target, format, type, table); +} + +GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, + GLfloat *params ) +{ + RESOLVE(PFNGLGETCOLORTABLEPARAMETERFVPROC, "glGetColorTableParameterfvEXT"); + proc(target, pname, params); +} + +GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, + GLint *params ) +{ + RESOLVE(PFNGLGETCOLORTABLEPARAMETERIVPROC, "glGetColorTableParameterivEXT"); + proc(target, pname, params); +} + diff --git a/GL/windows/indirect.c b/GL/windows/indirect.c index 388445ab5..c1698d6cf 100755 --- a/GL/windows/indirect.c +++ b/GL/windows/indirect.c @@ -1,5 +1,13 @@ -#include +#include +#include +#include + +#define WINDOWS_LEAN_AND_CLEAN +//typedef int BOOL; +//typedef unsigned short ATOM; +//typedef unsigned char BYTE; +#include /* * GLX implementation that uses Win32's OpenGL */ @@ -49,3 +57,45 @@ GLuint __glFloorLog2(GLuint val) } return c; } + + +/* + * Wrapper functions + */ + +#define RESOLVE(procname, symbol) \ + static Bool init = TRUE; \ + static procname proc = NULL; \ + if (init) { \ + proc = (procname)wglGetProcAddress(symbol); \ + init = FALSE; \ + } \ + if (proc == NULL) { \ + __glXErrorCallBack(NULL, 0); \ + return; \ + } + + + + +GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ) +{ + RESOLVE(PFNGLGETCOLORTABLEPROC, "glGetColorTableEXT"); + proc(target, format, type, table); +} + +GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, + GLfloat *params ) +{ + RESOLVE(PFNGLGETCOLORTABLEPARAMETERFVPROC, "glGetColorTableParameterfvEXT"); + proc(target, pname, params); +} + +GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, + GLint *params ) +{ + RESOLVE(PFNGLGETCOLORTABLEPARAMETERIVPROC, "glGetColorTableParameterivEXT"); + proc(target, pname, params); +} +