mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-08 12:38:03 +02:00
First 3 opengl-wrapper functions. The other will follow in a similar way
This commit is contained in:
parent
6e00f7cc02
commit
b42154ca25
2 changed files with 102 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue