First 3 opengl-wrapper functions. The other will follow in a similar way

This commit is contained in:
Alexander Gottwald 2004-03-10 14:47:46 +00:00
parent 6e00f7cc02
commit b42154ca25
2 changed files with 102 additions and 2 deletions

View file

@ -1,5 +1,13 @@
#include <GL/gl.h>
#include <GL/gl.h>
#include <glxserver.h>
#include <glxext.h>
#define WINDOWS_LEAN_AND_CLEAN
//typedef int BOOL;
//typedef unsigned short ATOM;
//typedef unsigned char BYTE;
#include <windows.h>
/*
* 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);
}

View file

@ -1,5 +1,13 @@
#include <GL/gl.h>
#include <GL/gl.h>
#include <glxserver.h>
#include <glxext.h>
#define WINDOWS_LEAN_AND_CLEAN
//typedef int BOOL;
//typedef unsigned short ATOM;
//typedef unsigned char BYTE;
#include <windows.h>
/*
* 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);
}