diff --git a/GNUmakefile b/GNUmakefile index cd40abdd0..0b269f11c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -117,6 +117,23 @@ else endif +#### glad + +glad := glad + +glad_objs := \ + glad.c \ + +glad_root := $(source)/$(glad) +glad_src := $(glad_root)/src +glad_inc := $(glad_root)/include +glad_obj := $(obj)/$(glad) + +ifeq ($(RENDERTYPE),WIN) + glad_objs += glad_wgl.c +endif + + ##### Component Definitions #### EBacktrace @@ -140,6 +157,8 @@ engine_obj := $(obj)/$(engine) engine_cflags := -I$(engine_src) +engine_deps := + engine_objs := \ rev.cpp \ baselayer.cpp \ @@ -197,9 +216,10 @@ else endif endif ifeq (1,$(USE_OPENGL)) - engine_objs += glbuild.cpp voxmodel.cpp mdsprite.cpp + engine_objs += voxmodel.cpp mdsprite.cpp + engine_deps += glad ifeq (1,$(POLYMER)) - engine_objs += polymer.cpp + engine_objs += glbuild.cpp polymer.cpp endif endif ifneq (0,$(LUNATIC)) @@ -755,7 +775,7 @@ endif #### Final setup -COMPILERFLAGS += -I$(engine_inc) -I$(mact_inc) -I$(audiolib_inc) -I$(enet_inc) +COMPILERFLAGS += -I$(engine_inc) -I$(mact_inc) -I$(audiolib_inc) -I$(enet_inc) -I$(glad_inc) ##### Recipes @@ -772,6 +792,7 @@ libraries := \ enet \ libxmplite \ lpeg \ + glad \ components := \ $(games) \ diff --git a/source/build/Dependencies.mak b/source/build/Dependencies.mak index 7bca8d240..618eb7483 100644 --- a/source/build/Dependencies.mak +++ b/source/build/Dependencies.mak @@ -2,7 +2,7 @@ # $(ENGINE_OBJ)/a-c.$o: $(ENGINE_SRC)/a-c.cpp $(ENGINE_INC)/a.h $(ENGINE_OBJ)/a.$o: $(ENGINE_SRC)/a.$(asm) -$(ENGINE_OBJ)/animvpx.$o: $(ENGINE_SRC)/animvpx.cpp $(ENGINE_INC)/animvpx.h $(ENGINE_INC)/glbuild.h +$(ENGINE_OBJ)/animvpx.$o: $(ENGINE_SRC)/animvpx.cpp $(ENGINE_INC)/animvpx.h $(GLAD_INC)/glad/glad.h $(ENGINE_OBJ)/baselayer.$o: $(ENGINE_SRC)/baselayer.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/osd.h $(ENGINE_OBJ)/build.$o: $(ENGINE_SRC)/build.cpp $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/compat.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/editor.h $(ENGINE_OBJ)/cache1d.$o: $(ENGINE_SRC)/cache1d.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/kplib.h @@ -27,18 +27,18 @@ $(ENGINE_OBJ)/voxmodel.$o: $(ENGINE_SRC)/voxmodel.cpp $(ENGINE_SRC)/engine_priv. $(ENGINE_OBJ)/mdsprite.$o: $(ENGINE_SRC)/mdsprite.cpp $(ENGINE_SRC)/engine_priv.h $(ENGINE_INC)/polymost.h $(ENGINE_INC)/hightile.h $(ENGINE_INC)/mdsprite.h $(ENGINE_INC)/texcache.h $(ENGINE_OBJ)/textfont.$o: $(ENGINE_SRC)/textfont.cpp $(ENGINE_OBJ)/smalltextfont.$o: $(ENGINE_SRC)/smalltextfont.cpp -$(ENGINE_OBJ)/glbuild.$o: $(ENGINE_SRC)/glbuild.cpp $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/baselayer.h +$(ENGINE_OBJ)/glbuild.$o: $(ENGINE_SRC)/glbuild.cpp $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/baselayer.h $(GLAD_INC)/glad/glad.h $(ENGINE_OBJ)/kplib.$o: $(ENGINE_SRC)/kplib.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/kplib.h $(ENGINE_OBJ)/lz4.$o: $(ENGINE_SRC)/lz4.c $(ENGINE_INC)/lz4.h $(ENGINE_OBJ)/md4.$o: $(ENGINE_SRC)/md4.cpp $(ENGINE_INC)/md4.h $(ENGINE_OBJ)/osd.$o: $(ENGINE_SRC)/osd.cpp $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/compat.h $(ENGINE_INC)/baselayer.h $(ENGINE_OBJ)/pragmas.$o: $(ENGINE_SRC)/pragmas.cpp $(ENGINE_INC)/compat.h $(ENGINE_OBJ)/scriptfile.$o: $(ENGINE_SRC)/scriptfile.cpp $(ENGINE_INC)/scriptfile.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/compat.h -$(ENGINE_OBJ)/sdlayer.$o: $(ENGINE_SRC)/sdlayer.cpp $(ENGINE_SRC)/sdlayer12.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/sdlayer.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/a.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/glbuild.h -$(ENGINE_OBJ)/winlayer.$o: $(ENGINE_SRC)/winlayer.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/winlayer.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/a.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/dxdidf.h $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/rawinput.h $(ENGINE_INC)/winbits.h +$(ENGINE_OBJ)/sdlayer.$o: $(ENGINE_SRC)/sdlayer.cpp $(ENGINE_SRC)/sdlayer12.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/sdlayer.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/a.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/osd.h $(GLAD_INC)/glad/glad.h $(ENGINE_INC)/glbuild.h +$(ENGINE_OBJ)/winlayer.$o: $(ENGINE_SRC)/winlayer.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/winlayer.h $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/a.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/dxdidf.h $(GLAD_INC)/glad/glad.h $(GLAD_INC)/glad/glad_wgl.h $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/rawinput.h $(ENGINE_INC)/winbits.h $(ENGINE_OBJ)/gtkbits.$o: $(ENGINE_SRC)/gtkbits.cpp $(ENGINE_INC)/baselayer.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/dynamicgtk.h $(ENGINE_OBJ)/dynamicgtk.$o: $(ENGINE_SRC)/dynamicgtk.cpp $(ENGINE_INC)/dynamicgtk.h -$(ENGINE_OBJ)/polymer.$o: $(ENGINE_SRC)/polymer.cpp $(ENGINE_INC)/polymer.h $(ENGINE_INC)/compat.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/mdsprite.h $(ENGINE_INC)/polymost.h +$(ENGINE_OBJ)/polymer.$o: $(ENGINE_SRC)/polymer.cpp $(ENGINE_INC)/polymer.h $(ENGINE_INC)/compat.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(GLAD_INC)/glad/glad.h $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/osd.h $(ENGINE_INC)/pragmas.h $(ENGINE_INC)/mdsprite.h $(ENGINE_INC)/polymost.h $(ENGINE_OBJ)/mutex.$o: $(ENGINE_SRC)/mutex.cpp $(ENGINE_INC)/mutex.h $(ENGINE_OBJ)/rawinput.$o: $(ENGINE_SRC)/rawinput.cpp $(ENGINE_INC)/rawinput.h $(ENGINE_OBJ)/wiibits.$o: $(ENGINE_SRC)/wiibits.cpp $(ENGINE_INC)/wiibits.h @@ -59,7 +59,7 @@ $(TOOLS_OBJ)/transpal.$o: $(TOOLS_SRC)/transpal.cpp $(ENGINE_INC)/compat.h $(ENG $(TOOLS_OBJ)/wad2art.$o: $(TOOLS_SRC)/wad2art.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/pragmas.h $(TOOLS_OBJ)/wad2map.$o: $(TOOLS_SRC)/wad2map.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/pragmas.h $(TOOLS_OBJ)/kmd2tool.$o: $(TOOLS_SRC)/kmd2tool.cpp $(ENGINE_INC)/compat.h -$(TOOLS_OBJ)/md2tool.$o: $(TOOLS_SRC)/md2tool.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(ENGINE_INC)/glbuild.h $(ENGINE_INC)/mdsprite.h +$(TOOLS_OBJ)/md2tool.$o: $(TOOLS_SRC)/md2tool.cpp $(ENGINE_INC)/compat.h $(ENGINE_INC)/build.h $(ENGINE_INC)/buildtypes.h $(GLAD_INC)/glad/glad.h $(ENGINE_INC)/mdsprite.h $(TOOLS_OBJ)/generateicon.$o: $(TOOLS_SRC)/generateicon.cpp $(ENGINE_INC)/kplib.h $(ENGINE_INC)/compat.h $(TOOLS_OBJ)/cacheinfo.$o: $(TOOLS_SRC)/cacheinfo.cpp $(ENGINE_INC)/compat.h $(TOOLS_OBJ)/enumdisplay.$o: $(TOOLS_SRC)/enumdisplay.cpp $(ENGINE_INC)/compat.h diff --git a/source/build/include/build.h b/source/build/include/build.h index aca5f16d9..65bae6334 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -20,6 +20,7 @@ #include "compat.h" #include "pragmas.h" +#include "glad/glad.h" #include "glbuild.h" #include "palette.h" @@ -1424,7 +1425,7 @@ static FORCE_INLINE void push_nofog(void) #ifdef USE_OPENGL if (getrendermode() >= REND_POLYMOST) { - bglDisable(GL_FOG); + glDisable(GL_FOG); } #endif } @@ -1433,7 +1434,7 @@ static FORCE_INLINE void pop_nofog(void) { #ifdef USE_OPENGL if (getrendermode() >= REND_POLYMOST && !nofog) - bglEnable(GL_FOG); + glEnable(GL_FOG); #endif } diff --git a/source/build/include/glbuild.h b/source/build/include/glbuild.h index cab3ed376..d652d4116 100644 --- a/source/build/include/glbuild.h +++ b/source/build/include/glbuild.h @@ -11,98 +11,20 @@ # define USE_GLEXT #endif -// include this before glext does -#ifdef _WIN32 -# include "windows_inc.h" -#endif - -// Tell gl.h to not include glext.h, we'll include our own copy in a minute -#define GL_GLEXT_LEGACY - #if defined EDUKE32_OSX -# include # include -#elif defined EDUKE32_IOS -# include -#elif defined EDUKE32_GLES -# include -# include #else -# include # include #endif - -#if !defined DYNAMIC_GLEXT -# define GL_GLEXT_PROTOTYPES -#endif - -// get this header from http://oss.sgi.com/projects/ogl-sample/registry/ -// if you are missing it -//#include -#if defined EDUKE32_OSX -# include -# define GL_MAP_WRITE_BIT 0x0002 -# define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -# define GL_MAP_PERSISTENT_BIT 0x0040 -# define GL_MAP_COHERENT_BIT 0x0080 -# define GL_DYNAMIC_STORAGE_BIT 0x0100 -# define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#elif defined EDUKE32_IOS -typedef double GLdouble; -# include -typedef GLintptr GLintptrARB; -typedef GLsizeiptr GLsizeiptrARB; -typedef GLchar GLcharARB; -typedef void* GLhandleARB; -typedef unsigned int GLenum; -# define GL_TEXTURE0_ARB GL_TEXTURE0 -# define GL_RGB_SCALE_ARB GL_RGB_SCALE -# define GL_ELEMENT_ARRAY_BUFFER_ARB GL_ELEMENT_ARRAY_BUFFER -# define GL_ARRAY_BUFFER_ARB GL_ARRAY_BUFFER -# define GL_WRITE_ONLY_ARB 0x88B9 -# define GL_STREAM_DRAW_ARB 0x88E0 -# define GL_STATIC_DRAW_ARB 0x88E4 - -# define GL_RGBA4 0x8056 -# define GL_RGB5_A1 0x8057 -# define GL_RGB565 0x8D62 -# define GL_COMPRESSED_RGB8_ETC2 0x9274 -# define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -# define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#else -# include "glext.h" -#endif - -#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT -#error You should get an updated copy of glext.h from http://oss.sgi.com/projects/ogl-sample/registry/ -#endif - #if defined EDUKE32_GLES # include "jwzgles.h" #endif -#ifndef APIENTRY -# define APIENTRY -#endif - # ifdef _WIN32 # define PR_CALLBACK __stdcall # else # define PR_CALLBACK # endif - -// those defines are somehow missing from glext.h -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 - -#define GL_TEXTURE_RECTANGLE 0x84F5 - -#ifndef GL_ETC1_RGB8_OES -# define GL_ETC1_RGB8_OES 0x8D64 -#endif - // custom error checking extern GLenum BuildGLError; @@ -111,760 +33,32 @@ extern void BuildGLErrorCheck(void); //////// dynamic/static API wrapping //////// -#if defined DYNAMIC_GL - -#ifdef _WIN32 +#if !defined RENDERTYPESDL && defined _WIN32 && defined DYNAMIC_GL typedef HGLRC (WINAPI * bwglCreateContextProcPtr)(HDC); extern bwglCreateContextProcPtr bwglCreateContext; +#define wglCreateContext bwglCreateContext typedef BOOL (WINAPI * bwglDeleteContextProcPtr)(HGLRC); extern bwglDeleteContextProcPtr bwglDeleteContext; +#define wglDeleteContext bwglDeleteContext typedef PROC (WINAPI * bwglGetProcAddressProcPtr)(LPCSTR); extern bwglGetProcAddressProcPtr bwglGetProcAddress; +#define wglGetProcAddress bwglGetProcAddress typedef BOOL (WINAPI * bwglMakeCurrentProcPtr)(HDC,HGLRC); extern bwglMakeCurrentProcPtr bwglMakeCurrent; +#define wglMakeCurrent bwglMakeCurrent -typedef BOOL (WINAPI * bwglSwapBuffersProcPtr)(HDC); -extern bwglSwapBuffersProcPtr bwglSwapBuffers; typedef int32_t (WINAPI * bwglChoosePixelFormatProcPtr)(HDC,CONST PIXELFORMATDESCRIPTOR*); extern bwglChoosePixelFormatProcPtr bwglChoosePixelFormat; +#define wglChoosePixelFormat bwglChoosePixelFormat typedef int32_t (WINAPI * bwglDescribePixelFormatProcPtr)(HDC,int32_t,UINT,LPPIXELFORMATDESCRIPTOR); extern bwglDescribePixelFormatProcPtr bwglDescribePixelFormat; +#define wglDescribePixelFormat bwglDescribePixelFormat typedef int32_t (WINAPI * bwglGetPixelFormatProcPtr)(HDC); extern bwglGetPixelFormatProcPtr bwglGetPixelFormat; +#define wglGetPixelFormat bwglGetPixelFormat typedef BOOL (WINAPI * bwglSetPixelFormatProcPtr)(HDC,int32_t,const PIXELFORMATDESCRIPTOR*); extern bwglSetPixelFormatProcPtr bwglSetPixelFormat; -#endif - -typedef void (APIENTRY * bglClearColorProcPtr)( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); -extern bglClearColorProcPtr bglClearColor; -typedef void (APIENTRY * bglClearProcPtr)( GLbitfield mask ); -extern bglClearProcPtr bglClear; -typedef void (APIENTRY * bglColorMaskProcPtr)( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); -extern bglColorMaskProcPtr bglColorMask; -typedef void (APIENTRY * bglAlphaFuncProcPtr)( GLenum func, GLclampf ref ); -extern bglAlphaFuncProcPtr bglAlphaFunc; -typedef void (APIENTRY * bglBlendFuncProcPtr)( GLenum sfactor, GLenum dfactor ); -extern bglBlendFuncProcPtr bglBlendFunc; -typedef void (APIENTRY * bglCullFaceProcPtr)( GLenum mode ); -extern bglCullFaceProcPtr bglCullFace; -typedef void (APIENTRY * bglFrontFaceProcPtr)( GLenum mode ); -extern bglFrontFaceProcPtr bglFrontFace; -typedef void (APIENTRY * bglPolygonOffsetProcPtr)( GLfloat factor, GLfloat units ); -extern bglPolygonOffsetProcPtr bglPolygonOffset; -typedef void (APIENTRY * bglPolygonModeProcPtr)( GLenum face, GLenum mode ); -extern bglPolygonModeProcPtr bglPolygonMode; -typedef void (APIENTRY * bglEnableProcPtr)( GLenum cap ); -extern bglEnableProcPtr bglEnable; -typedef void (APIENTRY * bglDisableProcPtr)( GLenum cap ); -extern bglDisableProcPtr bglDisable; -typedef void (APIENTRY * bglGetDoublevProcPtr)( GLenum pname, GLdouble *params ); -extern bglGetDoublevProcPtr bglGetDoublev; -typedef void (APIENTRY * bglGetFloatvProcPtr)( GLenum pname, GLfloat *params ); -extern bglGetFloatvProcPtr bglGetFloatv; -typedef void (APIENTRY * bglGetIntegervProcPtr)( GLenum pname, GLint *params ); -extern bglGetIntegervProcPtr bglGetIntegerv; -typedef void (APIENTRY * bglPushAttribProcPtr)( GLbitfield mask ); -extern bglPushAttribProcPtr bglPushAttrib; -typedef void (APIENTRY * bglPopAttribProcPtr)( void ); -extern bglPopAttribProcPtr bglPopAttrib; -typedef GLenum (APIENTRY * bglGetErrorProcPtr)( void ); -extern bglGetErrorProcPtr bglGetError; -typedef const GLubyte* (APIENTRY * bglGetStringProcPtr)( GLenum name ); -extern bglGetStringProcPtr bglGetString; -typedef void (APIENTRY * bglHintProcPtr)( GLenum target, GLenum mode ); -extern bglHintProcPtr bglHint; -typedef void (APIENTRY * bglDrawBufferProcPtr)(GLenum mode); -extern bglDrawBufferProcPtr bglDrawBuffer; -typedef void (APIENTRY * bglReadBufferProcPtr)(GLenum mode); -extern bglReadBufferProcPtr bglReadBuffer; -typedef void (APIENTRY * bglScissorProcPtr)(GLint x, GLint y, GLsizei width, GLsizei height); -extern bglScissorProcPtr bglScissor; -typedef void (APIENTRY * bglClipPlaneProcPtr)(GLenum plane, const GLdouble *equation); -extern bglClipPlaneProcPtr bglClipPlane; - -// Depth -typedef void (APIENTRY * bglDepthFuncProcPtr)( GLenum func ); -extern bglDepthFuncProcPtr bglDepthFunc; -typedef void (APIENTRY * bglDepthMaskProcPtr)( GLboolean flag ); -extern bglDepthMaskProcPtr bglDepthMask; -//typedef void (APIENTRY * bglDepthRangeProcPtr)( GLclampd near_val, GLclampd far_val ); -//extern bglDepthRangeProcPtr bglDepthRange; - -// Matrix -typedef void (APIENTRY * bglMatrixModeProcPtr)( GLenum mode ); -extern bglMatrixModeProcPtr bglMatrixMode; -typedef void (APIENTRY * bglOrthoProcPtr)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ); -extern bglOrthoProcPtr bglOrtho; -typedef void (APIENTRY * bglFrustumProcPtr)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ); -extern bglFrustumProcPtr bglFrustum; -typedef void (APIENTRY * bglViewportProcPtr)( GLint x, GLint y, GLsizei width, GLsizei height ); -extern bglViewportProcPtr bglViewport; -typedef void (APIENTRY * bglPushMatrixProcPtr)( void ); -extern bglPushMatrixProcPtr bglPushMatrix; -typedef void (APIENTRY * bglPopMatrixProcPtr)( void ); -extern bglPopMatrixProcPtr bglPopMatrix; -typedef void (APIENTRY * bglLoadIdentityProcPtr)( void ); -extern bglLoadIdentityProcPtr bglLoadIdentity; -typedef void (APIENTRY * bglLoadMatrixfProcPtr)( const GLfloat *m ); -extern bglLoadMatrixfProcPtr bglLoadMatrixf; -typedef void (APIENTRY * bglLoadMatrixdProcPtr)( const GLdouble *m ); -extern bglLoadMatrixdProcPtr bglLoadMatrixd; -typedef void (APIENTRY * bglMultMatrixfProcPtr)( const GLfloat *m ); -extern bglMultMatrixfProcPtr bglMultMatrixf; -typedef void (APIENTRY * bglMultMatrixdProcPtr)( const GLdouble *m ); -extern bglMultMatrixdProcPtr bglMultMatrixd; -typedef void (APIENTRY * bglRotatefProcPtr)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -extern bglRotatefProcPtr bglRotatef; -typedef void (APIENTRY * bglScalefProcPtr)(GLfloat x, GLfloat y, GLfloat z); -extern bglScalefProcPtr bglScalef; -typedef void (APIENTRY * bglTranslatefProcPtr)(GLfloat x, GLfloat y, GLfloat z); -extern bglTranslatefProcPtr bglTranslatef; - -// Drawing -typedef void (APIENTRY * bglBeginProcPtr)( GLenum mode ); -extern bglBeginProcPtr bglBegin; -typedef void (APIENTRY * bglEndProcPtr)( void ); -extern bglEndProcPtr bglEnd; -typedef void (APIENTRY * bglVertex2fProcPtr)( GLfloat x, GLfloat y ); -extern bglVertex2fProcPtr bglVertex2f; -typedef void (APIENTRY * bglVertex2iProcPtr)( GLint x, GLint y ); -extern bglVertex2iProcPtr bglVertex2i; -typedef void (APIENTRY * bglVertex3fProcPtr)( GLfloat x, GLfloat y, GLfloat z ); -extern bglVertex3fProcPtr bglVertex3f; -typedef void (APIENTRY * bglVertex3dProcPtr)( GLdouble x, GLdouble y, GLdouble z ); -extern bglVertex3dProcPtr bglVertex3d; -typedef void (APIENTRY * bglVertex3fvProcPtr)( const GLfloat *v ); -extern bglVertex3fvProcPtr bglVertex3fv; -typedef void (APIENTRY * bglVertex3dvProcPtr)( const GLdouble *v ); -extern bglVertex3dvProcPtr bglVertex3dv; -typedef void (APIENTRY * bglRectiProcPtr)( GLint x1, GLint y1, GLint x2, GLint y2 ); -extern bglRectiProcPtr bglRecti; -typedef void (APIENTRY * bglColor3fProcPtr)(GLfloat red, GLfloat green, GLfloat blue); -extern bglColor3fProcPtr bglColor3f; -typedef void (APIENTRY * bglColor4fProcPtr)( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); -extern bglColor4fProcPtr bglColor4f; -typedef void (APIENTRY * bglColor4ubProcPtr)( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ); -extern bglColor4ubProcPtr bglColor4ub; -typedef void (APIENTRY * bglTexCoord2dProcPtr)( GLdouble s, GLdouble t ); -extern bglTexCoord2dProcPtr bglTexCoord2d; -typedef void (APIENTRY * bglTexCoord2fProcPtr)( GLfloat s, GLfloat t ); -extern bglTexCoord2fProcPtr bglTexCoord2f; -typedef void (APIENTRY * bglTexCoord2iProcPtr)( GLint s, GLint t ); -extern bglTexCoord2iProcPtr bglTexCoord2i; -typedef void (APIENTRY * bglNormal3fProcPtr)( GLfloat x, GLfloat y, GLfloat z ); -extern bglNormal3fProcPtr bglNormal3f; - -// Lighting -typedef void (APIENTRY * bglShadeModelProcPtr)( GLenum mode ); -extern bglShadeModelProcPtr bglShadeModel; -typedef void (APIENTRY * bglLightfvProcPtr)( GLenum light, GLenum pname, const GLfloat * params ); -extern bglLightfvProcPtr bglLightfv; - -// Raster funcs -typedef void (APIENTRY * bglReadPixelsProcPtr)( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ); -extern bglReadPixelsProcPtr bglReadPixels; -typedef void (APIENTRY * bglRasterPos4iProcPtr)( GLint x, GLint y, GLint z, GLint w ); -extern bglRasterPos4iProcPtr bglRasterPos4i; -typedef void (APIENTRY * bglDrawPixelsProcPtr)( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); -extern bglDrawPixelsProcPtr bglDrawPixels; -typedef void (APIENTRY * bglPixelStoreiProcPtr)( GLenum pname, GLint param ); -extern bglPixelStoreiProcPtr bglPixelStorei; - -// Texture mapping -typedef void (APIENTRY * bglTexEnvfProcPtr)( GLenum target, GLenum pname, GLfloat param ); -extern bglTexEnvfProcPtr bglTexEnvf; -typedef void (APIENTRY * bglGenTexturesProcPtr)( GLsizei n, GLuint *textures ); // 1.1 -extern bglGenTexturesProcPtr bglGenTextures; -typedef void (APIENTRY * bglDeleteTexturesProcPtr)( GLsizei n, const GLuint *textures); // 1.1 -extern bglDeleteTexturesProcPtr bglDeleteTextures; -typedef void (APIENTRY * bglBindTextureProcPtr)( GLenum target, GLuint texture ); // 1.1 -extern bglBindTextureProcPtr bglBindTexture; -typedef void (APIENTRY * bglTexImage2DProcPtr)( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); -extern bglTexImage2DProcPtr bglTexImage2D; -typedef void (APIENTRY * bglCopyTexImage2DProcPtr)( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); -extern bglCopyTexImage2DProcPtr bglCopyTexImage2D; -typedef void (APIENTRY * bglCopyTexSubImage2DProcPtr)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -extern bglCopyTexSubImage2DProcPtr bglCopyTexSubImage2D; -typedef void (APIENTRY * bglTexSubImage2DProcPtr)( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); // 1.1 -extern bglTexSubImage2DProcPtr bglTexSubImage2D; -typedef void (APIENTRY * bglTexParameterfProcPtr)( GLenum target, GLenum pname, GLfloat param ); -extern bglTexParameterfProcPtr bglTexParameterf; -typedef void (APIENTRY * bglTexParameteriProcPtr)( GLenum target, GLenum pname, GLint param ); -extern bglTexParameteriProcPtr bglTexParameteri; -typedef void (APIENTRY * bglGetTexParameterivProcPtr)( GLenum target, GLenum pname, GLint *params ); -extern bglGetTexParameterivProcPtr bglGetTexParameteriv; -typedef void (APIENTRY * bglGetTexLevelParameterivProcPtr)( GLenum target, GLint level, GLenum pname, GLint *params ); -extern bglGetTexLevelParameterivProcPtr bglGetTexLevelParameteriv; -typedef void (APIENTRY * bglTexGenfvProcPtr)(GLenum coord, GLenum pname, const GLfloat *params); -extern bglTexGenfvProcPtr bglTexGenfv; - -// Fog -typedef void (APIENTRY * bglFogfProcPtr)( GLenum pname, GLfloat param ); -extern bglFogfProcPtr bglFogf; -typedef void (APIENTRY * bglFogiProcPtr)( GLenum pname, GLint param ); -extern bglFogiProcPtr bglFogi; -typedef void (APIENTRY * bglFogfvProcPtr)( GLenum pname, const GLfloat *params ); -extern bglFogfvProcPtr bglFogfv; - -// Display Lists -typedef void (APIENTRY * bglNewListProcPtr)(GLuint list, GLenum mode); -extern bglNewListProcPtr bglNewList; -typedef void (APIENTRY * bglEndListProcPtr)(void); -extern bglEndListProcPtr bglEndList; -typedef void (APIENTRY * bglCallListProcPtr)(GLuint list); -extern bglCallListProcPtr bglCallList; -typedef void (APIENTRY * bglDeleteListsProcPtr)(GLuint list, GLsizei range); -extern bglDeleteListsProcPtr bglDeleteLists; - -// Vertex Arrays -typedef void (APIENTRY * bglEnableClientStateProcPtr)(GLenum cap); -extern bglEnableClientStateProcPtr bglEnableClientState; -typedef void (APIENTRY * bglDisableClientStateProcPtr)(GLenum cap); -extern bglDisableClientStateProcPtr bglDisableClientState; -typedef void (APIENTRY * bglVertexPointerProcPtr)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -extern bglVertexPointerProcPtr bglVertexPointer; -typedef void (APIENTRY * bglNormalPointerProcPtr)(GLenum type, GLsizei stride, const GLvoid *pointer); -extern bglNormalPointerProcPtr bglNormalPointer; -typedef void (APIENTRY * bglTexCoordPointerProcPtr)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -extern bglTexCoordPointerProcPtr bglTexCoordPointer; -typedef void (APIENTRY * bglDrawArraysProcPtr)(GLenum mode, GLint first, GLsizei count); -extern bglDrawArraysProcPtr bglDrawArrays; -typedef void (APIENTRY * bglDrawElementsProcPtr)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); -extern bglDrawElementsProcPtr bglDrawElements; - -// Stencil Buffer -typedef void (APIENTRY * bglClearStencilProcPtr)(GLint s); -extern bglClearStencilProcPtr bglClearStencil; -typedef void (APIENTRY * bglStencilOpProcPtr)(GLenum fail, GLenum zfail, GLenum zpass); -extern bglStencilOpProcPtr bglStencilOp; -typedef void (APIENTRY * bglStencilFuncProcPtr)(GLenum func, GLint ref, GLuint mask); -extern bglStencilFuncProcPtr bglStencilFunc; - -#else - -#define bglClearColor glClearColor -#define bglClear glClear -#define bglColorMask glColorMask -#define bglAlphaFunc glAlphaFunc -#define bglBlendFunc glBlendFunc -#define bglCullFace glCullFace -#define bglFrontFace glFrontFace -#define bglPolygonOffset glPolygonOffset -#define bglPolygonMode glPolygonMode -#define bglEnable glEnable -#define bglDisable glDisable -#define bglGetDoublev glGetDoublev -#define bglGetFloatv glGetFloatv -#define bglGetIntegerv glGetIntegerv -#define bglPushAttrib glPushAttrib -#define bglPopAttrib glPopAttrib -#define bglGetError glGetError -#define bglGetString glGetString -#define bglHint glHint -#define bglDrawBuffer glDrawBuffer -#define bglReadBuffer glReadBuffer -#define bglScissor glScissor -#define bglClipPlane glClipPlane - -// Depth -#define bglDepthFunc glDepthFunc -#define bglDepthMask glDepthMask -//#define bglDepthRange glDepthRange - -// Matrix -#define bglMatrixMode glMatrixMode -#define bglOrtho glOrtho -#define bglFrustum glFrustum -#define bglViewport glViewport -#define bglPushMatrix glPushMatrix -#define bglPopMatrix glPopMatrix -#define bglLoadIdentity glLoadIdentity -#define bglLoadMatrixf glLoadMatrixf -#define bglLoadMatrixd glLoadMatrixd -#define bglMultMatrixf glMultMatrixf -#define bglMultMatrixd glMultMatrixd -#define bglRotatef glRotatef -#define bglScalef glScalef -#define bglTranslatef glTranslatef - -// Drawing -#define bglBegin glBegin -#define bglEnd glEnd -#define bglVertex2f glVertex2f -#define bglVertex2i glVertex2i -#define bglVertex3f glVertex3f -#define bglVertex3d glVertex3d -#define bglVertex3fv glVertex3fv -#define bglVertex3dv glVertex3dv -#define bglRecti glRecti -#define bglColor3f glColor3f -#define bglColor4f glColor4f -#define bglColor4ub glColor4ub -#define bglTexCoord2d glTexCoord2d -#define bglTexCoord2f glTexCoord2f -#define bglTexCoord2i glTexCoord2i -#define bglNormal3f glNormal3f - -// Lighting -#define bglShadeModel glShadeModel -#define bglLightfv glLightfv - -// Raster funcs -#define bglReadPixels glReadPixels -#define bglRasterPos4i glRasterPos4i -#define bglDrawPixels glDrawPixels -#define bglPixelStorei glPixelStorei - -// Texture mapping -#define bglTexEnvf glTexEnvf -#define bglGenTextures glGenTextures -#define bglDeleteTextures glDeleteTextures -#define bglBindTexture glBindTexture -#define bglTexImage2D glTexImage2D -#define bglCopyTexImage2D glCopyTexImage2D -#define bglCopyTexSubImage2D glCopyTexSubImage2D; -#define bglTexSubImage2D glTexSubImage2D -#define bglTexParameterf glTexParameterf -#define bglTexParameteri glTexParameteri -#define bglGetTexParameteriv glGetTexParameteriv -#define bglGetTexLevelParameteriv glGetTexLevelParameteriv - -// Fog -#define bglFogf glFogf -#define bglFogi glFogi -#define bglFogfv glFogfv - -// Display Lists -#define bglNewList glNewList -#define bglEndList glEndList -#define bglCallList glCallList -#define bglDeleteLists glDeleteLists - -// Vertex Arrays -#define bglEnableClientState glEnableClientState -#define bglDisableClientState glDisableClientState -#define bglVertexPointer glVertexPointer -#define bglNormalPointer glNormalPointer -#define bglTexCoordPointer glTexCoordPointer -#define bglDrawElements glDrawElements - -// Stencil Buffer -#define bglClearStencil glClearStencil -#define bglStencilOp glStencilOp -#define bglStencilFunc glStencilFunc - -#endif - -#if defined DYNAMIC_GLEXT - -typedef void (APIENTRY * bglBlendEquationProcPtr)( GLenum mode ); -extern bglBlendEquationProcPtr bglBlendEquation; - -typedef void (APIENTRY * bglTexImage3DProcPtr)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -extern bglTexImage3DProcPtr bglTexImage3D; -typedef void (APIENTRY * bglCompressedTexImage2DARBProcPtr)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -extern bglCompressedTexImage2DARBProcPtr bglCompressedTexImage2DARB; -typedef void (APIENTRY * bglGetCompressedTexImageARBProcPtr)(GLenum, GLint, GLvoid *); -extern bglGetCompressedTexImageARBProcPtr bglGetCompressedTexImageARB; - -// GPU Programs -typedef void (APIENTRY * bglGenProgramsARBProcPtr)(GLsizei, GLuint *); -extern bglGenProgramsARBProcPtr bglGenProgramsARB; -typedef void (APIENTRY * bglBindProgramARBProcPtr)(GLenum, GLuint); -extern bglBindProgramARBProcPtr bglBindProgramARB; -typedef void (APIENTRY * bglProgramStringARBProcPtr)(GLenum, GLenum, GLsizei, const GLvoid *); -extern bglProgramStringARBProcPtr bglProgramStringARB; -typedef void (APIENTRY * bglDeleteProgramsARBProcPtr)(GLsizei n, const GLuint *programs); -extern bglDeleteProgramsARBProcPtr bglDeleteProgramsARB; - -// Multitexturing -typedef void (APIENTRY * bglActiveTextureARBProcPtr)(GLenum texture); -extern bglActiveTextureARBProcPtr bglActiveTextureARB; -typedef void (APIENTRY * bglClientActiveTextureARBProcPtr)(GLenum texture); -extern bglClientActiveTextureARBProcPtr bglClientActiveTextureARB; -typedef void (APIENTRY * bglMultiTexCoord2dARBProcPtr)(GLenum target, GLdouble s, GLdouble t ); -extern bglMultiTexCoord2dARBProcPtr bglMultiTexCoord2dARB; -typedef void (APIENTRY * bglMultiTexCoord2fARBProcPtr)(GLenum target, GLfloat s, GLfloat t ); -extern bglMultiTexCoord2fARBProcPtr bglMultiTexCoord2fARB; - -// Frame Buffer Objects -typedef void (APIENTRY * bglGenFramebuffersEXTProcPtr)(GLsizei n, GLuint *framebuffers); -extern bglGenFramebuffersEXTProcPtr bglGenFramebuffersEXT; -typedef void (APIENTRY * bglBindFramebufferEXTProcPtr)(GLenum target, GLuint framebuffer); -extern bglBindFramebufferEXTProcPtr bglBindFramebufferEXT; -typedef void (APIENTRY * bglFramebufferTexture2DEXTProcPtr)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -extern bglFramebufferTexture2DEXTProcPtr bglFramebufferTexture2DEXT; -typedef GLenum (APIENTRY * bglCheckFramebufferStatusEXTProcPtr)(GLenum target); -extern bglCheckFramebufferStatusEXTProcPtr bglCheckFramebufferStatusEXT; -typedef void (APIENTRY * bglDeleteFramebuffersEXTProcPtr)(GLsizei n, const GLuint *framebuffers); -extern bglDeleteFramebuffersEXTProcPtr bglDeleteFramebuffersEXT; - -// Vertex Buffer Objects -typedef void (APIENTRY * bglGenBuffersARBProcPtr)(GLsizei n, GLuint * buffers); -extern bglGenBuffersARBProcPtr bglGenBuffersARB; -typedef void (APIENTRY * bglBindBufferARBProcPtr)(GLenum target, GLuint buffer); -extern bglBindBufferARBProcPtr bglBindBufferARB; -typedef void (APIENTRY * bglDeleteBuffersARBProcPtr)(GLsizei n, const GLuint * buffers); -extern bglDeleteBuffersARBProcPtr bglDeleteBuffersARB; -typedef void (APIENTRY * bglBufferDataARBProcPtr)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); -extern bglBufferDataARBProcPtr bglBufferDataARB; -typedef void (APIENTRY * bglBufferSubDataARBProcPtr)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); -extern bglBufferSubDataARBProcPtr bglBufferSubDataARB; -typedef void* (APIENTRY * bglMapBufferARBProcPtr)(GLenum target, GLenum access); -extern bglMapBufferARBProcPtr bglMapBufferARB; -typedef GLboolean (APIENTRY * bglUnmapBufferARBProcPtr)(GLenum target); -extern bglUnmapBufferARBProcPtr bglUnmapBufferARB; - -// ARB_buffer_storage -typedef void (APIENTRY * bglBufferStorageProcPtr)(GLenum target, GLintptrARB size, const GLvoid * data, GLbitfield flags); -extern bglBufferStorageProcPtr bglBufferStorage; - -// ARB_map_buffer_range -typedef void* (APIENTRY * bglMapBufferRangeProcPtr) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -extern bglMapBufferRangeProcPtr bglMapBufferRange; - -// Occlusion queries -typedef void (APIENTRY * bglGenQueriesARBProcPtr)(GLsizei n, GLuint *ids); -extern bglGenQueriesARBProcPtr bglGenQueriesARB; -typedef void (APIENTRY * bglDeleteQueriesARBProcPtr)(GLsizei n, const GLuint *ids); -extern bglDeleteQueriesARBProcPtr bglDeleteQueriesARB; -typedef GLboolean (APIENTRY * bglIsQueryARBProcPtr)(GLuint id); -extern bglIsQueryARBProcPtr bglIsQueryARB; -typedef void (APIENTRY * bglBeginQueryARBProcPtr)(GLenum target, GLuint id); -extern bglBeginQueryARBProcPtr bglBeginQueryARB; -typedef void (APIENTRY * bglEndQueryARBProcPtr)(GLenum target); -extern bglEndQueryARBProcPtr bglEndQueryARB; -typedef void (APIENTRY * bglGetQueryivARBProcPtr)(GLenum target, GLenum pname, GLint *params); -extern bglGetQueryivARBProcPtr bglGetQueryivARB; -typedef void (APIENTRY * bglGetQueryObjectivARBProcPtr)(GLuint id, GLenum pname, GLint *params); -extern bglGetQueryObjectivARBProcPtr bglGetQueryObjectivARB; -typedef void (APIENTRY * bglGetQueryObjectuivARBProcPtr)(GLuint id, GLenum pname, GLuint *params); -extern bglGetQueryObjectuivARBProcPtr bglGetQueryObjectuivARB; - -// Shader Objects -typedef void (APIENTRY * bglDeleteObjectARBProcPtr)(GLhandleARB); -extern bglDeleteObjectARBProcPtr bglDeleteObjectARB; -typedef GLhandleARB (APIENTRY * bglGetHandleARBProcPtr)(GLenum); -extern bglGetHandleARBProcPtr bglGetHandleARB; -typedef void (APIENTRY * bglDetachObjectARBProcPtr)(GLhandleARB, GLhandleARB); -extern bglDetachObjectARBProcPtr bglDetachObjectARB; -typedef GLhandleARB (APIENTRY * bglCreateShaderObjectARBProcPtr)(GLenum); -extern bglCreateShaderObjectARBProcPtr bglCreateShaderObjectARB; -typedef void (APIENTRY * bglShaderSourceARBProcPtr)(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); -extern bglShaderSourceARBProcPtr bglShaderSourceARB; -typedef void (APIENTRY * bglCompileShaderARBProcPtr)(GLhandleARB); -extern bglCompileShaderARBProcPtr bglCompileShaderARB; -typedef GLhandleARB (APIENTRY * bglCreateProgramObjectARBProcPtr)(void); -extern bglCreateProgramObjectARBProcPtr bglCreateProgramObjectARB; -typedef void (APIENTRY * bglAttachObjectARBProcPtr)(GLhandleARB, GLhandleARB); -extern bglAttachObjectARBProcPtr bglAttachObjectARB; -typedef void (APIENTRY * bglLinkProgramARBProcPtr)(GLhandleARB); -extern bglLinkProgramARBProcPtr bglLinkProgramARB; -typedef void (APIENTRY * bglUseProgramObjectARBProcPtr)(GLhandleARB); -extern bglUseProgramObjectARBProcPtr bglUseProgramObjectARB; -typedef void (APIENTRY * bglValidateProgramARBProcPtr)(GLhandleARB); -extern bglValidateProgramARBProcPtr bglValidateProgramARB; -typedef void (APIENTRY * bglUniform1fARBProcPtr)(GLint, GLfloat); -extern bglUniform1fARBProcPtr bglUniform1fARB; -typedef void (APIENTRY * bglUniform2fARBProcPtr)(GLint, GLfloat, GLfloat); -extern bglUniform2fARBProcPtr bglUniform2fARB; -typedef void (APIENTRY * bglUniform3fARBProcPtr)(GLint, GLfloat, GLfloat, GLfloat); -extern bglUniform3fARBProcPtr bglUniform3fARB; -typedef void (APIENTRY * bglUniform4fARBProcPtr)(GLint, GLfloat, GLfloat, GLfloat, GLfloat); -extern bglUniform4fARBProcPtr bglUniform4fARB; -typedef void (APIENTRY * bglUniform1iARBProcPtr)(GLint, GLint); -extern bglUniform1iARBProcPtr bglUniform1iARB; -typedef void (APIENTRY * bglUniform2iARBProcPtr)(GLint, GLint, GLint); -extern bglUniform2iARBProcPtr bglUniform2iARB; -typedef void (APIENTRY * bglUniform3iARBProcPtr)(GLint, GLint, GLint, GLint); -extern bglUniform3iARBProcPtr bglUniform3iARB; -typedef void (APIENTRY * bglUniform4iARBProcPtr)(GLint, GLint, GLint, GLint, GLint); -extern bglUniform4iARBProcPtr bglUniform4iARB; -typedef void (APIENTRY * bglUniform1fvARBProcPtr)(GLint, GLsizei, const GLfloat *); -extern bglUniform1fvARBProcPtr bglUniform1fvARB; -typedef void (APIENTRY * bglUniform2fvARBProcPtr)(GLint, GLsizei, const GLfloat *); -extern bglUniform2fvARBProcPtr bglUniform2fvARB; -typedef void (APIENTRY * bglUniform3fvARBProcPtr)(GLint, GLsizei, const GLfloat *); -extern bglUniform3fvARBProcPtr bglUniform3fvARB; -typedef void (APIENTRY * bglUniform4fvARBProcPtr)(GLint, GLsizei, const GLfloat *); -extern bglUniform4fvARBProcPtr bglUniform4fvARB; -typedef void (APIENTRY * bglUniform1ivARBProcPtr)(GLint, GLsizei, const GLint *); -extern bglUniform1ivARBProcPtr bglUniform1ivARB; -typedef void (APIENTRY * bglUniform2ivARBProcPtr)(GLint, GLsizei, const GLint *); -extern bglUniform2ivARBProcPtr bglUniform2ivARB; -typedef void (APIENTRY * bglUniform3ivARBProcPtr)(GLint, GLsizei, const GLint *); -extern bglUniform3ivARBProcPtr bglUniform3ivARB; -typedef void (APIENTRY * bglUniform4ivARBProcPtr)(GLint, GLsizei, const GLint *); -extern bglUniform4ivARBProcPtr bglUniform4ivARB; -typedef void (APIENTRY * bglUniformMatrix2fvARBProcPtr)(GLint, GLsizei, GLboolean, const GLfloat *); -extern bglUniformMatrix2fvARBProcPtr bglUniformMatrix2fvARB; -typedef void (APIENTRY * bglUniformMatrix3fvARBProcPtr)(GLint, GLsizei, GLboolean, const GLfloat *); -extern bglUniformMatrix3fvARBProcPtr bglUniformMatrix3fvARB; -typedef void (APIENTRY * bglUniformMatrix4fvARBProcPtr)(GLint, GLsizei, GLboolean, const GLfloat *); -extern bglUniformMatrix4fvARBProcPtr bglUniformMatrix4fvARB; -typedef void (APIENTRY * bglGetObjectParameterfvARBProcPtr)(GLhandleARB, GLenum, GLfloat *); -extern bglGetObjectParameterfvARBProcPtr bglGetObjectParameterfvARB; -typedef void (APIENTRY * bglGetObjectParameterivARBProcPtr)(GLhandleARB, GLenum, GLint *); -extern bglGetObjectParameterivARBProcPtr bglGetObjectParameterivARB; -typedef void (APIENTRY * bglGetInfoLogARBProcPtr)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -extern bglGetInfoLogARBProcPtr bglGetInfoLogARB; -typedef void (APIENTRY * bglGetAttachedObjectsARBProcPtr)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); -extern bglGetAttachedObjectsARBProcPtr bglGetAttachedObjectsARB; -typedef GLint (APIENTRY * bglGetUniformLocationARBProcPtr)(GLhandleARB, const GLcharARB *); -extern bglGetUniformLocationARBProcPtr bglGetUniformLocationARB; -typedef void (APIENTRY * bglGetActiveUniformARBProcPtr)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -extern bglGetActiveUniformARBProcPtr bglGetActiveUniformARB; -typedef void (APIENTRY * bglGetUniformfvARBProcPtr)(GLhandleARB, GLint, GLfloat *); -extern bglGetUniformfvARBProcPtr bglGetUniformfvARB; -typedef void (APIENTRY * bglGetUniformivARBProcPtr)(GLhandleARB, GLint, GLint *); -extern bglGetUniformivARBProcPtr bglGetUniformivARB; -typedef void (APIENTRY * bglGetShaderSourceARBProcPtr)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -extern bglGetShaderSourceARBProcPtr bglGetShaderSourceARB; - -// Vertex Shaders -typedef void (APIENTRY * bglVertexAttrib1dARBProcPtr)(GLuint, GLdouble); -extern bglVertexAttrib1dARBProcPtr bglVertexAttrib1dARB; -typedef void (APIENTRY * bglVertexAttrib1dvARBProcPtr)(GLuint, const GLdouble *); -extern bglVertexAttrib1dvARBProcPtr bglVertexAttrib1dvARB; -typedef void (APIENTRY * bglVertexAttrib1fARBProcPtr)(GLuint, GLfloat); -extern bglVertexAttrib1fARBProcPtr bglVertexAttrib1fARB; -typedef void (APIENTRY * bglVertexAttrib1fvARBProcPtr)(GLuint, const GLfloat *); -extern bglVertexAttrib1fvARBProcPtr bglVertexAttrib1fvARB; -typedef void (APIENTRY * bglVertexAttrib1sARBProcPtr)(GLuint, GLshort); -extern bglVertexAttrib1sARBProcPtr bglVertexAttrib1sARB; -typedef void (APIENTRY * bglVertexAttrib1svARBProcPtr)(GLuint, const GLshort *); -extern bglVertexAttrib1svARBProcPtr bglVertexAttrib1svARB; -typedef void (APIENTRY * bglVertexAttrib2dARBProcPtr)(GLuint, GLdouble, GLdouble); -extern bglVertexAttrib2dARBProcPtr bglVertexAttrib2dARB; -typedef void (APIENTRY * bglVertexAttrib2dvARBProcPtr)(GLuint, const GLdouble *); -extern bglVertexAttrib2dvARBProcPtr bglVertexAttrib2dvARB; -typedef void (APIENTRY * bglVertexAttrib2fARBProcPtr)(GLuint, GLfloat, GLfloat); -extern bglVertexAttrib2fARBProcPtr bglVertexAttrib2fARB; -typedef void (APIENTRY * bglVertexAttrib2fvARBProcPtr)(GLuint, const GLfloat *); -extern bglVertexAttrib2fvARBProcPtr bglVertexAttrib2fvARB; -typedef void (APIENTRY * bglVertexAttrib2sARBProcPtr)(GLuint, GLshort, GLshort); -extern bglVertexAttrib2sARBProcPtr bglVertexAttrib2sARB; -typedef void (APIENTRY * bglVertexAttrib2svARBProcPtr)(GLuint, const GLshort *); -extern bglVertexAttrib2svARBProcPtr bglVertexAttrib2svARB; -typedef void (APIENTRY * bglVertexAttrib3dARBProcPtr)(GLuint, GLdouble, GLdouble, GLdouble); -extern bglVertexAttrib3dARBProcPtr bglVertexAttrib3dARB; -typedef void (APIENTRY * bglVertexAttrib3dvARBProcPtr)(GLuint, const GLdouble *); -extern bglVertexAttrib3dvARBProcPtr bglVertexAttrib3dvARB; -typedef void (APIENTRY * bglVertexAttrib3fARBProcPtr)(GLuint, GLfloat, GLfloat, GLfloat); -extern bglVertexAttrib3fARBProcPtr bglVertexAttrib3fARB; -typedef void (APIENTRY * bglVertexAttrib3fvARBProcPtr)(GLuint, const GLfloat *); -extern bglVertexAttrib3fvARBProcPtr bglVertexAttrib3fvARB; -typedef void (APIENTRY * bglVertexAttrib3sARBProcPtr)(GLuint, GLshort, GLshort, GLshort); -extern bglVertexAttrib3sARBProcPtr bglVertexAttrib3sARB; -typedef void (APIENTRY * bglVertexAttrib3svARBProcPtr)(GLuint, const GLshort *); -extern bglVertexAttrib3svARBProcPtr bglVertexAttrib3svARB; -typedef void (APIENTRY * bglVertexAttrib4NbvARBProcPtr)(GLuint, const GLbyte *); -extern bglVertexAttrib4NbvARBProcPtr bglVertexAttrib4NbvARB; -typedef void (APIENTRY * bglVertexAttrib4NivARBProcPtr)(GLuint, const GLint *); -extern bglVertexAttrib4NivARBProcPtr bglVertexAttrib4NivARB; -typedef void (APIENTRY * bglVertexAttrib4NsvARBProcPtr)(GLuint, const GLshort *); -extern bglVertexAttrib4NsvARBProcPtr bglVertexAttrib4NsvARB; -typedef void (APIENTRY * bglVertexAttrib4NubARBProcPtr)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -extern bglVertexAttrib4NubARBProcPtr bglVertexAttrib4NubARB; -typedef void (APIENTRY * bglVertexAttrib4NubvARBProcPtr)(GLuint, const GLubyte *); -extern bglVertexAttrib4NubvARBProcPtr bglVertexAttrib4NubvARB; -typedef void (APIENTRY * bglVertexAttrib4NuivARBProcPtr)(GLuint, const GLuint *); -extern bglVertexAttrib4NuivARBProcPtr bglVertexAttrib4NuivARB; -typedef void (APIENTRY * bglVertexAttrib4NusvARBProcPtr)(GLuint, const GLushort *); -extern bglVertexAttrib4NusvARBProcPtr bglVertexAttrib4NusvARB; -typedef void (APIENTRY * bglVertexAttrib4bvARBProcPtr)(GLuint, const GLbyte *); -extern bglVertexAttrib4bvARBProcPtr bglVertexAttrib4bvARB; -typedef void (APIENTRY * bglVertexAttrib4dARBProcPtr)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -extern bglVertexAttrib4dARBProcPtr bglVertexAttrib4dARB; -typedef void (APIENTRY * bglVertexAttrib4dvARBProcPtr)(GLuint, const GLdouble *); -extern bglVertexAttrib4dvARBProcPtr bglVertexAttrib4dvARB; -typedef void (APIENTRY * bglVertexAttrib4fARBProcPtr)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -extern bglVertexAttrib4fARBProcPtr bglVertexAttrib4fARB; -typedef void (APIENTRY * bglVertexAttrib4fvARBProcPtr)(GLuint, const GLfloat *); -extern bglVertexAttrib4fvARBProcPtr bglVertexAttrib4fvARB; -typedef void (APIENTRY * bglVertexAttrib4ivARBProcPtr)(GLuint, const GLint *); -extern bglVertexAttrib4ivARBProcPtr bglVertexAttrib4ivARB; -typedef void (APIENTRY * bglVertexAttrib4sARBProcPtr)(GLuint, GLshort, GLshort, GLshort, GLshort); -extern bglVertexAttrib4sARBProcPtr bglVertexAttrib4sARB; -typedef void (APIENTRY * bglVertexAttrib4svARBProcPtr)(GLuint, const GLshort *); -extern bglVertexAttrib4svARBProcPtr bglVertexAttrib4svARB; -typedef void (APIENTRY * bglVertexAttrib4ubvARBProcPtr)(GLuint, const GLubyte *); -extern bglVertexAttrib4ubvARBProcPtr bglVertexAttrib4ubvARB; -typedef void (APIENTRY * bglVertexAttrib4uivARBProcPtr)(GLuint, const GLuint *); -extern bglVertexAttrib4uivARBProcPtr bglVertexAttrib4uivARB; -typedef void (APIENTRY * bglVertexAttrib4usvARBProcPtr)(GLuint, const GLushort *); -extern bglVertexAttrib4usvARBProcPtr bglVertexAttrib4usvARB; -typedef void (APIENTRY * bglVertexAttribPointerARBProcPtr)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -extern bglVertexAttribPointerARBProcPtr bglVertexAttribPointerARB; -typedef void (APIENTRY * bglEnableVertexAttribArrayARBProcPtr)(GLuint); -extern bglEnableVertexAttribArrayARBProcPtr bglEnableVertexAttribArrayARB; -typedef void (APIENTRY * bglDisableVertexAttribArrayARBProcPtr)(GLuint); -extern bglDisableVertexAttribArrayARBProcPtr bglDisableVertexAttribArrayARB; -typedef void (APIENTRY * bglGetVertexAttribdvARBProcPtr)(GLuint, GLenum, GLdouble *); -extern bglGetVertexAttribdvARBProcPtr bglGetVertexAttribdvARB; -typedef void (APIENTRY * bglGetVertexAttribfvARBProcPtr)(GLuint, GLenum, GLfloat *); -extern bglGetVertexAttribfvARBProcPtr bglGetVertexAttribfvARB; -typedef void (APIENTRY * bglGetVertexAttribivARBProcPtr)(GLuint, GLenum, GLint *); -extern bglGetVertexAttribivARBProcPtr bglGetVertexAttribivARB; -typedef void (APIENTRY * bglGetVertexAttribPointervARBProcPtr)(GLuint, GLenum, GLvoid* *); -extern bglGetVertexAttribPointervARBProcPtr bglGetVertexAttribPointervARB; -typedef void (APIENTRY * bglBindAttribLocationARBProcPtr)(GLhandleARB, GLuint, const GLcharARB *); -extern bglBindAttribLocationARBProcPtr bglBindAttribLocationARB; -typedef void (APIENTRY * bglGetActiveAttribARBProcPtr)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -extern bglGetActiveAttribARBProcPtr bglGetActiveAttribARB; -typedef GLint (APIENTRY * bglGetAttribLocationARBProcPtr)(GLhandleARB, const GLcharARB *); -extern bglGetAttribLocationARBProcPtr bglGetAttribLocationARB; - -// Debug Output -#ifndef __APPLE__ -typedef void (APIENTRY * bglDebugMessageControlARBProcPtr)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -extern bglDebugMessageControlARBProcPtr bglDebugMessageControlARB; -typedef void (APIENTRY * bglDebugMessageCallbackARBProcPtr)(GLDEBUGPROCARB callback, const GLvoid *userParam); -extern bglDebugMessageCallbackARBProcPtr bglDebugMessageCallbackARB; -#endif - -#ifdef _WIN32 -typedef BOOL (WINAPI * bwglSwapIntervalEXTProcPtr)(int32_t); -extern bwglSwapIntervalEXTProcPtr bwglSwapIntervalEXT; -typedef HGLRC (WINAPI * bwglCreateContextAttribsARBProcPtr)(HDC hDC, HGLRC hShareContext, const int *attribList); -extern bwglCreateContextAttribsARBProcPtr bwglCreateContextAttribsARB; -#endif - -#else - -#define bglBlendEquation glBlendEquation - -#define bglTexImage3D glTexImage3D -#define bglCompressedTexImage2DARB glCompressedTexImage2DARB -#define bglGetCompressedTexImageARB glGetCompressedTexImageARB - -// GPU Programs -#define bglGenProgramsARB glGenProgramsARB -#define bglBindProgramARB glBindProgramARB -#define bglProgramStringARB glProgramStringARB -#define bglDeleteProgramsARB glDeleteProgramsARB; - -// Multitexturing -#define bglActiveTextureARB glActiveTextureARB -#define bglClientActiveTextureARB glClientActiveTextureARB -#define bglMultiTexCoord2dARB glMultiTexCoord2dARB -#define bglMultiTexCoord2fARB glMultiTexCoord2fARB - -// Frame Buffer Objects -#define bglGenFramebuffersEXT glGenFramebuffersEXT -#define bglBindFramebufferEXT glBindFramebufferEXT -#define bglFramebufferTexture2DEXT glFramebufferTexture2DEXT -#define bglCheckFramebufferStatusEXT glCheckFramebufferStatusEXT -#define bglDeleteFramebuffersEXT glDeleteFramebuffersEXT - -// Vertex Buffer Objects -#define bglGenBuffersARB glGenBuffersARB -#define bglBindBufferARB glBindBufferARB -#define bglDeleteBuffersARB glDeleteBuffersARB -#define bglBufferDataARB glBufferDataARB -#define bglBufferSubDataARB glBufferSubDataARB -#define bglMapBufferARB glMapBufferARB -#define bglUnmapBufferARB glUnmapBufferARB - -// Occlusion queries -#define bglGenQueriesARB glGenQueriesARB -#define bglDeleteQueriesARB glDeleteQueriesARB -#define bglIsQueryARB glIsQueryARB -#define bglBeginQueryARB glBeginQueryARB -#define bglEndQueryARB glEndQueryARB -#define bglGetQueryivARB glGetQueryivARB -#define bglGetQueryObjectivARB glGetQueryObjectivARB -#define bglGetQueryObjectuivARB glGetQueryObjectuivARB - -// Shader Objects -#define bglDeleteObjectARB glDeleteObjectARB -#define bglGetHandleARB glGetHandleARB -#define bglDetachObjectARB glDetachObjectARB -#define bglCreateShaderObjectARB glCreateShaderObjectARB -#define bglShaderSourceARB glShaderSourceARB -#define bglCompileShaderARB glCompileShaderARB -#define bglCreateProgramObjectARB glCreateProgramObjectARB -#define bglAttachObjectARB glAttachObjectARB -#define bglLinkProgramARB glLinkProgramARB -#define bglUseProgramObjectARB glUseProgramObjectARB -#define bglValidateProgramARB glValidateProgramARB -#define bglUniform1fARB glUniform1fARB -#define bglUniform2fARB glUniform2fARB -#define bglUniform3fARB glUniform3fARB -#define bglUniform4fARB glUniform4fARB -#define bglUniform1iARB glUniform1iARB -#define bglUniform2iARB glUniform2iARB -#define bglUniform3iARB glUniform3iARB -#define bglUniform4iARB glUniform4iARB -#define bglUniform1fvARB glUniform1fvARB -#define bglUniform2fvARB glUniform2fvARB -#define bglUniform3fvARB glUniform3fvARB -#define bglUniform4fvARB glUniform4fvARB -#define bglUniform1ivARB glUniform1ivARB -#define bglUniform2ivARB glUniform2ivARB -#define bglUniform3ivARB glUniform3ivARB -#define bglUniform4ivARB glUniform4ivARB -#define bglUniformMatrix2fvARB glUniformMatrix2fvARB -#define bglUniformMatrix3fvARB glUniformMatrix3fvARB -#define bglUniformMatrix4fvARB glUniformMatrix4fvARB -#define bglGetObjectParameterfvARB glGetObjectParameterfvARB -#define bglGetObjectParameterivARB glGetObjectParameterivARB -#define bglGetInfoLogARB glGetInfoLogARB -#define bglGetAttachedObjectsARB glGetAttachedObjectsARB -#define bglGetUniformLocationARB glGetUniformLocationARB -#define bglGetActiveUniformARB glGetActiveUniformARB -#define bglGetUniformfvARB glGetUniformfvARB -#define bglGetUniformivARB glGetUniformivARB -#define bglGetShaderSourceARB glGetShaderSourceARB - -// Vertex Shaders -#define bglVertexAttrib1dARB glVertexAttrib1dARB -#define bglVertexAttrib1dvARB glVertexAttrib1dvARB -#define bglVertexAttrib1fARB glVertexAttrib1fARB -#define bglVertexAttrib1fvARB glVertexAttrib1fvARB -#define bglVertexAttrib1sARB glVertexAttrib1sARB -#define bglVertexAttrib1svARB glVertexAttrib1svARB -#define bglVertexAttrib2dARB glVertexAttrib2dARB -#define bglVertexAttrib2dvARB glVertexAttrib2dvARB -#define bglVertexAttrib2fARB glVertexAttrib2fARB -#define bglVertexAttrib2fvARB glVertexAttrib2fvARB -#define bglVertexAttrib2sARB glVertexAttrib2sARB -#define bglVertexAttrib2svARB glVertexAttrib2svARB -#define bglVertexAttrib3dARB glVertexAttrib3dARB -#define bglVertexAttrib3dvARB glVertexAttrib3dvARB -#define bglVertexAttrib3fARB glVertexAttrib3fARB -#define bglVertexAttrib3fvARB glVertexAttrib3fvARB -#define bglVertexAttrib3sARB glVertexAttrib3sARB -#define bglVertexAttrib3svARB glVertexAttrib3svARB -#define bglVertexAttrib4NbvARB glVertexAttrib4NbvARB -#define bglVertexAttrib4NivARB glVertexAttrib4NivARB -#define bglVertexAttrib4NsvARB glVertexAttrib4NsvARB -#define bglVertexAttrib4NubARB glVertexAttrib4NubARB -#define bglVertexAttrib4NubvARB glVertexAttrib4NubvARB -#define bglVertexAttrib4NuivARB glVertexAttrib4NuivARB -#define bglVertexAttrib4NusvARB glVertexAttrib4NusvARB -#define bglVertexAttrib4bvARB glVertexAttrib4bvARB -#define bglVertexAttrib4dARB glVertexAttrib4dARB -#define bglVertexAttrib4dvARB glVertexAttrib4dvARB -#define bglVertexAttrib4fARB glVertexAttrib4fARB -#define bglVertexAttrib4fvARB glVertexAttrib4fvARB -#define bglVertexAttrib4ivARB glVertexAttrib4ivARB -#define bglVertexAttrib4sARB glVertexAttrib4sARB -#define bglVertexAttrib4svARB glVertexAttrib4svARB -#define bglVertexAttrib4ubvARB glVertexAttrib4ubvARB -#define bglVertexAttrib4uivARB glVertexAttrib4uivARB -#define bglVertexAttrib4usvARB glVertexAttrib4usvARB -#define bglVertexAttribPointerARB glVertexAttribPointerARB -#define bglEnableVertexAttribArrayARB glEnableVertexAttribArrayARB -#define bglDisableVertexAttribArrayARB glDisableVertexAttribArrayARB -#define bglGetVertexAttribdvARB glGetVertexAttribdvARB -#define bglGetVertexAttribfvARB glGetVertexAttribfvARB -#define bglGetVertexAttribivARB glGetVertexAttribivARB -#define bglGetVertexAttribPointervARB glGetVertexAttribPointervARB -#define bglBindAttribLocationARB glBindAttribLocationARB -#define bglGetActiveAttribARB glGetActiveAttribARB -#define bglGetAttribLocationARB glGetAttribLocationARB - +#define wglSetPixelFormat bwglSetPixelFormat #endif #if defined DYNAMIC_GLU @@ -942,23 +136,22 @@ void texdbg_bglDeleteTextures(GLsizei n, const GLuint *textures, const char *src //#define DEBUG_TEXTURE_NAMES #if defined DEBUGGINGAIDS && defined DEBUG_TEXTURE_NAMES -# undef bglGenTextures -# undef bglDeleteTextures -# define bglGenTextures(numtexs, texnamear) texdbg_bglGenTextures(numtexs, texnamear, __FILE__) -# define bglDeleteTextures(numtexs, texnamear) texdbg_bglDeleteTextures(numtexs, texnamear, __FILE__) +# define glGenTextures(numtexs, texnamear) texdbg_bglGenTextures(numtexs, texnamear, __FILE__) +# define glDeleteTextures(numtexs, texnamear) texdbg_bglDeleteTextures(numtexs, texnamear, __FILE__) #endif #endif //USE_OPENGL -#ifdef _WIN32 +#if !defined RENDERTYPESDL && defined _WIN32 && defined DYNAMIC_GL extern char *gldriver; + +int32_t loadwgl(const char *driver); +int32_t unloadwgl(void); #endif -int32_t loadgldriver(const char *driver); -int32_t loadglextensions(void); -int32_t unloadgldriver(void); - +#ifdef POLYMER int32_t loadglulibrary(const char *driver); int32_t unloadglulibrary(void); +#endif #endif diff --git a/source/build/include/polymer.h b/source/build/include/polymer.h index 1ec53fc37..f713290ce 100644 --- a/source/build/include/polymer.h +++ b/source/build/include/polymer.h @@ -5,8 +5,9 @@ # include "compat.h" # include "baselayer.h" -# include "glbuild.h" +# include "glad/glad.h" # include "build.h" +# include "glbuild.h" # include "osd.h" # include "hightile.h" # include "mdsprite.h" @@ -124,7 +125,7 @@ typedef struct s_prmaterial { } _prmaterial; typedef struct s_prrograminfo { - GLhandleARB handle; + GLuint handle; // PR_BIT_ANIM_INTERPOLATION GLint attrib_nextFrameData; GLint attrib_nextFrameNormal; @@ -379,7 +380,7 @@ static inline void polymer_invalidateartmap(int32_t tilenum) { if (prartmaps[tilenum]) { - bglDeleteTextures(1, &prartmaps[tilenum]); + glDeleteTextures(1, &prartmaps[tilenum]); prartmaps[tilenum] = 0; } } @@ -458,7 +459,7 @@ void PR_CALLBACK polymer_debugoutputcallback(GLenum source,GLenum type,GLuint #define INDICE(n) ((p->indices) ? (p->indices[(i+n)%p->indicescount]) : (((i+n)%p->vertcount))) -#define SWITCH_CULL_DIRECTION { culledface = (culledface == GL_FRONT) ? GL_BACK : GL_FRONT; bglCullFace(culledface); } +#define SWITCH_CULL_DIRECTION { culledface = (culledface == GL_FRONT) ? GL_BACK : GL_FRONT; glCullFace(culledface); } static inline GLfloat dot2f(GLfloat *v1, GLfloat *v2) { diff --git a/source/build/include/polymost.h b/source/build/include/polymost.h index c08e363d2..232c15c82 100644 --- a/source/build/include/polymost.h +++ b/source/build/include/polymost.h @@ -3,7 +3,7 @@ #ifdef USE_OPENGL -#include "glbuild.h" +#include "glad/glad.h" #include "hightile.h" #include "baselayer.h" // glinfo diff --git a/source/build/src/2d.cpp b/source/build/src/2d.cpp index fd23f8844..53c70c4c8 100644 --- a/source/build/src/2d.cpp +++ b/source/build/src/2d.cpp @@ -54,9 +54,9 @@ void plotpixel(int32_t x, int32_t y, char col) { palette_t p = getpal(col); - bglRasterPos4i(x, y, 0, 1); - bglDrawPixels(1, 1, GL_RGB, GL_UNSIGNED_BYTE, &p); - bglRasterPos4i(0, 0, 0, 1); + glRasterPos4i(x, y, 0, 1); + glDrawPixels(1, 1, GL_RGB, GL_UNSIGNED_BYTE, &p); + glRasterPos4i(0, 0, 0, 1); return; } #endif @@ -75,14 +75,14 @@ void plotlines2d(const int32_t *xx, const int32_t *yy, int32_t numpoints, int co { palette_t p = getpal(col); - bglBegin(GL_LINE_STRIP); + glBegin(GL_LINE_STRIP); - bglColor4ub(p.r, p.g, p.b, 1); + glColor4ub(p.r, p.g, p.b, 1); for (i=0; iwidth,codec->height, + glTexImage2D(GL_TEXTURE_2D, 0, fmt, codec->width,codec->height, 0, fmt, GL_UNSIGNED_BYTE, codec->pic); - if (bglGetError() != GL_NO_ERROR) return 1; + if (glGetError() != GL_NO_ERROR) return 1; texuploaded = 1; } else { - bglTexSubImage2D(GL_TEXTURE_2D, 0, 0,0, codec->width,codec->height, + glTexSubImage2D(GL_TEXTURE_2D, 0, 0,0, codec->width,codec->height, fmt, GL_UNSIGNED_BYTE, codec->pic); - if (bglGetError() != GL_NO_ERROR) return 1; + if (glGetError() != GL_NO_ERROR) return 1; } float vid_wbyh = ((float)codec->width)/codec->height; @@ -543,24 +543,24 @@ int32_t animvpx_render_frame(animvpx_codec_ctx *codec, double animvpx_aspect) y = scr_wbyh/vid_wbyh; } #endif - bglBegin(GL_QUADS); + glBegin(GL_QUADS); if (!glinfo.glsl) - bglColor3f(1.0, 1.0, 1.0); + glColor3f(1.0, 1.0, 1.0); - bglTexCoord2f(0.0,1.0); - bglVertex3f(-x, -y, 0.0); + glTexCoord2f(0.0,1.0); + glVertex3f(-x, -y, 0.0); - bglTexCoord2f(0.0,0.0); - bglVertex3f(-x, y, 0.0); + glTexCoord2f(0.0,0.0); + glVertex3f(-x, y, 0.0); - bglTexCoord2f(1.0,0.0); - bglVertex3f(x, y, 0.0); + glTexCoord2f(1.0,0.0); + glVertex3f(x, y, 0.0); - bglTexCoord2f(1.0,1.0); - bglVertex3f(x, -y, 0.0); + glTexCoord2f(1.0,1.0); + glVertex3f(x, -y, 0.0); - bglEnd(); + glEnd(); t = getticks()-t; codec->sumtimes[2] += t; diff --git a/source/build/src/baselayer.cpp b/source/build/src/baselayer.cpp index cf8cbcd6a..b0a2c6224 100644 --- a/source/build/src/baselayer.cpp +++ b/source/build/src/baselayer.cpp @@ -255,31 +255,31 @@ extern int32_t nofog; void fullscreen_tint_gl(uint8_t r, uint8_t g, uint8_t b, uint8_t f) { - bglMatrixMode(GL_PROJECTION); - bglPushMatrix(); - bglLoadIdentity(); - bglMatrixMode(GL_MODELVIEW); - bglPushMatrix(); - bglLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); - bglDisable(GL_DEPTH_TEST); - bglDisable(GL_ALPHA_TEST); - bglDisable(GL_TEXTURE_2D); - bglDisable(GL_FOG); + glDisable(GL_DEPTH_TEST); + glDisable(GL_ALPHA_TEST); + glDisable(GL_TEXTURE_2D); + glDisable(GL_FOG); - bglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - bglEnable(GL_BLEND); - bglColor4ub(r, g, b, f); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glColor4ub(r, g, b, f); - bglBegin(GL_TRIANGLES); - bglVertex2f(-2.5f, 1.f); - bglVertex2f(2.5f, 1.f); - bglVertex2f(.0f, -2.5f); - bglEnd(); + glBegin(GL_TRIANGLES); + glVertex2f(-2.5f, 1.f); + glVertex2f(2.5f, 1.f); + glVertex2f(.0f, -2.5f); + glEnd(); - bglPopMatrix(); - bglMatrixMode(GL_PROJECTION); - bglPopMatrix(); + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); } struct glinfo_t glinfo = diff --git a/source/build/src/common.cpp b/source/build/src/common.cpp index e2e2838e4..82def804b 100644 --- a/source/build/src/common.cpp +++ b/source/build/src/common.cpp @@ -252,18 +252,18 @@ void COMMON_clearbackground(int32_t numcols, int32_t numrows) # ifdef USE_OPENGL if (getrendermode() >= REND_POLYMOST && qsetmode==200) { -// bglPushAttrib(GL_FOG_BIT); - bglDisable(GL_FOG); +// glPushAttrib(GL_FOG_BIT); + glDisable(GL_FOG); setpolymost2dview(); - bglColor4f(0.f, 0.f, 0.f, 0.67f); - bglEnable(GL_BLEND); - bglRecti(0, 0, xdim, 8*numrows+8); - bglColor4f(0.f, 0.f, 0.f, 1.f); - bglRecti(0, 8*numrows+4, xdim, 8*numrows+8); + glColor4f(0.f, 0.f, 0.f, 0.67f); + glEnable(GL_BLEND); + glRecti(0, 0, xdim, 8*numrows+8); + glColor4f(0.f, 0.f, 0.f, 1.f); + glRecti(0, 8*numrows+4, xdim, 8*numrows+8); -// bglPopAttrib(); - bglEnable(GL_FOG); +// glPopAttrib(); + glEnable(GL_FOG); return; } diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index c17365449..061c6a188 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -22,7 +22,7 @@ #include "scriptfile.h" #ifdef USE_OPENGL -# include "glbuild.h" +# include "glad/glad.h" # include "mdsprite.h" # ifdef POLYMER # include "polymer.h" @@ -1028,7 +1028,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), #ifdef USE_OPENGL else { - bglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); } #endif } @@ -5800,17 +5800,17 @@ static void drawsprite(int32_t snum) #ifdef USE_OPENGL case REND_POLYMOST: polymost_drawsprite(snum); - bglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - bglDepthFunc(GL_LESS); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS -// bglDepthRange(0.0, 1.0); //<- this is more widely supported than glPolygonOffset + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDepthFunc(GL_LESS); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS +// glDepthRange(0.0, 1.0); //<- this is more widely supported than glPolygonOffset return; # ifdef POLYMER case REND_POLYMER: - bglEnable(GL_ALPHA_TEST); - bglEnable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + glEnable(GL_BLEND); polymer_drawsprite(snum); - bglDisable(GL_BLEND); - bglDisable(GL_ALPHA_TEST); + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); return; # endif #endif @@ -5829,13 +5829,13 @@ static void drawmaskwall(int16_t damaskwallcnt) # ifdef POLYMER if (getrendermode() == REND_POLYMER) { - bglEnable(GL_ALPHA_TEST); - bglEnable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + glEnable(GL_BLEND); polymer_drawmaskwall(damaskwallcnt); - bglDisable(GL_BLEND); - bglDisable(GL_ALPHA_TEST); + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); return; } @@ -8013,7 +8013,7 @@ int32_t drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, # endif polymer_glinit(); polymer_drawrooms(daposx, daposy, daposz, daang, dahoriz, dacursectnum); - bglDisable(GL_CULL_FACE); + glDisable(GL_CULL_FACE); gloy1 = 0; return 0; } @@ -8592,7 +8592,7 @@ killsprite: #ifdef USE_OPENGL if (getrendermode() == REND_POLYMOST) { - bglDepthMask(GL_FALSE); + glDepthMask(GL_FALSE); while (spritesortcnt) { @@ -8605,7 +8605,7 @@ killsprite: } } - bglDepthMask(GL_TRUE); + glDepthMask(GL_TRUE); } #endif spritesortcnt = 0; @@ -12215,11 +12215,11 @@ void clearview(int32_t dacol) { palette_t const p = getpal(dacol); - bglClearColor((float)p.r * (1.f/255.f), + glClearColor((float)p.r * (1.f/255.f), (float)p.g * (1.f/255.f), (float)p.b * (1.f/255.f), 0); - bglClear(GL_COLOR_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT); return; } #endif @@ -12253,12 +12253,12 @@ void clearallviews(int32_t dacol) { palette_t const p = getpal(dacol); - bglViewport(0,0,xdim,ydim); glox1 = -1; - bglClearColor((float)p.r * (1.f/255.f), + glViewport(0,0,xdim,ydim); glox1 = -1; + glClearColor((float)p.r * (1.f/255.f), (float)p.g * (1.f/255.f), (float)p.b * (1.f/255.f), 0); - bglClear(GL_COLOR_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT); return; } #endif @@ -12947,10 +12947,10 @@ void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const palette_t p=getpal(col), b=getpal(backcol); setpolymost2dview(); - bglDisable(GL_ALPHA_TEST); - bglDepthMask(GL_FALSE); // disable writing to the z-buffer + glDisable(GL_ALPHA_TEST); + glDepthMask(GL_FALSE); // disable writing to the z-buffer - bglBegin(GL_POINTS); + glBegin(GL_POINTS); for (i=0; name[i]; i++) { @@ -12983,16 +12983,16 @@ void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const if (letptr[y]&pow2char[7-fontsize-x]) { if (lc!=col) - bglColor4ub(p.r,p.g,p.b,255); + glColor4ub(p.r,p.g,p.b,255); lc = col; - bglVertex2i(xx+x,yy); + glVertex2i(xx+x,yy); } else if (backcol >= 0) { if (lc!=backcol) - bglColor4ub(b.r,b.g,b.b,255); + glColor4ub(b.r,b.g,b.b,255); lc = backcol; - bglVertex2i(xx+x,yy); + glVertex2i(xx+x,yy); } } yy--; @@ -13000,8 +13000,8 @@ void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const stx += charxsiz; } - bglEnd(); - bglDepthMask(GL_TRUE); // re-enable writing to the z-buffer + glEnd(); + glDepthMask(GL_TRUE); // re-enable writing to the z-buffer return; } diff --git a/source/build/src/glbuild.cpp b/source/build/src/glbuild.cpp index 935a35758..6c75d4a3b 100644 --- a/source/build/src/glbuild.cpp +++ b/source/build/src/glbuild.cpp @@ -1,4 +1,5 @@ #include "compat.h" +#include "glad/glad.h" #include "glbuild.h" #include "baselayer.h" @@ -12,7 +13,7 @@ GLenum BuildGLError; void BuildGLErrorCheck(void) { volatile GLenum err; - while ((err = bglGetError()) != GL_NO_ERROR) + while ((err = glGetError()) != GL_NO_ERROR) { BuildGLError = err; // set a watchpoint/breakpoint here } @@ -20,286 +21,18 @@ void BuildGLErrorCheck(void) #if defined DYNAMIC_GL -#ifdef _WIN32 +#if !defined RENDERTYPESDL && defined _WIN32 bwglCreateContextProcPtr bwglCreateContext; bwglDeleteContextProcPtr bwglDeleteContext; bwglGetProcAddressProcPtr bwglGetProcAddress; bwglMakeCurrentProcPtr bwglMakeCurrent; -bwglSwapBuffersProcPtr bwglSwapBuffers; bwglChoosePixelFormatProcPtr bwglChoosePixelFormat; bwglDescribePixelFormatProcPtr bwglDescribePixelFormat; bwglGetPixelFormatProcPtr bwglGetPixelFormat; bwglSetPixelFormatProcPtr bwglSetPixelFormat; #endif -bglClearColorProcPtr bglClearColor; -bglClearProcPtr bglClear; -bglColorMaskProcPtr bglColorMask; -bglAlphaFuncProcPtr bglAlphaFunc; -bglBlendFuncProcPtr bglBlendFunc; -bglCullFaceProcPtr bglCullFace; -bglFrontFaceProcPtr bglFrontFace; -bglPolygonOffsetProcPtr bglPolygonOffset; -bglPolygonModeProcPtr bglPolygonMode; -bglEnableProcPtr bglEnable; -bglDisableProcPtr bglDisable; -bglGetDoublevProcPtr bglGetDoublev; -bglGetFloatvProcPtr bglGetFloatv; -bglGetIntegervProcPtr bglGetIntegerv; -bglPushAttribProcPtr bglPushAttrib; -bglPopAttribProcPtr bglPopAttrib; -bglGetErrorProcPtr bglGetError; -bglGetStringProcPtr bglGetString; -bglHintProcPtr bglHint; -bglDrawBufferProcPtr bglDrawBuffer; -bglReadBufferProcPtr bglReadBuffer; -bglScissorProcPtr bglScissor; -bglClipPlaneProcPtr bglClipPlane; - -// Depth -bglDepthFuncProcPtr bglDepthFunc; -bglDepthMaskProcPtr bglDepthMask; -//bglDepthRangeProcPtr bglDepthRange; - -// Matrix -bglMatrixModeProcPtr bglMatrixMode; -bglOrthoProcPtr bglOrtho; -bglFrustumProcPtr bglFrustum; -bglViewportProcPtr bglViewport; -bglPushMatrixProcPtr bglPushMatrix; -bglPopMatrixProcPtr bglPopMatrix; -bglLoadIdentityProcPtr bglLoadIdentity; -bglLoadMatrixfProcPtr bglLoadMatrixf; -bglLoadMatrixdProcPtr bglLoadMatrixd; -bglMultMatrixfProcPtr bglMultMatrixf; -bglMultMatrixdProcPtr bglMultMatrixd; -bglRotatefProcPtr bglRotatef; -bglScalefProcPtr bglScalef; -bglTranslatefProcPtr bglTranslatef; - -// Drawing -bglBeginProcPtr bglBegin; -bglEndProcPtr bglEnd; -bglVertex2fProcPtr bglVertex2f; -bglVertex2iProcPtr bglVertex2i; -bglVertex3fProcPtr bglVertex3f; -bglVertex3dProcPtr bglVertex3d; -bglVertex3fvProcPtr bglVertex3fv; -bglVertex3dvProcPtr bglVertex3dv; -bglRectiProcPtr bglRecti; -bglColor3fProcPtr bglColor3f; -bglColor4fProcPtr bglColor4f; -bglColor4ubProcPtr bglColor4ub; -bglTexCoord2dProcPtr bglTexCoord2d; -bglTexCoord2fProcPtr bglTexCoord2f; -bglTexCoord2iProcPtr bglTexCoord2i; -bglNormal3fProcPtr bglNormal3f; - -// Lighting -bglShadeModelProcPtr bglShadeModel; -bglLightfvProcPtr bglLightfv; - -// Raster funcs -bglReadPixelsProcPtr bglReadPixels; -bglRasterPos4iProcPtr bglRasterPos4i; -bglDrawPixelsProcPtr bglDrawPixels; -bglPixelStoreiProcPtr bglPixelStorei; - -// Texture mapping -bglTexEnvfProcPtr bglTexEnvf; -bglGenTexturesProcPtr bglGenTextures; -bglDeleteTexturesProcPtr bglDeleteTextures; -bglBindTextureProcPtr bglBindTexture; -bglTexImage2DProcPtr bglTexImage2D; -bglCopyTexImage2DProcPtr bglCopyTexImage2D; -bglCopyTexSubImage2DProcPtr bglCopyTexSubImage2D; -bglTexSubImage2DProcPtr bglTexSubImage2D; -bglTexParameterfProcPtr bglTexParameterf; -bglTexParameteriProcPtr bglTexParameteri; -bglGetTexParameterivProcPtr bglGetTexParameteriv; -bglGetTexLevelParameterivProcPtr bglGetTexLevelParameteriv; -bglTexGenfvProcPtr bglTexGenfv; - -// Fog -bglFogfProcPtr bglFogf; -bglFogiProcPtr bglFogi; -bglFogfvProcPtr bglFogfv; - -// Display Lists -bglNewListProcPtr bglNewList; -bglEndListProcPtr bglEndList; -bglCallListProcPtr bglCallList; -bglDeleteListsProcPtr bglDeleteLists; - -// Vertex Arrays -bglEnableClientStateProcPtr bglEnableClientState; -bglDisableClientStateProcPtr bglDisableClientState; -bglVertexPointerProcPtr bglVertexPointer; -bglNormalPointerProcPtr bglNormalPointer; -bglTexCoordPointerProcPtr bglTexCoordPointer; -bglDrawArraysProcPtr bglDrawArrays; -bglDrawElementsProcPtr bglDrawElements; - -// Stencil Buffer -bglClearStencilProcPtr bglClearStencil; -bglStencilOpProcPtr bglStencilOp; -bglStencilFuncProcPtr bglStencilFunc; - -#endif - -#if defined DYNAMIC_GLEXT - -bglBlendEquationProcPtr bglBlendEquation; - -bglTexImage3DProcPtr bglTexImage3D; -bglCompressedTexImage2DARBProcPtr bglCompressedTexImage2DARB; -bglGetCompressedTexImageARBProcPtr bglGetCompressedTexImageARB; - -// GPU Programs -bglGenProgramsARBProcPtr bglGenProgramsARB; -bglBindProgramARBProcPtr bglBindProgramARB; -bglProgramStringARBProcPtr bglProgramStringARB; -bglDeleteProgramsARBProcPtr bglDeleteProgramsARB; - -// Multitexturing -bglActiveTextureARBProcPtr bglActiveTextureARB; -bglClientActiveTextureARBProcPtr bglClientActiveTextureARB; -bglMultiTexCoord2dARBProcPtr bglMultiTexCoord2dARB; -bglMultiTexCoord2fARBProcPtr bglMultiTexCoord2fARB; - -// Frame Buffer Objects -bglGenFramebuffersEXTProcPtr bglGenFramebuffersEXT; -bglBindFramebufferEXTProcPtr bglBindFramebufferEXT; -bglFramebufferTexture2DEXTProcPtr bglFramebufferTexture2DEXT; -bglCheckFramebufferStatusEXTProcPtr bglCheckFramebufferStatusEXT; -bglDeleteFramebuffersEXTProcPtr bglDeleteFramebuffersEXT; - -// Vertex Buffer Objects -bglGenBuffersARBProcPtr bglGenBuffersARB; -bglBindBufferARBProcPtr bglBindBufferARB; -bglDeleteBuffersARBProcPtr bglDeleteBuffersARB; -bglBufferDataARBProcPtr bglBufferDataARB; -bglBufferSubDataARBProcPtr bglBufferSubDataARB; -bglMapBufferARBProcPtr bglMapBufferARB; -bglUnmapBufferARBProcPtr bglUnmapBufferARB; - -// ARB_buffer_storage -bglBufferStorageProcPtr bglBufferStorage; - -// ARB_map_buffer_range -bglMapBufferRangeProcPtr bglMapBufferRange; - -// Occlusion queries -bglGenQueriesARBProcPtr bglGenQueriesARB; -bglDeleteQueriesARBProcPtr bglDeleteQueriesARB; -bglIsQueryARBProcPtr bglIsQueryARB; -bglBeginQueryARBProcPtr bglBeginQueryARB; -bglEndQueryARBProcPtr bglEndQueryARB; -bglGetQueryivARBProcPtr bglGetQueryivARB; -bglGetQueryObjectivARBProcPtr bglGetQueryObjectivARB; -bglGetQueryObjectuivARBProcPtr bglGetQueryObjectuivARB; - -// Shader Objects -bglDeleteObjectARBProcPtr bglDeleteObjectARB; -bglGetHandleARBProcPtr bglGetHandleARB; -bglDetachObjectARBProcPtr bglDetachObjectARB; -bglCreateShaderObjectARBProcPtr bglCreateShaderObjectARB; -bglShaderSourceARBProcPtr bglShaderSourceARB; -bglCompileShaderARBProcPtr bglCompileShaderARB; -bglCreateProgramObjectARBProcPtr bglCreateProgramObjectARB; -bglAttachObjectARBProcPtr bglAttachObjectARB; -bglLinkProgramARBProcPtr bglLinkProgramARB; -bglUseProgramObjectARBProcPtr bglUseProgramObjectARB; -bglValidateProgramARBProcPtr bglValidateProgramARB; -bglUniform1fARBProcPtr bglUniform1fARB; -bglUniform2fARBProcPtr bglUniform2fARB; -bglUniform3fARBProcPtr bglUniform3fARB; -bglUniform4fARBProcPtr bglUniform4fARB; -bglUniform1iARBProcPtr bglUniform1iARB; -bglUniform2iARBProcPtr bglUniform2iARB; -bglUniform3iARBProcPtr bglUniform3iARB; -bglUniform4iARBProcPtr bglUniform4iARB; -bglUniform1fvARBProcPtr bglUniform1fvARB; -bglUniform2fvARBProcPtr bglUniform2fvARB; -bglUniform3fvARBProcPtr bglUniform3fvARB; -bglUniform4fvARBProcPtr bglUniform4fvARB; -bglUniform1ivARBProcPtr bglUniform1ivARB; -bglUniform2ivARBProcPtr bglUniform2ivARB; -bglUniform3ivARBProcPtr bglUniform3ivARB; -bglUniform4ivARBProcPtr bglUniform4ivARB; -bglUniformMatrix2fvARBProcPtr bglUniformMatrix2fvARB; -bglUniformMatrix3fvARBProcPtr bglUniformMatrix3fvARB; -bglUniformMatrix4fvARBProcPtr bglUniformMatrix4fvARB; -bglGetObjectParameterfvARBProcPtr bglGetObjectParameterfvARB; -bglGetObjectParameterivARBProcPtr bglGetObjectParameterivARB; -bglGetInfoLogARBProcPtr bglGetInfoLogARB; -bglGetAttachedObjectsARBProcPtr bglGetAttachedObjectsARB; -bglGetUniformLocationARBProcPtr bglGetUniformLocationARB; -bglGetActiveUniformARBProcPtr bglGetActiveUniformARB; -bglGetUniformfvARBProcPtr bglGetUniformfvARB; -bglGetUniformivARBProcPtr bglGetUniformivARB; -bglGetShaderSourceARBProcPtr bglGetShaderSourceARB; - -// Vertex Shaders -bglVertexAttrib1dARBProcPtr bglVertexAttrib1dARB; -bglVertexAttrib1dvARBProcPtr bglVertexAttrib1dvARB; -bglVertexAttrib1fARBProcPtr bglVertexAttrib1fARB; -bglVertexAttrib1fvARBProcPtr bglVertexAttrib1fvARB; -bglVertexAttrib1sARBProcPtr bglVertexAttrib1sARB; -bglVertexAttrib1svARBProcPtr bglVertexAttrib1svARB; -bglVertexAttrib2dARBProcPtr bglVertexAttrib2dARB; -bglVertexAttrib2dvARBProcPtr bglVertexAttrib2dvARB; -bglVertexAttrib2fARBProcPtr bglVertexAttrib2fARB; -bglVertexAttrib2fvARBProcPtr bglVertexAttrib2fvARB; -bglVertexAttrib2sARBProcPtr bglVertexAttrib2sARB; -bglVertexAttrib2svARBProcPtr bglVertexAttrib2svARB; -bglVertexAttrib3dARBProcPtr bglVertexAttrib3dARB; -bglVertexAttrib3dvARBProcPtr bglVertexAttrib3dvARB; -bglVertexAttrib3fARBProcPtr bglVertexAttrib3fARB; -bglVertexAttrib3fvARBProcPtr bglVertexAttrib3fvARB; -bglVertexAttrib3sARBProcPtr bglVertexAttrib3sARB; -bglVertexAttrib3svARBProcPtr bglVertexAttrib3svARB; -bglVertexAttrib4NbvARBProcPtr bglVertexAttrib4NbvARB; -bglVertexAttrib4NivARBProcPtr bglVertexAttrib4NivARB; -bglVertexAttrib4NsvARBProcPtr bglVertexAttrib4NsvARB; -bglVertexAttrib4NubARBProcPtr bglVertexAttrib4NubARB; -bglVertexAttrib4NubvARBProcPtr bglVertexAttrib4NubvARB; -bglVertexAttrib4NuivARBProcPtr bglVertexAttrib4NuivARB; -bglVertexAttrib4NusvARBProcPtr bglVertexAttrib4NusvARB; -bglVertexAttrib4bvARBProcPtr bglVertexAttrib4bvARB; -bglVertexAttrib4dARBProcPtr bglVertexAttrib4dARB; -bglVertexAttrib4dvARBProcPtr bglVertexAttrib4dvARB; -bglVertexAttrib4fARBProcPtr bglVertexAttrib4fARB; -bglVertexAttrib4fvARBProcPtr bglVertexAttrib4fvARB; -bglVertexAttrib4ivARBProcPtr bglVertexAttrib4ivARB; -bglVertexAttrib4sARBProcPtr bglVertexAttrib4sARB; -bglVertexAttrib4svARBProcPtr bglVertexAttrib4svARB; -bglVertexAttrib4ubvARBProcPtr bglVertexAttrib4ubvARB; -bglVertexAttrib4uivARBProcPtr bglVertexAttrib4uivARB; -bglVertexAttrib4usvARBProcPtr bglVertexAttrib4usvARB; -bglVertexAttribPointerARBProcPtr bglVertexAttribPointerARB; -bglEnableVertexAttribArrayARBProcPtr bglEnableVertexAttribArrayARB; -bglDisableVertexAttribArrayARBProcPtr bglDisableVertexAttribArrayARB; -bglGetVertexAttribdvARBProcPtr bglGetVertexAttribdvARB; -bglGetVertexAttribfvARBProcPtr bglGetVertexAttribfvARB; -bglGetVertexAttribivARBProcPtr bglGetVertexAttribivARB; -bglGetVertexAttribPointervARBProcPtr bglGetVertexAttribPointervARB; -bglBindAttribLocationARBProcPtr bglBindAttribLocationARB; -bglGetActiveAttribARBProcPtr bglGetActiveAttribARB; -bglGetAttribLocationARBProcPtr bglGetAttribLocationARB; - -// Debug Output -#ifndef __APPLE__ -bglDebugMessageControlARBProcPtr bglDebugMessageControlARB; -bglDebugMessageCallbackARBProcPtr bglDebugMessageCallbackARB; -#endif - -#ifdef _WIN32 -bwglSwapIntervalEXTProcPtr bwglSwapIntervalEXT; -bwglCreateContextAttribsARBProcPtr bwglCreateContextAttribsARB; -#endif - #endif #if defined DYNAMIC_GLU @@ -325,7 +58,6 @@ bgluUnProjectProcPtr bgluUnProject; #endif - #if defined DYNAMIC_GL || defined DYNAMIC_GLEXT || defined DYNAMIC_GLU # if !defined _WIN32 # include @@ -336,7 +68,6 @@ bgluUnProjectProcPtr bgluUnProject; #if !defined RENDERTYPESDL && defined _WIN32 static HMODULE hGLDLL; -#endif char *gldriver = NULL; @@ -360,665 +91,63 @@ static void *getproc_(const char *s, int32_t *err, int32_t fatal, int32_t extens return t; } #define GETPROC(s) getproc_(s,&err,1,0) -#define GETPROCSOFT(s) getproc_(s,&err,0,0) -#define GETPROCEXT(s) getproc_(s,&err,1,1) -#define GETPROCEXTSOFT(s) getproc_(s,&err,0,1) -#endif - -int32_t loadgldriver(const char *driver) +int32_t loadwgl(const char *driver) { -#if defined EDUKE32_GLES - jwzgles_reset(); -#endif - -#if defined DYNAMIC_GL || defined DYNAMIC_GLEXT int32_t err=0; -#if !defined RENDERTYPESDL && defined _WIN32 if (hGLDLL) return 0; -#endif if (!driver) { -#ifdef _WIN32 driver = "opengl32.dll"; -#elif defined EDUKE32_OSX - driver = "/System/Library/Frameworks/OpenGL.framework/OpenGL"; -#elif defined __OpenBSD__ - driver = "libGL.so"; -#else - driver = "libGL.so.1"; -#endif } -#if defined RENDERTYPESDL && !defined EDUKE32_IOS - if (SDL_GL_LoadLibrary(driver)) - { - initprintf("Failed loading \"%s\": %s\n", driver, SDL_GetError()); - return -1; - } -#elif defined _WIN32 hGLDLL = LoadLibrary(driver); if (!hGLDLL) { initprintf("Failed loading \"%s\"\n", driver); return -1; } -#endif + gldriver = Bstrdup(driver); -#endif -#if defined DYNAMIC_GL -#ifdef _WIN32 bwglCreateContext = (bwglCreateContextProcPtr) GETPROC("wglCreateContext"); bwglDeleteContext = (bwglDeleteContextProcPtr) GETPROC("wglDeleteContext"); bwglGetProcAddress = (bwglGetProcAddressProcPtr) GETPROC("wglGetProcAddress"); bwglMakeCurrent = (bwglMakeCurrentProcPtr) GETPROC("wglMakeCurrent"); - - bwglSwapBuffers = (bwglSwapBuffersProcPtr) GETPROC("wglSwapBuffers"); + bwglChoosePixelFormat = (bwglChoosePixelFormatProcPtr) GETPROC("wglChoosePixelFormat"); bwglDescribePixelFormat = (bwglDescribePixelFormatProcPtr) GETPROC("wglDescribePixelFormat"); bwglGetPixelFormat = (bwglGetPixelFormatProcPtr) GETPROC("wglGetPixelFormat"); bwglSetPixelFormat = (bwglSetPixelFormatProcPtr) GETPROC("wglSetPixelFormat"); -#endif - - bglClearColor = (bglClearColorProcPtr) GETPROC("glClearColor"); - bglClear = (bglClearProcPtr) GETPROC("glClear"); - bglColorMask = (bglColorMaskProcPtr) GETPROC("glColorMask"); - bglAlphaFunc = (bglAlphaFuncProcPtr) GETPROC("glAlphaFunc"); - bglBlendFunc = (bglBlendFuncProcPtr) GETPROC("glBlendFunc"); - bglCullFace = (bglCullFaceProcPtr) GETPROC("glCullFace"); - bglFrontFace = (bglFrontFaceProcPtr) GETPROC("glFrontFace"); - bglPolygonOffset = (bglPolygonOffsetProcPtr) GETPROC("glPolygonOffset"); - bglPolygonMode = (bglPolygonModeProcPtr) GETPROC("glPolygonMode"); - bglEnable = (bglEnableProcPtr) GETPROC("glEnable"); - bglDisable = (bglDisableProcPtr) GETPROC("glDisable"); - bglGetDoublev = (bglGetDoublevProcPtr) GETPROC("glGetDoublev"); - bglGetFloatv = (bglGetFloatvProcPtr) GETPROC("glGetFloatv"); - bglGetIntegerv = (bglGetIntegervProcPtr) GETPROC("glGetIntegerv"); - bglPushAttrib = (bglPushAttribProcPtr) GETPROC("glPushAttrib"); - bglPopAttrib = (bglPopAttribProcPtr) GETPROC("glPopAttrib"); - bglGetError = (bglGetErrorProcPtr) GETPROC("glGetError"); - bglGetString = (bglGetStringProcPtr) GETPROC("glGetString"); - bglHint = (bglHintProcPtr) GETPROC("glHint"); - bglDrawBuffer = (bglDrawBufferProcPtr) GETPROC("glDrawBuffer"); - bglReadBuffer = (bglReadBufferProcPtr) GETPROC("glDrawBuffer"); - bglScissor = (bglScissorProcPtr) GETPROC("glScissor"); - bglClipPlane = (bglClipPlaneProcPtr) GETPROC("glClipPlane"); - - // Depth - bglDepthFunc = (bglDepthFuncProcPtr) GETPROC("glDepthFunc"); - bglDepthMask = (bglDepthMaskProcPtr) GETPROC("glDepthMask"); -// bglDepthRange = (bglDepthRangeProcPtr) GETPROC("glDepthRange"); - - // Matrix - bglMatrixMode = (bglMatrixModeProcPtr) GETPROC("glMatrixMode"); - bglOrtho = (bglOrthoProcPtr) GETPROC("glOrtho"); - bglFrustum = (bglFrustumProcPtr) GETPROC("glFrustum"); - bglViewport = (bglViewportProcPtr) GETPROC("glViewport"); - bglPushMatrix = (bglPushMatrixProcPtr) GETPROC("glPushMatrix"); - bglPopMatrix = (bglPopMatrixProcPtr) GETPROC("glPopMatrix"); - bglLoadIdentity = (bglLoadIdentityProcPtr) GETPROC("glLoadIdentity"); - bglLoadMatrixf = (bglLoadMatrixfProcPtr) GETPROC("glLoadMatrixf"); - bglLoadMatrixd = (bglLoadMatrixdProcPtr) GETPROC("glLoadMatrixd"); - bglMultMatrixf = (bglMultMatrixfProcPtr) GETPROC("glMultMatrixf"); - bglMultMatrixd = (bglMultMatrixdProcPtr) GETPROC("glMultMatrixd"); - bglRotatef = (bglRotatefProcPtr) GETPROC("glRotatef"); - bglScalef = (bglScalefProcPtr) GETPROC("glScalef"); - bglTranslatef = (bglTranslatefProcPtr) GETPROC("glTranslatef"); - - // Drawing - bglBegin = (bglBeginProcPtr) GETPROC("glBegin"); - bglEnd = (bglEndProcPtr) GETPROC("glEnd"); - bglVertex2f = (bglVertex2fProcPtr) GETPROC("glVertex2f"); - bglVertex2i = (bglVertex2iProcPtr) GETPROC("glVertex2i"); - bglVertex3f = (bglVertex3fProcPtr) GETPROC("glVertex3f"); - bglVertex3d = (bglVertex3dProcPtr) GETPROC("glVertex3d"); - bglVertex3fv = (bglVertex3fvProcPtr) GETPROC("glVertex3fv"); - bglVertex3dv = (bglVertex3dvProcPtr) GETPROC("glVertex3dv"); - bglRecti = (bglRectiProcPtr) GETPROC("glRecti"); - bglColor3f = (bglColor3fProcPtr) GETPROC("glColor3f"); - bglColor4f = (bglColor4fProcPtr) GETPROC("glColor4f"); - bglColor4ub = (bglColor4ubProcPtr) GETPROC("glColor4ub"); - bglTexCoord2d = (bglTexCoord2dProcPtr) GETPROC("glTexCoord2d"); - bglTexCoord2f = (bglTexCoord2fProcPtr) GETPROC("glTexCoord2f"); - bglTexCoord2i = (bglTexCoord2iProcPtr) GETPROC("glTexCoord2i"); - bglNormal3f = (bglNormal3fProcPtr) GETPROC("glNormal3f"); - - // Lighting - bglShadeModel = (bglShadeModelProcPtr) GETPROC("glShadeModel"); - bglLightfv = (bglLightfvProcPtr) GETPROC("glLightfv"); - - // Raster funcs - bglReadPixels = (bglReadPixelsProcPtr) GETPROC("glReadPixels"); - bglRasterPos4i = (bglRasterPos4iProcPtr) GETPROC("glRasterPos4i"); - bglDrawPixels = (bglDrawPixelsProcPtr) GETPROC("glDrawPixels"); - bglPixelStorei = (bglPixelStoreiProcPtr) GETPROC("glPixelStorei"); - - // Texture mapping - bglTexEnvf = (bglTexEnvfProcPtr) GETPROC("glTexEnvf"); - bglGenTextures = (bglGenTexturesProcPtr) GETPROC("glGenTextures"); - bglDeleteTextures = (bglDeleteTexturesProcPtr) GETPROC("glDeleteTextures"); - bglBindTexture = (bglBindTextureProcPtr) GETPROC("glBindTexture"); - bglTexImage2D = (bglTexImage2DProcPtr) GETPROC("glTexImage2D"); - bglCopyTexImage2D = (bglCopyTexImage2DProcPtr) GETPROC("glCopyTexImage2D"); - bglCopyTexSubImage2D = (bglCopyTexSubImage2DProcPtr) GETPROC("glCopyTexSubImage2D"); - bglTexSubImage2D = (bglTexSubImage2DProcPtr) GETPROC("glTexSubImage2D"); - bglTexParameterf = (bglTexParameterfProcPtr) GETPROC("glTexParameterf"); - bglTexParameteri = (bglTexParameteriProcPtr) GETPROC("glTexParameteri"); - bglGetTexParameteriv = (bglGetTexParameterivProcPtr) GETPROC("glGetTexParameteriv"); - bglGetTexLevelParameteriv = (bglGetTexLevelParameterivProcPtr) GETPROC("glGetTexLevelParameteriv"); - bglTexGenfv = (bglTexGenfvProcPtr) GETPROC("glTexGenfv"); - - // Fog - bglFogf = (bglFogfProcPtr) GETPROC("glFogf"); - bglFogi = (bglFogiProcPtr) GETPROC("glFogi"); - bglFogfv = (bglFogfvProcPtr) GETPROC("glFogfv"); - - // Display Lists - bglNewList = (bglNewListProcPtr) GETPROC("glNewList"); - bglEndList = (bglEndListProcPtr) GETPROC("glEndList"); - bglCallList = (bglCallListProcPtr) GETPROC("glCallList"); - bglDeleteLists = (bglDeleteListsProcPtr) GETPROC("glDeleteLists"); - - // Vertex Arrays - bglEnableClientState = (bglEnableClientStateProcPtr) GETPROC("glEnableClientState"); - bglDisableClientState = (bglDisableClientStateProcPtr) GETPROC("glDisableClientState"); - bglVertexPointer = (bglVertexPointerProcPtr) GETPROC("glVertexPointer"); - bglNormalPointer = (bglNormalPointerProcPtr) GETPROC("glNormalPointer"); - bglTexCoordPointer = (bglTexCoordPointerProcPtr) GETPROC("glTexCoordPointer"); - bglDrawArrays = (bglDrawArraysProcPtr) GETPROC("glDrawArrays"); - bglDrawElements = (bglDrawElementsProcPtr) GETPROC("glDrawElements"); - - // Stencil Buffer - bglClearStencil = (bglClearStencilProcPtr) GETPROC("glClearStencil"); - bglStencilOp = (bglStencilOpProcPtr) GETPROC("glStencilOp"); - bglStencilFunc = (bglStencilFuncProcPtr) GETPROC("glStencilFunc"); -#endif - - loadglextensions(); - loadglulibrary(getenv("BUILD_GLULIB")); - -#if defined DYNAMIC_GL || defined DYNAMIC_GLEXT - if (err) unloadgldriver(); + + if (err) unloadwgl(); return err; -#else - UNREFERENCED_PARAMETER(driver); - return 0; -#endif } - -int32_t loadglextensions(void) +int32_t unloadwgl(void) { -#if defined DYNAMIC_GLEXT - int32_t err = 0; -#if !defined RENDERTYPESDL && defined _WIN32 if (!hGLDLL) return 0; -#endif - - bglBlendEquation = (bglBlendEquationProcPtr) GETPROCEXTSOFT("glBlendEquation"); - - bglTexImage3D = (bglTexImage3DProcPtr) GETPROCEXTSOFT("glTexImage3D"); - bglCompressedTexImage2DARB = (bglCompressedTexImage2DARBProcPtr) GETPROCEXTSOFT("glCompressedTexImage2DARB"); - bglGetCompressedTexImageARB = (bglGetCompressedTexImageARBProcPtr) GETPROCEXTSOFT("glGetCompressedTexImageARB"); - - // GPU Programs - bglGenProgramsARB = (bglGenProgramsARBProcPtr) GETPROCEXTSOFT("glGenProgramsARB"); - bglBindProgramARB = (bglBindProgramARBProcPtr) GETPROCEXTSOFT("glBindProgramARB"); - bglProgramStringARB = (bglProgramStringARBProcPtr) GETPROCEXTSOFT("glProgramStringARB"); - bglDeleteProgramsARB = (bglDeleteProgramsARBProcPtr) GETPROCEXTSOFT("glDeleteProgramsARB"); - - // Multitexturing - bglActiveTextureARB = (bglActiveTextureARBProcPtr) GETPROCEXTSOFT("glActiveTextureARB"); - bglClientActiveTextureARB = (bglClientActiveTextureARBProcPtr) GETPROCEXTSOFT("glClientActiveTextureARB"); - bglMultiTexCoord2dARB = (bglMultiTexCoord2dARBProcPtr) GETPROCEXTSOFT("glMultiTexCoord2dARB"); - bglMultiTexCoord2fARB = (bglMultiTexCoord2fARBProcPtr) GETPROCEXTSOFT("glMultiTexCoord2fARB"); - - // Frame Buffer Objects - bglGenFramebuffersEXT = (bglGenFramebuffersEXTProcPtr) GETPROCEXTSOFT("glGenFramebuffersEXT"); - bglBindFramebufferEXT = (bglBindFramebufferEXTProcPtr) GETPROCEXTSOFT("glBindFramebufferEXT"); - bglFramebufferTexture2DEXT = (bglFramebufferTexture2DEXTProcPtr) GETPROCEXTSOFT("glFramebufferTexture2DEXT"); - bglCheckFramebufferStatusEXT = (bglCheckFramebufferStatusEXTProcPtr) GETPROCEXTSOFT("glCheckFramebufferStatusEXT"); - bglDeleteFramebuffersEXT = (bglDeleteFramebuffersEXTProcPtr) GETPROCEXTSOFT("glDeleteFramebuffersEXT"); - - // Vertex Buffer Objects - bglGenBuffersARB = (bglGenBuffersARBProcPtr) GETPROCEXTSOFT("glGenBuffersARB"); - bglBindBufferARB = (bglBindBufferARBProcPtr) GETPROCEXTSOFT("glBindBufferARB"); - bglDeleteBuffersARB = (bglDeleteBuffersARBProcPtr) GETPROCEXTSOFT("glDeleteBuffersARB"); - bglBufferDataARB = (bglBufferDataARBProcPtr) GETPROCEXTSOFT("glBufferDataARB"); - bglBufferSubDataARB = (bglBufferSubDataARBProcPtr) GETPROCEXTSOFT("glBufferSubDataARB"); - bglMapBufferARB = (bglMapBufferARBProcPtr) GETPROCEXTSOFT("glMapBufferARB"); - bglUnmapBufferARB = (bglUnmapBufferARBProcPtr) GETPROCEXTSOFT("glUnmapBufferARB"); - - // ARB_buffer_storage - bglBufferStorage = (bglBufferStorageProcPtr)GETPROCEXTSOFT("glBufferStorage"); - - // ARB_map_buffer_range - bglMapBufferRange = (bglMapBufferRangeProcPtr)GETPROCEXTSOFT("glMapBufferRange"); - - // Occlusion queries - bglGenQueriesARB = (bglGenQueriesARBProcPtr) GETPROCEXTSOFT("glGenQueriesARB"); - bglDeleteQueriesARB = (bglDeleteQueriesARBProcPtr) GETPROCEXTSOFT("glDeleteQueriesARB"); - bglIsQueryARB = (bglIsQueryARBProcPtr) GETPROCEXTSOFT("glIsQueryARB"); - bglBeginQueryARB = (bglBeginQueryARBProcPtr) GETPROCEXTSOFT("glBeginQueryARB"); - bglEndQueryARB = (bglEndQueryARBProcPtr) GETPROCEXTSOFT("glEndQueryARB"); - bglGetQueryivARB = (bglGetQueryivARBProcPtr) GETPROCEXTSOFT("glGetQueryivARB"); - bglGetQueryObjectivARB = (bglGetQueryObjectivARBProcPtr) GETPROCEXTSOFT("glGetQueryObjectivARB"); - bglGetQueryObjectuivARB = (bglGetQueryObjectuivARBProcPtr) GETPROCEXTSOFT("glGetQueryObjectuivARB"); - - // Shader Objects - bglDeleteObjectARB = (bglDeleteObjectARBProcPtr) GETPROCEXTSOFT("glDeleteObjectARB"); - bglGetHandleARB = (bglGetHandleARBProcPtr) GETPROCEXTSOFT("glGetHandleARB"); - bglDetachObjectARB = (bglDetachObjectARBProcPtr) GETPROCEXTSOFT("glDetachObjectARB"); - bglCreateShaderObjectARB = (bglCreateShaderObjectARBProcPtr) GETPROCEXTSOFT("glCreateShaderObjectARB"); - bglShaderSourceARB = (bglShaderSourceARBProcPtr) GETPROCEXTSOFT("glShaderSourceARB"); - bglCompileShaderARB = (bglCompileShaderARBProcPtr) GETPROCEXTSOFT("glCompileShaderARB"); - bglCreateProgramObjectARB = (bglCreateProgramObjectARBProcPtr) GETPROCEXTSOFT("glCreateProgramObjectARB"); - bglAttachObjectARB = (bglAttachObjectARBProcPtr) GETPROCEXTSOFT("glAttachObjectARB"); - bglLinkProgramARB = (bglLinkProgramARBProcPtr) GETPROCEXTSOFT("glLinkProgramARB"); - bglUseProgramObjectARB = (bglUseProgramObjectARBProcPtr) GETPROCEXTSOFT("glUseProgramObjectARB"); - bglValidateProgramARB = (bglValidateProgramARBProcPtr) GETPROCEXTSOFT("glValidateProgramARB"); - bglUniform1fARB = (bglUniform1fARBProcPtr) GETPROCEXTSOFT("glUniform1fARB"); - bglUniform2fARB = (bglUniform2fARBProcPtr) GETPROCEXTSOFT("glUniform2fARB"); - bglUniform3fARB = (bglUniform3fARBProcPtr) GETPROCEXTSOFT("glUniform3fARB"); - bglUniform4fARB = (bglUniform4fARBProcPtr) GETPROCEXTSOFT("glUniform4fARB"); - bglUniform1iARB = (bglUniform1iARBProcPtr) GETPROCEXTSOFT("glUniform1iARB"); - bglUniform2iARB = (bglUniform2iARBProcPtr) GETPROCEXTSOFT("glUniform2iARB"); - bglUniform3iARB = (bglUniform3iARBProcPtr) GETPROCEXTSOFT("glUniform3iARB"); - bglUniform4iARB = (bglUniform4iARBProcPtr) GETPROCEXTSOFT("glUniform4iARB"); - bglUniform1fvARB = (bglUniform1fvARBProcPtr) GETPROCEXTSOFT("glUniform1fvARB"); - bglUniform2fvARB = (bglUniform2fvARBProcPtr) GETPROCEXTSOFT("glUniform2fvARB"); - bglUniform3fvARB = (bglUniform3fvARBProcPtr) GETPROCEXTSOFT("glUniform3fvARB"); - bglUniform4fvARB = (bglUniform4fvARBProcPtr) GETPROCEXTSOFT("glUniform4fvARB"); - bglUniform1ivARB = (bglUniform1ivARBProcPtr) GETPROCEXTSOFT("glUniform1ivARB"); - bglUniform2ivARB = (bglUniform2ivARBProcPtr) GETPROCEXTSOFT("glUniform2ivARB"); - bglUniform3ivARB = (bglUniform3ivARBProcPtr) GETPROCEXTSOFT("glUniform3ivARB"); - bglUniform4ivARB = (bglUniform4ivARBProcPtr) GETPROCEXTSOFT("glUniform4ivARB"); - bglUniformMatrix2fvARB = (bglUniformMatrix2fvARBProcPtr) GETPROCEXTSOFT("glUniformMatrix2fvARB"); - bglUniformMatrix3fvARB = (bglUniformMatrix3fvARBProcPtr) GETPROCEXTSOFT("glUniformMatrix3fvARB"); - bglUniformMatrix4fvARB = (bglUniformMatrix4fvARBProcPtr) GETPROCEXTSOFT("glUniformMatrix4fvARB"); - bglGetObjectParameterfvARB = (bglGetObjectParameterfvARBProcPtr) GETPROCEXTSOFT("glGetObjectParameterfvARB"); - bglGetObjectParameterivARB = (bglGetObjectParameterivARBProcPtr) GETPROCEXTSOFT("glGetObjectParameterivARB"); - bglGetInfoLogARB = (bglGetInfoLogARBProcPtr) GETPROCEXTSOFT("glGetInfoLogARB"); - bglGetAttachedObjectsARB = (bglGetAttachedObjectsARBProcPtr) GETPROCEXTSOFT("glGetAttachedObjectsARB"); - bglGetUniformLocationARB = (bglGetUniformLocationARBProcPtr) GETPROCEXTSOFT("glGetUniformLocationARB"); - bglGetActiveUniformARB = (bglGetActiveUniformARBProcPtr) GETPROCEXTSOFT("glGetActiveUniformARB"); - bglGetUniformfvARB = (bglGetUniformfvARBProcPtr) GETPROCEXTSOFT("glGetUniformfvARB"); - bglGetUniformivARB = (bglGetUniformivARBProcPtr) GETPROCEXTSOFT("glGetUniformivARB"); - bglGetShaderSourceARB = (bglGetShaderSourceARBProcPtr) GETPROCEXTSOFT("glGetShaderSourceARB"); - - // Vertex Shaders - bglVertexAttrib1dARB = (bglVertexAttrib1dARBProcPtr) GETPROCEXTSOFT("glVertexAttrib1dARB"); - bglVertexAttrib1dvARB = (bglVertexAttrib1dvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib1dvARB"); - bglVertexAttrib1fARB = (bglVertexAttrib1fARBProcPtr) GETPROCEXTSOFT("glVertexAttrib1fARB"); - bglVertexAttrib1fvARB = (bglVertexAttrib1fvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib1fvARB"); - bglVertexAttrib1sARB = (bglVertexAttrib1sARBProcPtr) GETPROCEXTSOFT("glVertexAttrib1sARB"); - bglVertexAttrib1svARB = (bglVertexAttrib1svARBProcPtr) GETPROCEXTSOFT("glVertexAttrib1svARB"); - bglVertexAttrib2dARB = (bglVertexAttrib2dARBProcPtr) GETPROCEXTSOFT("glVertexAttrib2dARB"); - bglVertexAttrib2dvARB = (bglVertexAttrib2dvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib2dvARB"); - bglVertexAttrib2fARB = (bglVertexAttrib2fARBProcPtr) GETPROCEXTSOFT("glVertexAttrib2fARB"); - bglVertexAttrib2fvARB = (bglVertexAttrib2fvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib2fvARB"); - bglVertexAttrib2sARB = (bglVertexAttrib2sARBProcPtr) GETPROCEXTSOFT("glVertexAttrib2sARB"); - bglVertexAttrib2svARB = (bglVertexAttrib2svARBProcPtr) GETPROCEXTSOFT("glVertexAttrib2svARB"); - bglVertexAttrib3dARB = (bglVertexAttrib3dARBProcPtr) GETPROCEXTSOFT("glVertexAttrib3dARB"); - bglVertexAttrib3dvARB = (bglVertexAttrib3dvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib3dvARB"); - bglVertexAttrib3fARB = (bglVertexAttrib3fARBProcPtr) GETPROCEXTSOFT("glVertexAttrib3fARB"); - bglVertexAttrib3fvARB = (bglVertexAttrib3fvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib3fvARB"); - bglVertexAttrib3sARB = (bglVertexAttrib3sARBProcPtr) GETPROCEXTSOFT("glVertexAttrib3sARB"); - bglVertexAttrib3svARB = (bglVertexAttrib3svARBProcPtr) GETPROCEXTSOFT("glVertexAttrib3svARB"); - bglVertexAttrib4NbvARB = (bglVertexAttrib4NbvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4NbvARB"); - bglVertexAttrib4NivARB = (bglVertexAttrib4NivARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4NivARB"); - bglVertexAttrib4NsvARB = (bglVertexAttrib4NsvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4NsvARB"); - bglVertexAttrib4NubARB = (bglVertexAttrib4NubARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4NubARB"); - bglVertexAttrib4NubvARB = (bglVertexAttrib4NubvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4NubvARB"); - bglVertexAttrib4NuivARB = (bglVertexAttrib4NuivARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4NuivARB"); - bglVertexAttrib4NusvARB = (bglVertexAttrib4NusvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4NusvARB"); - bglVertexAttrib4bvARB = (bglVertexAttrib4bvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4bvARB"); - bglVertexAttrib4dARB = (bglVertexAttrib4dARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4dARB"); - bglVertexAttrib4dvARB = (bglVertexAttrib4dvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4dvARB"); - bglVertexAttrib4fARB = (bglVertexAttrib4fARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4fARB"); - bglVertexAttrib4fvARB = (bglVertexAttrib4fvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4fvARB"); - bglVertexAttrib4ivARB = (bglVertexAttrib4ivARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4ivARB"); - bglVertexAttrib4sARB = (bglVertexAttrib4sARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4sARB"); - bglVertexAttrib4svARB = (bglVertexAttrib4svARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4svARB"); - bglVertexAttrib4ubvARB = (bglVertexAttrib4ubvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4ubvARB"); - bglVertexAttrib4uivARB = (bglVertexAttrib4uivARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4uivARB"); - bglVertexAttrib4usvARB = (bglVertexAttrib4usvARBProcPtr) GETPROCEXTSOFT("glVertexAttrib4usvARB"); - bglVertexAttribPointerARB = (bglVertexAttribPointerARBProcPtr) GETPROCEXTSOFT("glVertexAttribPointerARB"); - bglEnableVertexAttribArrayARB = (bglEnableVertexAttribArrayARBProcPtr) GETPROCEXTSOFT("glEnableVertexAttribArrayARB"); - bglDisableVertexAttribArrayARB = (bglDisableVertexAttribArrayARBProcPtr) GETPROCEXTSOFT("glDisableVertexAttribArrayARB"); - bglGetVertexAttribdvARB = (bglGetVertexAttribdvARBProcPtr) GETPROCEXTSOFT("glGetVertexAttribdvARB"); - bglGetVertexAttribfvARB = (bglGetVertexAttribfvARBProcPtr) GETPROCEXTSOFT("glGetVertexAttribfvARB"); - bglGetVertexAttribivARB = (bglGetVertexAttribivARBProcPtr) GETPROCEXTSOFT("glGetVertexAttribivARB"); - bglGetVertexAttribPointervARB = (bglGetVertexAttribPointervARBProcPtr) GETPROCEXTSOFT("glGetVertexAttribPointervARB"); - bglBindAttribLocationARB = (bglBindAttribLocationARBProcPtr) GETPROCEXTSOFT("glBindAttribLocationARB"); - bglGetActiveAttribARB = (bglGetActiveAttribARBProcPtr) GETPROCEXTSOFT("glGetActiveAttribARB"); - bglGetAttribLocationARB = (bglGetAttribLocationARBProcPtr) GETPROCEXTSOFT("glGetAttribLocationARB"); - - // Debug Output -#ifndef __APPLE__ - bglDebugMessageControlARB = (bglDebugMessageControlARBProcPtr) GETPROCEXTSOFT("glDebugMessageControlARB"); - bglDebugMessageCallbackARB = (bglDebugMessageCallbackARBProcPtr) GETPROCEXTSOFT("glDebugMessageCallbackARB"); -#endif - -#ifdef _WIN32 - bwglSwapIntervalEXT = (bwglSwapIntervalEXTProcPtr) GETPROCEXTSOFT("wglSwapIntervalEXT"); - bwglCreateContextAttribsARB = (bwglCreateContextAttribsARBProcPtr) GETPROCEXTSOFT("wglCreateContextAttribsARB"); -#endif - - // the following ARB functions are used in POLYMER=0 builds: - // glActiveTextureARB, - // glDeleteBuffersARB, glGenBuffersARB, glBindBufferARB, - // glMapBufferARB, glUnmapBufferARB, glBufferDataARB, - // glClientActiveTextureARB, - // glGetCompressedTexImageARB, glCompressedTexImage2DARB - - return err; -#else - return 0; -#endif -} - -int32_t unloadgldriver(void) -{ - unloadglulibrary(); - -#if defined DYNAMIC_GL || defined DYNAMIC_GLEXT -#if !defined RENDERTYPESDL && defined _WIN32 - if (!hGLDLL) return 0; -#endif DO_FREE_AND_NULL(gldriver); -#if !defined RENDERTYPESDL && defined _WIN32 FreeLibrary(hGLDLL); hGLDLL = NULL; -#endif -#endif -#if defined DYNAMIC_GL -#ifdef _WIN32 bwglCreateContext = (bwglCreateContextProcPtr) NULL; bwglDeleteContext = (bwglDeleteContextProcPtr) NULL; bwglGetProcAddress = (bwglGetProcAddressProcPtr) NULL; bwglMakeCurrent = (bwglMakeCurrentProcPtr) NULL; - bwglSwapBuffers = (bwglSwapBuffersProcPtr) NULL; bwglChoosePixelFormat = (bwglChoosePixelFormatProcPtr) NULL; bwglDescribePixelFormat = (bwglDescribePixelFormatProcPtr) NULL; bwglGetPixelFormat = (bwglGetPixelFormatProcPtr) NULL; bwglSetPixelFormat = (bwglSetPixelFormatProcPtr) NULL; -#endif - - bglClearColor = (bglClearColorProcPtr) NULL; - bglClear = (bglClearProcPtr) NULL; - bglColorMask = (bglColorMaskProcPtr) NULL; - bglAlphaFunc = (bglAlphaFuncProcPtr) NULL; - bglBlendFunc = (bglBlendFuncProcPtr) NULL; - bglCullFace = (bglCullFaceProcPtr) NULL; - bglFrontFace = (bglFrontFaceProcPtr) NULL; - bglPolygonOffset = (bglPolygonOffsetProcPtr) NULL; - bglPolygonMode = (bglPolygonModeProcPtr) NULL; - bglEnable = (bglEnableProcPtr) NULL; - bglDisable = (bglDisableProcPtr) NULL; - bglGetDoublev = (bglGetDoublevProcPtr) NULL; - bglGetFloatv = (bglGetFloatvProcPtr) NULL; - bglGetIntegerv = (bglGetIntegervProcPtr) NULL; - bglPushAttrib = (bglPushAttribProcPtr) NULL; - bglPopAttrib = (bglPopAttribProcPtr) NULL; - bglGetError = (bglGetErrorProcPtr) NULL; - bglGetString = (bglGetStringProcPtr) NULL; - bglHint = (bglHintProcPtr) NULL; - bglDrawBuffer = (bglDrawBufferProcPtr) NULL; - bglReadBuffer = (bglReadBufferProcPtr) NULL; - bglScissor = (bglScissorProcPtr) NULL; - bglClipPlane = (bglClipPlaneProcPtr) NULL; - - // Depth - bglDepthFunc = (bglDepthFuncProcPtr) NULL; - bglDepthMask = (bglDepthMaskProcPtr) NULL; -// bglDepthRange = (bglDepthRangeProcPtr) NULL; - - // Matrix - bglMatrixMode = (bglMatrixModeProcPtr) NULL; - bglOrtho = (bglOrthoProcPtr) NULL; - bglFrustum = (bglFrustumProcPtr) NULL; - bglViewport = (bglViewportProcPtr) NULL; - bglPushMatrix = (bglPushMatrixProcPtr) NULL; - bglPopMatrix = (bglPopMatrixProcPtr) NULL; - bglLoadIdentity = (bglLoadIdentityProcPtr) NULL; - bglLoadMatrixf = (bglLoadMatrixfProcPtr) NULL; - bglLoadMatrixd = (bglLoadMatrixdProcPtr) NULL; - bglMultMatrixf = (bglMultMatrixfProcPtr) NULL; - bglMultMatrixd = (bglMultMatrixdProcPtr) NULL; - bglRotatef = (bglRotatefProcPtr) NULL; - bglScalef = (bglScalefProcPtr) NULL; - bglTranslatef = (bglTranslatefProcPtr) NULL; - - // Drawing - bglBegin = (bglBeginProcPtr) NULL; - bglEnd = (bglEndProcPtr) NULL; - bglVertex2f = (bglVertex2fProcPtr) NULL; - bglVertex2i = (bglVertex2iProcPtr) NULL; - bglVertex3f = (bglVertex3fProcPtr) NULL; - bglVertex3d = (bglVertex3dProcPtr) NULL; - bglVertex3fv = (bglVertex3fvProcPtr) NULL; - bglVertex3dv = (bglVertex3dvProcPtr) NULL; - bglRecti = (bglRectiProcPtr) NULL; - bglColor3f = (bglColor3fProcPtr) NULL; - bglColor4f = (bglColor4fProcPtr) NULL; - bglColor4ub = (bglColor4ubProcPtr) NULL; - bglTexCoord2d = (bglTexCoord2dProcPtr) NULL; - bglTexCoord2f = (bglTexCoord2fProcPtr) NULL; - bglTexCoord2i = (bglTexCoord2iProcPtr) NULL; - bglNormal3f = (bglNormal3fProcPtr) NULL; - - // Lighting - bglShadeModel = (bglShadeModelProcPtr) NULL; - bglLightfv = (bglLightfvProcPtr) NULL; - - // Raster funcs - bglReadPixels = (bglReadPixelsProcPtr) NULL; - bglRasterPos4i = (bglRasterPos4iProcPtr) NULL; - bglDrawPixels = (bglDrawPixelsProcPtr) NULL; - bglPixelStorei = (bglPixelStoreiProcPtr) NULL; - - // Texture mapping - bglTexEnvf = (bglTexEnvfProcPtr) NULL; - bglGenTextures = (bglGenTexturesProcPtr) NULL; - bglDeleteTextures = (bglDeleteTexturesProcPtr) NULL; - bglBindTexture = (bglBindTextureProcPtr) NULL; - bglTexImage2D = (bglTexImage2DProcPtr) NULL; - bglCopyTexImage2D = (bglCopyTexImage2DProcPtr) NULL; - bglCopyTexSubImage2D = (bglCopyTexSubImage2DProcPtr) NULL; - bglTexSubImage2D = (bglTexSubImage2DProcPtr) NULL; - bglTexParameterf = (bglTexParameterfProcPtr) NULL; - bglTexParameteri = (bglTexParameteriProcPtr) NULL; - bglGetTexParameteriv = (bglGetTexParameterivProcPtr) NULL; - bglGetTexLevelParameteriv = (bglGetTexLevelParameterivProcPtr) NULL; - bglTexGenfv = (bglTexGenfvProcPtr) NULL; - - // Fog - bglFogf = (bglFogfProcPtr) NULL; - bglFogi = (bglFogiProcPtr) NULL; - bglFogfv = (bglFogfvProcPtr) NULL; - - // Display Lists - bglNewList = (bglNewListProcPtr) NULL; - bglEndList = (bglEndListProcPtr) NULL; - bglCallList = (bglCallListProcPtr) NULL; - bglDeleteLists = (bglDeleteListsProcPtr) NULL; - - // Vertex Arrays - bglEnableClientState = (bglEnableClientStateProcPtr) NULL; - bglDisableClientState = (bglDisableClientStateProcPtr) NULL; - bglVertexPointer = (bglVertexPointerProcPtr) NULL; - bglNormalPointer = (bglNormalPointerProcPtr) NULL; - bglTexCoordPointer = (bglTexCoordPointerProcPtr) NULL; - bglDrawArrays = (bglDrawArraysProcPtr) NULL; - bglDrawElements = (bglDrawElementsProcPtr) NULL; - - // Stencil Buffer - bglClearStencil = (bglClearStencilProcPtr) NULL; - bglStencilOp = (bglStencilOpProcPtr) NULL; - bglStencilFunc = (bglStencilFuncProcPtr) NULL; -#endif - -#if defined DYNAMIC_GLEXT - bglBlendEquation = (bglBlendEquationProcPtr) NULL; - - bglTexImage3D = (bglTexImage3DProcPtr) NULL; - bglCompressedTexImage2DARB = (bglCompressedTexImage2DARBProcPtr) NULL; - bglGetCompressedTexImageARB = (bglGetCompressedTexImageARBProcPtr) NULL; - - // GPU Programs - bglGenProgramsARB = (bglGenProgramsARBProcPtr) NULL; - bglBindProgramARB = (bglBindProgramARBProcPtr) NULL; - bglProgramStringARB = (bglProgramStringARBProcPtr) NULL; - bglDeleteProgramsARB = (bglDeleteProgramsARBProcPtr) NULL; - - // Multitexturing - bglActiveTextureARB = (bglActiveTextureARBProcPtr) NULL; - bglClientActiveTextureARB = (bglClientActiveTextureARBProcPtr) NULL; - bglMultiTexCoord2dARB = (bglMultiTexCoord2dARBProcPtr) NULL; - bglMultiTexCoord2fARB = (bglMultiTexCoord2fARBProcPtr) NULL; - - // Frame Buffer Objects - bglGenFramebuffersEXT = (bglGenFramebuffersEXTProcPtr) NULL; - bglBindFramebufferEXT = (bglBindFramebufferEXTProcPtr) NULL; - bglFramebufferTexture2DEXT = (bglFramebufferTexture2DEXTProcPtr) NULL; - bglCheckFramebufferStatusEXT = (bglCheckFramebufferStatusEXTProcPtr) NULL; - bglDeleteFramebuffersEXT = (bglDeleteFramebuffersEXTProcPtr) NULL; - - // Vertex Buffer Objects - bglGenBuffersARB = (bglGenBuffersARBProcPtr) NULL; - bglBindBufferARB = (bglBindBufferARBProcPtr) NULL; - bglDeleteBuffersARB = (bglDeleteBuffersARBProcPtr) NULL; - bglBufferDataARB = (bglBufferDataARBProcPtr) NULL; - bglBufferSubDataARB = (bglBufferSubDataARBProcPtr) NULL; - bglMapBufferARB = (bglMapBufferARBProcPtr) NULL; - bglUnmapBufferARB = (bglUnmapBufferARBProcPtr) NULL; - - // ARB_buffer_storage - bglBufferStorage = (bglBufferStorageProcPtr) NULL; - - // ARB_map_buffer_range - bglMapBufferRange = (bglMapBufferRangeProcPtr)NULL; - - // Occlusion queries - bglGenQueriesARB = (bglGenQueriesARBProcPtr) NULL; - bglDeleteQueriesARB = (bglDeleteQueriesARBProcPtr) NULL; - bglIsQueryARB = (bglIsQueryARBProcPtr) NULL; - bglBeginQueryARB = (bglBeginQueryARBProcPtr) NULL; - bglEndQueryARB = (bglEndQueryARBProcPtr) NULL; - bglGetQueryivARB = (bglGetQueryivARBProcPtr) NULL; - bglGetQueryObjectivARB = (bglGetQueryObjectivARBProcPtr) NULL; - bglGetQueryObjectuivARB = (bglGetQueryObjectuivARBProcPtr) NULL; - - // Shader Objects - bglDeleteObjectARB = (bglDeleteObjectARBProcPtr) NULL; - bglGetHandleARB = (bglGetHandleARBProcPtr) NULL; - bglDetachObjectARB = (bglDetachObjectARBProcPtr) NULL; - bglCreateShaderObjectARB = (bglCreateShaderObjectARBProcPtr) NULL; - bglShaderSourceARB = (bglShaderSourceARBProcPtr) NULL; - bglCompileShaderARB = (bglCompileShaderARBProcPtr) NULL; - bglCreateProgramObjectARB = (bglCreateProgramObjectARBProcPtr) NULL; - bglAttachObjectARB = (bglAttachObjectARBProcPtr) NULL; - bglLinkProgramARB = (bglLinkProgramARBProcPtr) NULL; - bglUseProgramObjectARB = (bglUseProgramObjectARBProcPtr) NULL; - bglValidateProgramARB = (bglValidateProgramARBProcPtr) NULL; - bglUniform1fARB = (bglUniform1fARBProcPtr) NULL; - bglUniform2fARB = (bglUniform2fARBProcPtr) NULL; - bglUniform3fARB = (bglUniform3fARBProcPtr) NULL; - bglUniform4fARB = (bglUniform4fARBProcPtr) NULL; - bglUniform1iARB = (bglUniform1iARBProcPtr) NULL; - bglUniform2iARB = (bglUniform2iARBProcPtr) NULL; - bglUniform3iARB = (bglUniform3iARBProcPtr) NULL; - bglUniform4iARB = (bglUniform4iARBProcPtr) NULL; - bglUniform1fvARB = (bglUniform1fvARBProcPtr) NULL; - bglUniform2fvARB = (bglUniform2fvARBProcPtr) NULL; - bglUniform3fvARB = (bglUniform3fvARBProcPtr) NULL; - bglUniform4fvARB = (bglUniform4fvARBProcPtr) NULL; - bglUniform1ivARB = (bglUniform1ivARBProcPtr) NULL; - bglUniform2ivARB = (bglUniform2ivARBProcPtr) NULL; - bglUniform3ivARB = (bglUniform3ivARBProcPtr) NULL; - bglUniform4ivARB = (bglUniform4ivARBProcPtr) NULL; - bglUniformMatrix2fvARB = (bglUniformMatrix2fvARBProcPtr) NULL; - bglUniformMatrix3fvARB = (bglUniformMatrix3fvARBProcPtr) NULL; - bglUniformMatrix4fvARB = (bglUniformMatrix4fvARBProcPtr) NULL; - bglGetObjectParameterfvARB = (bglGetObjectParameterfvARBProcPtr) NULL; - bglGetObjectParameterivARB = (bglGetObjectParameterivARBProcPtr) NULL; - bglGetInfoLogARB = (bglGetInfoLogARBProcPtr) NULL; - bglGetAttachedObjectsARB = (bglGetAttachedObjectsARBProcPtr) NULL; - bglGetUniformLocationARB = (bglGetUniformLocationARBProcPtr) NULL; - bglGetActiveUniformARB = (bglGetActiveUniformARBProcPtr) NULL; - bglGetUniformfvARB = (bglGetUniformfvARBProcPtr) NULL; - bglGetUniformivARB = (bglGetUniformivARBProcPtr) NULL; - bglGetShaderSourceARB = (bglGetShaderSourceARBProcPtr) NULL; - - // Vertex Shaders - bglVertexAttrib1dARB = (bglVertexAttrib1dARBProcPtr) NULL; - bglVertexAttrib1dvARB = (bglVertexAttrib1dvARBProcPtr) NULL; - bglVertexAttrib1fARB = (bglVertexAttrib1fARBProcPtr) NULL; - bglVertexAttrib1fvARB = (bglVertexAttrib1fvARBProcPtr) NULL; - bglVertexAttrib1sARB = (bglVertexAttrib1sARBProcPtr) NULL; - bglVertexAttrib1svARB = (bglVertexAttrib1svARBProcPtr) NULL; - bglVertexAttrib2dARB = (bglVertexAttrib2dARBProcPtr) NULL; - bglVertexAttrib2dvARB = (bglVertexAttrib2dvARBProcPtr) NULL; - bglVertexAttrib2fARB = (bglVertexAttrib2fARBProcPtr) NULL; - bglVertexAttrib2fvARB = (bglVertexAttrib2fvARBProcPtr) NULL; - bglVertexAttrib2sARB = (bglVertexAttrib2sARBProcPtr) NULL; - bglVertexAttrib2svARB = (bglVertexAttrib2svARBProcPtr) NULL; - bglVertexAttrib3dARB = (bglVertexAttrib3dARBProcPtr) NULL; - bglVertexAttrib3dvARB = (bglVertexAttrib3dvARBProcPtr) NULL; - bglVertexAttrib3fARB = (bglVertexAttrib3fARBProcPtr) NULL; - bglVertexAttrib3fvARB = (bglVertexAttrib3fvARBProcPtr) NULL; - bglVertexAttrib3sARB = (bglVertexAttrib3sARBProcPtr) NULL; - bglVertexAttrib3svARB = (bglVertexAttrib3svARBProcPtr) NULL; - bglVertexAttrib4NbvARB = (bglVertexAttrib4NbvARBProcPtr) NULL; - bglVertexAttrib4NivARB = (bglVertexAttrib4NivARBProcPtr) NULL; - bglVertexAttrib4NsvARB = (bglVertexAttrib4NsvARBProcPtr) NULL; - bglVertexAttrib4NubARB = (bglVertexAttrib4NubARBProcPtr) NULL; - bglVertexAttrib4NubvARB = (bglVertexAttrib4NubvARBProcPtr) NULL; - bglVertexAttrib4NuivARB = (bglVertexAttrib4NuivARBProcPtr) NULL; - bglVertexAttrib4NusvARB = (bglVertexAttrib4NusvARBProcPtr) NULL; - bglVertexAttrib4bvARB = (bglVertexAttrib4bvARBProcPtr) NULL; - bglVertexAttrib4dARB = (bglVertexAttrib4dARBProcPtr) NULL; - bglVertexAttrib4dvARB = (bglVertexAttrib4dvARBProcPtr) NULL; - bglVertexAttrib4fARB = (bglVertexAttrib4fARBProcPtr) NULL; - bglVertexAttrib4fvARB = (bglVertexAttrib4fvARBProcPtr) NULL; - bglVertexAttrib4ivARB = (bglVertexAttrib4ivARBProcPtr) NULL; - bglVertexAttrib4sARB = (bglVertexAttrib4sARBProcPtr) NULL; - bglVertexAttrib4svARB = (bglVertexAttrib4svARBProcPtr) NULL; - bglVertexAttrib4ubvARB = (bglVertexAttrib4ubvARBProcPtr) NULL; - bglVertexAttrib4uivARB = (bglVertexAttrib4uivARBProcPtr) NULL; - bglVertexAttrib4usvARB = (bglVertexAttrib4usvARBProcPtr) NULL; - bglVertexAttribPointerARB = (bglVertexAttribPointerARBProcPtr) NULL; - bglEnableVertexAttribArrayARB = (bglEnableVertexAttribArrayARBProcPtr) NULL; - bglDisableVertexAttribArrayARB = (bglDisableVertexAttribArrayARBProcPtr) NULL; - bglGetVertexAttribdvARB = (bglGetVertexAttribdvARBProcPtr) NULL; - bglGetVertexAttribfvARB = (bglGetVertexAttribfvARBProcPtr) NULL; - bglGetVertexAttribivARB = (bglGetVertexAttribivARBProcPtr) NULL; - bglGetVertexAttribPointervARB = (bglGetVertexAttribPointervARBProcPtr) NULL; - bglBindAttribLocationARB = (bglBindAttribLocationARBProcPtr) NULL; - bglGetActiveAttribARB = (bglGetActiveAttribARBProcPtr) NULL; - bglGetAttribLocationARB = (bglGetAttribLocationARBProcPtr) NULL; - - // Debug Output -#ifndef __APPLE__ - bglDebugMessageControlARB = (bglDebugMessageControlARBProcPtr) NULL; - bglDebugMessageCallbackARB = (bglDebugMessageCallbackARBProcPtr) NULL; -#endif - -#ifdef _WIN32 - bwglSwapIntervalEXT = (bwglSwapIntervalEXTProcPtr) NULL; - bwglCreateContextAttribsARB = (bwglCreateContextAttribsARBProcPtr) NULL; -#endif -#endif - return 0; } +#endif + +#endif #if defined DYNAMIC_GLU #if defined _WIN32 diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index 01f93b373..2f3a8ad25 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -4,7 +4,7 @@ #include "compat.h" #include "build.h" -#include "glbuild.h" +#include "glad/glad.h" #include "pragmas.h" #include "baselayer.h" #include "engine_priv.h" @@ -103,15 +103,15 @@ void md_freevbos() if (m->vbos) { // OSD_Printf("freeing model %d vbo\n",i); - bglDeleteBuffersARB(m->head.numsurfs, m->vbos); + glDeleteBuffers(m->head.numsurfs, m->vbos); DO_FREE_AND_NULL(m->vbos); } } if (allocvbos) { - bglDeleteBuffersARB(allocvbos, indexvbos); - bglDeleteBuffersARB(allocvbos, vertvbos); + glDeleteBuffers(allocvbos, indexvbos); + glDeleteBuffers(allocvbos, vertvbos); allocvbos = 0; } } @@ -192,7 +192,7 @@ void clearskins(int32_t type) for (j=0; jtexid[j]) { - bglDeleteTextures(1, &v->texid[j]); + glDeleteTextures(1, &v->texid[j]); v->texid[j] = 0; } } @@ -206,7 +206,7 @@ void clearskins(int32_t type) { GLuint otexid = m2->texid[j]; - bglDeleteTextures(1, &m2->texid[j]); + glDeleteTextures(1, &m2->texid[j]); m2->texid[j] = 0; nullskintexids(otexid); @@ -218,7 +218,7 @@ void clearskins(int32_t type) { GLuint otexid = sk->texid[j]; - bglDeleteTextures(1, &sk->texid[j]); + glDeleteTextures(1, &sk->texid[j]); sk->texid[j] = 0; nullskintexids(otexid); @@ -234,7 +234,7 @@ void clearskins(int32_t type) for (j=0; jtexid[j]) { - bglDeleteTextures(1, &v->texid[j]); + glDeleteTextures(1, &v->texid[j]); v->texid[j] = 0; } } @@ -900,9 +900,9 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) if (pal < (MAXPALOOKUPS - RESERVEDPALS)) m->usesalpha = hasalpha; if ((doalloc&3)==1) - bglGenTextures(1, texidx); + glGenTextures(1, texidx); - bglBindTexture(GL_TEXTURE_2D, *texidx); + glBindTexture(GL_TEXTURE_2D, *texidx); //gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA,xsiz,ysiz,GL_BGRA_EXT,GL_UNSIGNED_BYTE,(char *)fptr); @@ -957,14 +957,14 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) int32_t const filter = sk->flags & HICR_FORCEFILTER ? TEXFILTER_ON : gltexfiltermode; - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[filter].mag); - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[filter].min); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[filter].mag); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[filter].min); #ifdef USE_GLEXT if (glinfo.maxanisotropy > 1.0) - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy); #endif - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); #if defined USE_GLEXT && !defined EDUKE32_GLES if (!gotcache && glinfo.texcompr && glusetexcache && !(sk->flags & HICR_NOTEXCOMPRESS) && @@ -1183,16 +1183,16 @@ static void mdloadvbos(md3model_t *m) int32_t i; m->vbos = (GLuint *)Xmalloc(m->head.numsurfs * sizeof(GLuint)); - bglGenBuffersARB(m->head.numsurfs, m->vbos); + glGenBuffers(m->head.numsurfs, m->vbos); i = 0; while (i < m->head.numsurfs) { - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, m->vbos[i]); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, m->head.surfs[i].numverts * sizeof(md3uv_t), m->head.surfs[i].uv, GL_STATIC_DRAW_ARB); + glBindBuffer(GL_ARRAY_BUFFER, m->vbos[i]); + glBufferData(GL_ARRAY_BUFFER, m->head.surfs[i].numverts * sizeof(md3uv_t), m->head.surfs[i].uv, GL_STATIC_DRAW); i++; } - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); } #endif @@ -2067,7 +2067,7 @@ static void md3draw_handle_triangles(const md3surf_t *s, uint16_t *indexhandle, return; } - bglBegin(GL_TRIANGLES); + glBegin(GL_TRIANGLES); for (i=s->numtris-1; i>=0; i--) { uint16_t tri = M ? M->indexes[i] : i; @@ -2078,20 +2078,20 @@ static void md3draw_handle_triangles(const md3surf_t *s, uint16_t *indexhandle, int32_t k = s->tris[tri].i[j]; #ifdef USE_GLEXT - if (texunits > GL_TEXTURE0_ARB) + if (texunits > GL_TEXTURE0) { - int32_t l = GL_TEXTURE0_ARB; + int32_t l = GL_TEXTURE0; while (l <= texunits) - bglMultiTexCoord2fARB(l++, s->uv[k].u, s->uv[k].v); + glMultiTexCoord2f(l++, s->uv[k].u, s->uv[k].v); } else #endif - bglTexCoord2f(s->uv[k].u, s->uv[k].v); + glTexCoord2f(s->uv[k].u, s->uv[k].v); - bglVertex3fv((float *) &vertlist[k]); + glVertex3fv((float *) &vertlist[k]); } } - bglEnd(); + glEnd(); #ifndef USE_GLEXT UNREFERENCED_PARAMETER(texunits); @@ -2105,7 +2105,7 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) int32_t i, surfi; float f, g, k0, k1, k2=0, k3=0, mat[16]; // inits: compiler-happy GLfloat pc[4]; - int32_t texunits = GL_TEXTURE0_ARB; + int32_t texunits = GL_TEXTURE0; const int32_t owner = tspr->owner; // PK: XXX: These owner bound checks are redundant because sext is @@ -2214,18 +2214,18 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) #else double f = (double) (tspr->owner + 1) * (FLT_EPSILON * 8.0); if (f != 0.0) f *= 1.0/(double) (sepldist(globalposx - tspr->x, globalposy - tspr->y)>>5); -// bglBlendFunc(GL_SRC_ALPHA, GL_DST_COLOR); +// glBlendFunc(GL_SRC_ALPHA, GL_DST_COLOR); #endif - bglDepthFunc(GL_LEQUAL); -// bglDepthRange(0.0 - f, 1.0 - f); + glDepthFunc(GL_LEQUAL); +// glDepthRange(0.0 - f, 1.0 - f); } -// bglPushAttrib(GL_POLYGON_BIT); - if ((grhalfxdown10x >= 0) ^((globalorientation&8) != 0) ^((globalorientation&4) != 0)) bglFrontFace(GL_CW); else bglFrontFace(GL_CCW); - bglEnable(GL_CULL_FACE); - bglCullFace(GL_BACK); +// glPushAttrib(GL_POLYGON_BIT); + if ((grhalfxdown10x >= 0) ^((globalorientation&8) != 0) ^((globalorientation&4) != 0)) glFrontFace(GL_CW); else glFrontFace(GL_CCW); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); - bglEnable(GL_TEXTURE_2D); + glEnable(GL_TEXTURE_2D); // tinting pc[0] = pc[1] = pc[2] = ((float)(numshades-min(max((globalshade * shadescale)+m->shadeoff,0),numshades)))/((float)numshades); @@ -2248,25 +2248,25 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) if (m->usesalpha) //Sprites with alpha in texture { - // bglEnable(GL_BLEND);// bglBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - // bglEnable(GL_ALPHA_TEST); bglAlphaFunc(GL_GREATER,0.32); + // glEnable(GL_BLEND);// glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + // glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER,0.32); // float al = 0.32; // PLAG : default cutoff removed float al = 0.0; if (alphahackarray[globalpicnum] != 0) al=alphahackarray[globalpicnum] * (1.f/255.f); - bglEnable(GL_BLEND); - bglEnable(GL_ALPHA_TEST); - bglAlphaFunc(GL_GREATER,al); + glEnable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GREATER,al); } else { if ((tspr->cstat&2) || sext->alpha > 0.f || pc[3] < 1.0f) - bglEnable(GL_BLEND); //else bglDisable(GL_BLEND); + glEnable(GL_BLEND); //else glDisable(GL_BLEND); } - bglColor4f(pc[0],pc[1],pc[2],pc[3]); + glColor4f(pc[0],pc[1],pc[2],pc[3]); //if (MFLAGS_NOCONV(m)) - // bglColor4f(0.0f, 0.0f, 1.0f, 1.0f); + // glColor4f(0.0f, 0.0f, 1.0f, 1.0f); //------------ // PLAG: Cleaner model rotation code @@ -2314,8 +2314,8 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) if (++curvbo >= r_vbocount) curvbo = 0; - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, vertvbos[curvbo]); - vbotemp = bglMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + glBindBuffer(GL_ARRAY_BUFFER, vertvbos[curvbo]); + vbotemp = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); vertexhandle = (vec3f_t *)vbotemp; } #endif @@ -2373,25 +2373,25 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) #ifdef USE_GLEXT if (r_vertexarrays && r_vbos) { - bglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glUnmapBuffer(GL_ARRAY_BUFFER); + glBindBuffer(GL_ARRAY_BUFFER, 0); } #endif - bglMatrixMode(GL_MODELVIEW); //Let OpenGL (and perhaps hardware :) handle the matrix rotation - mat[3] = mat[7] = mat[11] = 0.f; mat[15] = 1.f; bglLoadMatrixf(mat); + glMatrixMode(GL_MODELVIEW); //Let OpenGL (and perhaps hardware :) handle the matrix rotation + mat[3] = mat[7] = mat[11] = 0.f; mat[15] = 1.f; glLoadMatrixf(mat); // PLAG: End i = mdloadskin((md2model_t *)m,tile2model[Ptile2tile(tspr->picnum,lpal)].skinnum,globalpal,surfi); if (!i) continue; //i = mdloadskin((md2model *)m,tile2model[Ptile2tile(tspr->picnum,lpal)].skinnum,surfi); //hack for testing multiple surfaces per MD3 - bglBindTexture(GL_TEXTURE_2D, i); + glBindTexture(GL_TEXTURE_2D, i); - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglTranslatef(xpanning, ypanning, 1.0f); - bglMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glTranslatef(xpanning, ypanning, 1.0f); + glMatrixMode(GL_MODELVIEW); if (!(tspr->extra&TSPR_EXTRA_MDHACK)) { @@ -2408,11 +2408,11 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) if ((int32_t) sk->palette == DETAILPAL && sk->skinnum == tile2model[Ptile2tile(tspr->picnum, lpal)].skinnum && sk->surfnum == surfi) f = sk->param; - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglTranslatef(xpanning, ypanning, 1.0f); - bglScalef(f, f, 1.0f); - bglMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glTranslatef(xpanning, ypanning, 1.0f); + glScalef(f, f, 1.0f); + glMatrixMode(GL_MODELVIEW); } i = r_glowmapping ? mdloadskin((md2model_t *) m, tile2model[Ptile2tile(tspr->picnum, lpal)].skinnum, GLOWPAL, surfi) : 0; @@ -2421,16 +2421,16 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) { polymost_setupglowtexture(++texunits, i); - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglTranslatef(xpanning, ypanning, 1.0f); - bglMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glTranslatef(xpanning, ypanning, 1.0f); + glMatrixMode(GL_MODELVIEW); } if (r_vertexarrays && r_vbos) { - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, indexvbos[curvbo]); - vbotemp = bglMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexvbos[curvbo]); + vbotemp = glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); indexhandle = (uint16_t *) vbotemp; } else @@ -2484,8 +2484,8 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) #ifdef USE_GLEXT if (r_vertexarrays && r_vbos) { - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, indexvbos[curvbo]); - vbotemp = bglMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexvbos[curvbo]); + vbotemp = glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); indexhandle = (uint16_t *) vbotemp; } else @@ -2502,88 +2502,88 @@ static int32_t polymost_md3draw(md3model_t *m, const uspritetype *tspr) if (r_vbos) { - bglUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, m->vbos[surfi]); + glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, m->vbos[surfi]); - l = GL_TEXTURE0_ARB; + l = GL_TEXTURE0; do { - bglClientActiveTextureARB(l++); - bglEnableClientState(GL_TEXTURE_COORD_ARRAY); - bglTexCoordPointer(2, GL_FLOAT, 0, 0); + glClientActiveTexture(l++); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 0, 0); } while (l <= texunits); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, vertvbos[curvbo]); - bglVertexPointer(3, GL_FLOAT, 0, 0); + glBindBuffer(GL_ARRAY_BUFFER, vertvbos[curvbo]); + glVertexPointer(3, GL_FLOAT, 0, 0); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, indexvbos[curvbo]); - bglDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_SHORT, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexvbos[curvbo]); + glDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_SHORT, 0); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } else // r_vbos { - l = GL_TEXTURE0_ARB; + l = GL_TEXTURE0; do { - bglClientActiveTextureARB(l++); - bglEnableClientState(GL_TEXTURE_COORD_ARRAY); - bglTexCoordPointer(2, GL_FLOAT, 0, &(s->uv[0].u)); + glClientActiveTexture(l++); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 0, &(s->uv[0].u)); } while (l <= texunits); - bglVertexPointer(3, GL_FLOAT, 0, &(vertlist[0].x)); + glVertexPointer(3, GL_FLOAT, 0, &(vertlist[0].x)); - bglDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_SHORT, m->vindexes); + glDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_SHORT, m->vindexes); } // r_vbos - while (texunits > GL_TEXTURE0_ARB) + while (texunits > GL_TEXTURE0) { - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglMatrixMode(GL_MODELVIEW); - bglTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 1.0f); - bglDisable(GL_TEXTURE_2D); - bglDisableClientState(GL_TEXTURE_COORD_ARRAY); - bglClientActiveTextureARB(texunits - 1); - bglActiveTextureARB(--texunits); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE, 1.0f); + glDisable(GL_TEXTURE_2D); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glClientActiveTexture(texunits - 1); + glActiveTexture(--texunits); } #else - bglEnableClientState(GL_TEXTURE_COORD_ARRAY); - bglTexCoordPointer(2, GL_FLOAT, 0, &(s->uv[0].u)); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 0, &(s->uv[0].u)); - bglVertexPointer(3, GL_FLOAT, 0, &(vertlist[0].x)); + glVertexPointer(3, GL_FLOAT, 0, &(vertlist[0].x)); - bglDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_SHORT, m->vindexes); + glDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_SHORT, m->vindexes); #endif } #ifdef USE_GLEXT else // r_vertexarrays { - while (texunits > GL_TEXTURE0_ARB) + while (texunits > GL_TEXTURE0) { - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglMatrixMode(GL_MODELVIEW); - bglTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 1.0f); - bglDisable(GL_TEXTURE_2D); - bglActiveTextureARB(--texunits); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE, 1.0f); + glDisable(GL_TEXTURE_2D); + glActiveTexture(--texunits); } } // r_vertexarrays #endif } //------------ - if (m->usesalpha) bglDisable(GL_ALPHA_TEST); + if (m->usesalpha) glDisable(GL_ALPHA_TEST); - bglDisable(GL_CULL_FACE); -// bglPopAttrib(); + glDisable(GL_CULL_FACE); +// glPopAttrib(); - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglMatrixMode(GL_MODELVIEW); - bglLoadIdentity(); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); polymost_resetVertexPointers(); @@ -2634,7 +2634,7 @@ static void md3free(md3model_t *m) #ifdef USE_GLEXT if (m->vbos) { - bglDeleteBuffersARB(m->head.numsurfs, m->vbos); + glDeleteBuffers(m->head.numsurfs, m->vbos); DO_FREE_AND_NULL(m->vbos); } #endif @@ -2711,21 +2711,21 @@ void md_allocvbos(void) if (r_vbocount != allocvbos) { - bglGenBuffersARB(r_vbocount - allocvbos, &(indexvbos[allocvbos])); - bglGenBuffersARB(r_vbocount - allocvbos, &(vertvbos[allocvbos])); + glGenBuffers(r_vbocount - allocvbos, &(indexvbos[allocvbos])); + glGenBuffers(r_vbocount - allocvbos, &(vertvbos[allocvbos])); i = allocvbos; while (i < r_vbocount) { - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, indexvbos[i]); - bglBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, maxmodeltris * 3 * sizeof(uint16_t), NULL, GL_STREAM_DRAW_ARB); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, vertvbos[i]); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, maxmodelverts * sizeof(vec3f_t), NULL, GL_STREAM_DRAW_ARB); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexvbos[i]); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, maxmodeltris * 3 * sizeof(uint16_t), NULL, GL_STREAM_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, vertvbos[i]); + glBufferData(GL_ARRAY_BUFFER, maxmodelverts * sizeof(vec3f_t), NULL, GL_STREAM_DRAW); i++; } - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); allocvbos = r_vbocount; } diff --git a/source/build/src/palette.cpp b/source/build/src/palette.cpp index 6de6fd50b..276fb9c29 100644 --- a/source/build/src/palette.cpp +++ b/source/build/src/palette.cpp @@ -502,12 +502,12 @@ void handle_blend(uint8_t enable, uint8_t blend, uint8_t def) if (!enable) { - bglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); return; } glblenddef_t const * const glbdef = glblend[blend].def + def; - bglBlendFunc(blendFuncTokens[glbdef->src], blendFuncTokens[glbdef->dst]); + glBlendFunc(blendFuncTokens[glbdef->src], blendFuncTokens[glbdef->dst]); } #endif diff --git a/source/build/src/polymer.cpp b/source/build/src/polymer.cpp index 9efdd43a0..7164928d7 100644 --- a/source/build/src/polymer.cpp +++ b/source/build/src/polymer.cpp @@ -52,8 +52,8 @@ int32_t pr_nullrender = 0; // 1: no draw, 2: no draw or updates int32_t r_pr_maxlightpasses = 5; // value of the cvar (not live value), used to detect changes -GLenum mapvbousage = GL_STREAM_DRAW_ARB; -GLenum modelvbousage = GL_STATIC_DRAW_ARB; +GLenum mapvbousage = GL_STREAM_DRAW; +GLenum modelvbousage = GL_STATIC_DRAW; // BUILD DATA _prsector *prsectors[MAXSECTORS]; @@ -70,14 +70,14 @@ GLuint prbasepalmaps[MAXBASEPALS]; GLuint prlookups[MAXPALOOKUPS]; GLuint prmapvbo; -const GLsizeiptrARB proneplanesize = sizeof(_prvert) * 4; -const GLintptrARB prwalldatasize = sizeof(_prvert)* 4 * 3; // wall, over and mask planes for every wall -GLintptrARB prwalldataoffset; +const GLsizeiptr proneplanesize = sizeof(_prvert) * 4; +const GLintptr prwalldatasize = sizeof(_prvert)* 4 * 3; // wall, over and mask planes for every wall +GLintptr prwalldataoffset; GLuint prindexringvbo; GLuint *prindexring; -const GLsizeiptrARB prindexringsize = 65535; -GLintptrARB prindexringoffset; +const GLsizeiptr prindexringsize = 65535; +GLintptr prindexringoffset; const GLbitfield prindexringmapflags = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT; @@ -819,9 +819,9 @@ int32_t polymer_init(void) { if (prhighpalookups[i][j].data) { - bglGenTextures(1, &prhighpalookups[i][j].map); - bglBindTexture(GL_TEXTURE_3D, prhighpalookups[i][j].map); - bglTexImage3D(GL_TEXTURE_3D, // target + glGenTextures(1, &prhighpalookups[i][j].map); + glBindTexture(GL_TEXTURE_3D, prhighpalookups[i][j].map); + glTexImage3D(GL_TEXTURE_3D, // target 0, // mip level GL_RGBA, // internalFormat PR_HIGHPALOOKUP_DIM, // width @@ -831,12 +831,12 @@ int32_t polymer_init(void) GL_BGRA, // upload format GL_UNSIGNED_BYTE, // upload component type prhighpalookups[i][j].data); // data pointer - bglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - bglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - bglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); - bglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); - bglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); - bglBindTexture(GL_TEXTURE_3D, 0); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glBindTexture(GL_TEXTURE_3D, 0); } j++; } @@ -846,9 +846,9 @@ int32_t polymer_init(void) #ifndef __APPLE__ if (glinfo.debugoutput) { // Enable everything. - bglDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE); - bglDebugMessageCallbackARB((GLDEBUGPROCARB)polymer_debugoutputcallback, NULL); - bglEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB); + glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE); + glDebugMessageCallbackARB((GLDEBUGPROCARB)polymer_debugoutputcallback, NULL); + glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB); } #endif @@ -881,7 +881,7 @@ void polymer_uninit(void) // DO_FREE_AND_NULL(prhighpalookups[i][j].data); // } if (prhighpalookups[i][j].map) { - bglDeleteTextures(1, &prhighpalookups[i][j].map); + glDeleteTextures(1, &prhighpalookups[i][j].map); prhighpalookups[i][j].map = 0; } j++; @@ -914,47 +914,47 @@ void polymer_setaspect(int32_t ang) aspect = (float)(windowxy2.x-windowxy1.x+1) / (float)(windowxy2.y-windowxy1.y+1); - bglMatrixMode(GL_PROJECTION); - bglLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); bgluPerspective(fang * (360.f/2048.f), aspect, 0.01f, 100.0f); } void polymer_glinit(void) { - bglClearColor(0.0f, 0.0f, 0.0f, 1.0f); - bglClearStencil(0); - bglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - bglViewport(windowxy1.x, yres-(windowxy2.y+1),windowxy2.x-windowxy1.x+1, windowxy2.y-windowxy1.y+1); + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClearStencil(0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + glViewport(windowxy1.x, yres-(windowxy2.y+1),windowxy2.x-windowxy1.x+1, windowxy2.y-windowxy1.y+1); // texturing - bglEnable(GL_TEXTURE_2D); + glEnable(GL_TEXTURE_2D); - bglEnable(GL_DEPTH_TEST); - bglDepthFunc(GL_LEQUAL); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); - bglDisable(GL_BLEND); - bglDisable(GL_ALPHA_TEST); + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); if (pr_wireframe) - bglPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); else - bglPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); polymer_setaspect(pr_fov); - bglMatrixMode(GL_MODELVIEW); - bglLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); - bglEnableClientState(GL_VERTEX_ARRAY); - bglEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); - bglDisable(GL_FOG); + glDisable(GL_FOG); culledface = GL_BACK; - bglCullFace(GL_BACK); - bglFrontFace(GL_CCW); + glCullFace(GL_BACK); + glFrontFace(GL_CCW); - bglEnable(GL_CULL_FACE); + glEnable(GL_CULL_FACE); } void polymer_resetlights(void) @@ -1018,21 +1018,21 @@ void polymer_loadboard(void) // in the big map buffer, sectors have floor and ceiling vertices for each wall first, then walls prwalldataoffset = numwalls * 2 * sizeof(_prvert); - bglGenBuffersARB(1, &prmapvbo); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, prmapvbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, prwalldataoffset + (numwalls * prwalldatasize), NULL, mapvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glGenBuffers(1, &prmapvbo); + glBindBuffer(GL_ARRAY_BUFFER, prmapvbo); + glBufferData(GL_ARRAY_BUFFER, prwalldataoffset + (numwalls * prwalldatasize), NULL, mapvbousage); + glBindBuffer(GL_ARRAY_BUFFER, 0); - bglGenBuffersARB(1, &prindexringvbo); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, prindexringvbo); + glGenBuffers(1, &prindexringvbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, prindexringvbo); if (pr_buckets) { - bglBufferStorage(GL_ELEMENT_ARRAY_BUFFER, prindexringsize * sizeof(GLuint), NULL, prindexringmapflags | GL_DYNAMIC_STORAGE_BIT); - prindexring = (GLuint*)bglMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, prindexringsize * sizeof(GLuint), prindexringmapflags); + glBufferStorage(GL_ELEMENT_ARRAY_BUFFER, prindexringsize * sizeof(GLuint), NULL, prindexringmapflags | GL_DYNAMIC_STORAGE_BIT); + prindexring = (GLuint*)glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, prindexringsize * sizeof(GLuint), prindexringmapflags); } - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); i = 0; while (i < numsectors) @@ -1114,31 +1114,31 @@ void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t da if (!pth || !(pth->flags & PTH_SKYBOX)) skyhoriz *= curskyangmul; - bglMatrixMode(GL_MODELVIEW); - bglLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); - bglRotatef(tiltang, 0.0f, 0.0f, -1.0f); - bglRotatef(skyhoriz, 1.0f, 0.0f, 0.0f); - bglRotatef(ang, 0.0f, 1.0f, 0.0f); + glRotatef(tiltang, 0.0f, 0.0f, -1.0f); + glRotatef(skyhoriz, 1.0f, 0.0f, 0.0f); + glRotatef(ang, 0.0f, 1.0f, 0.0f); - bglScalef(1.0f / 1000.0f, 1.0f / 1000.0f, 1.0f / 1000.0f); - bglTranslatef(-pos[0], -pos[1], -pos[2]); + glScalef(1.0f / 1000.0f, 1.0f / 1000.0f, 1.0f / 1000.0f); + glTranslatef(-pos[0], -pos[1], -pos[2]); - bglGetFloatv(GL_MODELVIEW_MATRIX, rootskymodelviewmatrix); + glGetFloatv(GL_MODELVIEW_MATRIX, rootskymodelviewmatrix); curskymodelviewmatrix = rootskymodelviewmatrix; - bglMatrixMode(GL_MODELVIEW); - bglLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); - bglRotatef(tiltang, 0.0f, 0.0f, -1.0f); - bglRotatef(horizang, 1.0f, 0.0f, 0.0f); - bglRotatef(ang, 0.0f, 1.0f, 0.0f); + glRotatef(tiltang, 0.0f, 0.0f, -1.0f); + glRotatef(horizang, 1.0f, 0.0f, 0.0f); + glRotatef(ang, 0.0f, 1.0f, 0.0f); - bglScalef(1.0f / 1000.0f, 1.0f / 1000.0f, 1.0f / 1000.0f); - bglTranslatef(-pos[0], -pos[1], -pos[2]); + glScalef(1.0f / 1000.0f, 1.0f / 1000.0f, 1.0f / 1000.0f); + glTranslatef(-pos[0], -pos[1], -pos[2]); - bglGetFloatv(GL_MODELVIEW_MATRIX, rootmodelviewmatrix); + glGetFloatv(GL_MODELVIEW_MATRIX, rootmodelviewmatrix); cursectnum = dacursectnum; updatesectorbreadth(daposx, daposy, &cursectnum); @@ -1240,9 +1240,9 @@ void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t da void polymer_drawmasks(void) { - bglEnable(GL_ALPHA_TEST); - bglEnable(GL_BLEND); -// bglEnable(GL_POLYGON_OFFSET_FILL); + glEnable(GL_ALPHA_TEST); + glEnable(GL_BLEND); +// glEnable(GL_POLYGON_OFFSET_FILL); // while (--spritesortcnt) // { @@ -1250,7 +1250,7 @@ void polymer_drawmasks(void) // polymer_drawsprite(spritesortcnt); // } - bglEnable(GL_CULL_FACE); + glEnable(GL_CULL_FACE); if (cursectormaskcount) { // We (kind of) queue sector masks near to far, so drawing them in reverse @@ -1268,11 +1268,11 @@ void polymer_drawmasks(void) DO_FREE_AND_NULL(cursectormasks); } - bglDisable(GL_CULL_FACE); + glDisable(GL_CULL_FACE); -// bglDisable(GL_POLYGON_OFFSET_FILL); - bglDisable(GL_BLEND); - bglDisable(GL_ALPHA_TEST); +// glDisable(GL_POLYGON_OFFSET_FILL); + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); } void polymer_editorpick(void) @@ -1280,7 +1280,7 @@ void polymer_editorpick(void) GLubyte picked[3]; int16_t num; - bglReadPixels(searchx, ydim - searchy, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, picked); + glReadPixels(searchx, ydim - searchy, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, picked); num = B_UNBUF16(&picked[1]); @@ -1327,11 +1327,11 @@ void polymer_editorpick(void) GLfloat t, svcoeff, p[2]; GLfloat *pl; - bglGetDoublev(GL_MODELVIEW_MATRIX, model); - bglGetDoublev(GL_PROJECTION_MATRIX, proj); - bglGetIntegerv(GL_VIEWPORT, view); + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + glGetIntegerv(GL_VIEWPORT, view); - bglReadPixels(searchx, ydim-searchy, 1,1, GL_DEPTH_COMPONENT, GL_FLOAT, &dadepth); + glReadPixels(searchx, ydim-searchy, 1,1, GL_DEPTH_COMPONENT, GL_FLOAT, &dadepth); bgluUnProject(searchx, ydim-searchy, dadepth, model, proj, view, &x, &y, &z); bgluUnProject(searchx, ydim-searchy, 0.0, model, proj, view, &scrx, &scry, &scrz); @@ -1467,7 +1467,7 @@ void polymer_drawmaskwall(int32_t damaskwallcnt) wal = &wall[maskwall[damaskwallcnt]]; w = prwalls[maskwall[damaskwallcnt]]; - bglEnable(GL_CULL_FACE); + glEnable(GL_CULL_FACE); if (searchit == 2) { polymer_drawsearchplane(&w->mask, oldcolor, 0x04, (GLubyte *)&maskwall[damaskwallcnt]); @@ -1476,7 +1476,7 @@ void polymer_drawmaskwall(int32_t damaskwallcnt) polymer_drawplane(&w->mask); } - bglDisable(GL_CULL_FACE); + glDisable(GL_CULL_FACE); } void polymer_drawsprite(int32_t snum) @@ -1508,11 +1508,11 @@ void polymer_drawsprite(int32_t snum) tile2model[Ptile2tile(tspr->picnum,tspr->pal)].framenum >= 0 && !(spriteext[tspr->owner].flags & SPREXT_NOTMD)) { - bglEnable(GL_CULL_FACE); + glEnable(GL_CULL_FACE); SWITCH_CULL_DIRECTION; polymer_drawmdsprite(tspr); SWITCH_CULL_DIRECTION; - bglDisable(GL_CULL_FACE); + glDisable(GL_CULL_FACE); return; } @@ -1546,12 +1546,12 @@ void polymer_drawsprite(int32_t snum) case 1: prsectors[tspr->sectnum]->wallsproffset += 0.5f; if (!depth || mirrors[depth-1].plane) - bglPolygonOffset(-1.0f, -1.0f); + glPolygonOffset(-1.0f, -1.0f); break; case 2: prsectors[tspr->sectnum]->floorsproffset += 0.5f; if (!depth || mirrors[depth-1].plane) - bglPolygonOffset(-1.0f, -1.0f); + glPolygonOffset(-1.0f, -1.0f); break; } @@ -1590,22 +1590,22 @@ void polymer_drawsprite(int32_t snum) { if ((tspr->cstat & SPR_ALIGN_MASK)==SPR_FLOOR && (tspr->cstat & SPR_YFLIP)) SWITCH_CULL_DIRECTION; - bglEnable(GL_CULL_FACE); + glEnable(GL_CULL_FACE); } if ((!depth || mirrors[depth-1].plane) && !pr_ati_nodepthoffset) - bglEnable(GL_POLYGON_OFFSET_FILL); + glEnable(GL_POLYGON_OFFSET_FILL); polymer_drawplane(&s->plane); if ((!depth || mirrors[depth-1].plane) && !pr_ati_nodepthoffset) - bglDisable(GL_POLYGON_OFFSET_FILL); + glDisable(GL_POLYGON_OFFSET_FILL); if ((tspr->cstat & 64) && (tspr->cstat & SPR_ALIGN_MASK)) { if ((tspr->cstat & SPR_ALIGN_MASK)==SPR_FLOOR && (tspr->cstat & SPR_YFLIP)) SWITCH_CULL_DIRECTION; - bglDisable(GL_CULL_FACE); + glDisable(GL_CULL_FACE); } } @@ -1778,8 +1778,8 @@ static void polymer_displayrooms(const int16_t dacursectnum) float coeff; curmodelviewmatrix = localmodelviewmatrix; - bglGetFloatv(GL_MODELVIEW_MATRIX, localmodelviewmatrix); - bglGetFloatv(GL_PROJECTION_MATRIX, localprojectionmatrix); + glGetFloatv(GL_MODELVIEW_MATRIX, localmodelviewmatrix); + glGetFloatv(GL_PROJECTION_MATRIX, localprojectionmatrix); polymer_extractfrustum(localmodelviewmatrix, localprojectionmatrix, frustum); @@ -1801,10 +1801,10 @@ static void polymer_displayrooms(const int16_t dacursectnum) cursectormasks = localsectormasks; cursectormaskcount = localsectormaskcount; - bglDisable(GL_DEPTH_TEST); - bglColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glDisable(GL_DEPTH_TEST); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); polymer_drawsky(cursky, curskypal, curskyshade); - bglEnable(GL_DEPTH_TEST); + glEnable(GL_DEPTH_TEST); // depth-only occlusion testing pass // overridematerial = 0; @@ -1897,11 +1897,11 @@ static void polymer_displayrooms(const int16_t dacursectnum) w = prwalls[sec->wallptr + i]; - bglColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - bglDepthMask(GL_FALSE); + glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); + glDepthMask(GL_FALSE); - bglGenQueriesARB(1, &queryid[sec->wallptr + i]); - bglBeginQueryARB(GL_SAMPLES_PASSED_ARB, queryid[sec->wallptr + i]); + glGenQueries(1, &queryid[sec->wallptr + i]); + glBeginQuery(GL_SAMPLES_PASSED, queryid[sec->wallptr + i]); oldoverridematerial = overridematerial; overridematerial = 0; @@ -1914,10 +1914,10 @@ static void polymer_displayrooms(const int16_t dacursectnum) overridematerial = oldoverridematerial; - bglEndQueryARB(GL_SAMPLES_PASSED_ARB); + glEndQuery(GL_SAMPLES_PASSED); - bglDepthMask(GL_TRUE); - bglColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + glDepthMask(GL_TRUE); + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); } } else queryid[sec->wallptr + i] = 0xFFFFFFFF; @@ -1974,10 +1974,10 @@ static void polymer_displayrooms(const int16_t dacursectnum) result = 0; if (doquery && (queryid[sec->wallptr + i] != 0xFFFFFFFF)) { - bglGetQueryObjectivARB(queryid[sec->wallptr + i], - GL_QUERY_RESULT_ARB, + glGetQueryObjectiv(queryid[sec->wallptr + i], + GL_QUERY_RESULT, &result); - bglDeleteQueriesARB(1, &queryid[sec->wallptr + i]); + glDeleteQueries(1, &queryid[sec->wallptr + i]); } else if (queryid[sec->wallptr + i] == 0xFFFFFFFF) result = 1; @@ -1991,7 +1991,7 @@ static void polymer_displayrooms(const int16_t dacursectnum) } else if (queryid[sec->wallptr + i] && queryid[sec->wallptr + i] != 0xFFFFFFFF) { - bglDeleteQueriesARB(1, &queryid[sec->wallptr + i]); + glDeleteQueries(1, &queryid[sec->wallptr + i]); queryid[sec->wallptr + i] = 0; } } @@ -2027,27 +2027,27 @@ static void polymer_displayrooms(const int16_t dacursectnum) i = mirrorcount-1; while (i >= 0) { - bglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prrts[0].fbo); - bglPushAttrib(GL_VIEWPORT_BIT); - bglViewport(windowxy1.x, yres-(windowxy2.y+1),windowxy2.x-windowxy1.x+1, windowxy2.y-windowxy1.y+1); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prrts[0].fbo); + glPushAttrib(GL_VIEWPORT_BIT); + glViewport(windowxy1.x, yres-(windowxy2.y+1),windowxy2.x-windowxy1.x+1, windowxy2.y-windowxy1.y+1); - bglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Bmemcpy(localskymodelviewmatrix, curskymodelviewmatrix, sizeof(GLfloat) * 16); curskymodelviewmatrix = localskymodelviewmatrix; - bglMatrixMode(GL_MODELVIEW); - bglPushMatrix(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); plane[0] = mirrorlist[i].plane->plane[0]; plane[1] = mirrorlist[i].plane->plane[1]; plane[2] = mirrorlist[i].plane->plane[2]; plane[3] = mirrorlist[i].plane->plane[3]; - bglClipPlane(GL_CLIP_PLANE0, plane); + glClipPlane(GL_CLIP_PLANE0, plane); polymer_inb4mirror(mirrorlist[i].plane->buffer, mirrorlist[i].plane->plane); SWITCH_CULL_DIRECTION; - //bglEnable(GL_CLIP_PLANE0); + //glEnable(GL_CLIP_PLANE0); if (mirrorlist[i].wallnum >= 0) preparemirror(globalposx, globalposy, globalang, @@ -2089,13 +2089,13 @@ static void polymer_displayrooms(const int16_t dacursectnum) set_globalpos(gx, gy, gz); - bglDisable(GL_CLIP_PLANE0); + glDisable(GL_CLIP_PLANE0); SWITCH_CULL_DIRECTION; - bglMatrixMode(GL_MODELVIEW); - bglPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); - bglPopAttrib(); - bglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glPopAttrib(); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); mirrorlist[i].plane->material.mirrormap = prrts[0].color; polymer_drawplane(mirrorlist[i].plane); @@ -2119,9 +2119,9 @@ static void polymer_displayrooms(const int16_t dacursectnum) if (mirrors[depth - 1].plane) display_mirror = 0; - bglDisable(GL_CULL_FACE); + glDisable(GL_CULL_FACE); drawmasks(); - bglEnable(GL_CULL_FACE); + glEnable(GL_CULL_FACE); } return; } @@ -2133,11 +2133,11 @@ static void polymer_emptybuckets(void) if (pr_buckets == 0) return; - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, prmapvbo); - bglVertexPointer(3, GL_FLOAT, sizeof(_prvert), NULL); - bglTexCoordPointer(2, GL_FLOAT, sizeof(_prvert), (GLvoid *)(3 * sizeof(GLfloat))); + glBindBuffer(GL_ARRAY_BUFFER, prmapvbo); + glVertexPointer(3, GL_FLOAT, sizeof(_prvert), NULL); + glTexCoordPointer(2, GL_FLOAT, sizeof(_prvert), (GLvoid *)(3 * sizeof(GLfloat))); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, prindexringvbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, prindexringvbo); uint32_t indexcount = 0; while (bucket != NULL) @@ -2150,8 +2150,8 @@ static void polymer_emptybuckets(void) // ensure space in index ring, wrap otherwise if (indexcount + prindexringoffset >= (unsigned)prindexringsize) { - bglUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER); - prindexring = (GLuint *)bglMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, prindexringsize * sizeof(GLuint), GL_MAP_INVALIDATE_BUFFER_BIT | prindexringmapflags); + glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); + prindexring = (GLuint *)glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, prindexringsize * sizeof(GLuint), GL_MAP_INVALIDATE_BUFFER_BIT | prindexringmapflags); prindexringoffset = 0; } @@ -2187,7 +2187,7 @@ static void polymer_emptybuckets(void) int32_t materialbits = polymer_bindmaterial(&bucket->material, NULL, 0); - bglDrawElements(GL_TRIANGLES, bucket->count, GL_UNSIGNED_INT, bucket->indiceoffset); + glDrawElements(GL_TRIANGLES, bucket->count, GL_UNSIGNED_INT, bucket->indiceoffset); polymer_unbindmaterial(materialbits); @@ -2196,8 +2196,8 @@ static void polymer_emptybuckets(void) bucket = bucket->next; } - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); prcanbucket = 0; } @@ -2291,44 +2291,44 @@ static void polymer_drawplane(_prplane* plane) if (pr_nullrender >= 1) return; // debug code for drawing plane inverse TBN -// bglDisable(GL_TEXTURE_2D); -// bglBegin(GL_LINES); -// bglColor4f(1.0, 0.0, 0.0, 1.0); -// bglVertex3f(plane->buffer[0], +// glDisable(GL_TEXTURE_2D); +// glBegin(GL_LINES); +// glColor4f(1.0, 0.0, 0.0, 1.0); +// glVertex3f(plane->buffer[0], // plane->buffer[1], // plane->buffer[2]); -// bglVertex3f(plane->buffer[0] + plane->t[0] * 50, +// glVertex3f(plane->buffer[0] + plane->t[0] * 50, // plane->buffer[1] + plane->t[1] * 50, // plane->buffer[2] + plane->t[2] * 50); -// bglColor4f(0.0, 1.0, 0.0, 1.0); -// bglVertex3f(plane->buffer[0], +// glColor4f(0.0, 1.0, 0.0, 1.0); +// glVertex3f(plane->buffer[0], // plane->buffer[1], // plane->buffer[2]); -// bglVertex3f(plane->buffer[0] + plane->b[0] * 50, +// glVertex3f(plane->buffer[0] + plane->b[0] * 50, // plane->buffer[1] + plane->b[1] * 50, // plane->buffer[2] + plane->b[2] * 50); -// bglColor4f(0.0, 0.0, 1.0, 1.0); -// bglVertex3f(plane->buffer[0], +// glColor4f(0.0, 0.0, 1.0, 1.0); +// glVertex3f(plane->buffer[0], // plane->buffer[1], // plane->buffer[2]); -// bglVertex3f(plane->buffer[0] + plane->n[0] * 50, +// glVertex3f(plane->buffer[0] + plane->n[0] * 50, // plane->buffer[1] + plane->n[1] * 50, // plane->buffer[2] + plane->n[2] * 50); -// bglEnd(); -// bglEnable(GL_TEXTURE_2D); +// glEnd(); +// glEnable(GL_TEXTURE_2D); // debug code for drawing plane normals -// bglDisable(GL_TEXTURE_2D); -// bglBegin(GL_LINES); -// bglColor4f(1.0, 1.0, 1.0, 1.0); -// bglVertex3f(plane->buffer[0], +// glDisable(GL_TEXTURE_2D); +// glBegin(GL_LINES); +// glColor4f(1.0, 1.0, 1.0, 1.0); +// glVertex3f(plane->buffer[0], // plane->buffer[1], // plane->buffer[2]); -// bglVertex3f(plane->buffer[0] + plane->plane[0] * 50, +// glVertex3f(plane->buffer[0] + plane->plane[0] * 50, // plane->buffer[1] + plane->plane[1] * 50, // plane->buffer[2] + plane->plane[2] * 50); -// bglEnd(); -// bglEnable(GL_TEXTURE_2D); +// glEnd(); +// glEnable(GL_TEXTURE_2D); if (pr_buckets && pr_vbos > 0 && prcanbucket && plane->bucket) { @@ -2336,10 +2336,10 @@ static void polymer_drawplane(_prplane* plane) return; } - bglNormal3f((float)(plane->plane[0]), (float)(plane->plane[1]), (float)(plane->plane[2])); + glNormal3f((float)(plane->plane[0]), (float)(plane->plane[1]), (float)(plane->plane[2])); GLuint planevbo; - GLintptrARB geomfbooffset; + GLintptr geomfbooffset; if (plane->mapvbo_vertoffset != (uint32_t)-1) { @@ -2354,14 +2354,14 @@ static void polymer_drawplane(_prplane* plane) if (planevbo && (pr_vbos > 0)) { - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, planevbo); - bglVertexPointer(3, GL_FLOAT, sizeof(_prvert), (GLvoid *)(geomfbooffset)); - bglTexCoordPointer(2, GL_FLOAT, sizeof(_prvert), (GLvoid *)(geomfbooffset + (3 * sizeof(GLfloat)))); + glBindBuffer(GL_ARRAY_BUFFER, planevbo); + glVertexPointer(3, GL_FLOAT, sizeof(_prvert), (GLvoid *)(geomfbooffset)); + glTexCoordPointer(2, GL_FLOAT, sizeof(_prvert), (GLvoid *)(geomfbooffset + (3 * sizeof(GLfloat)))); if (plane->indices) - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, plane->ivbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, plane->ivbo); } else { - bglVertexPointer(3, GL_FLOAT, sizeof(_prvert), &plane->buffer->x); - bglTexCoordPointer(2, GL_FLOAT, sizeof(_prvert), &plane->buffer->u); + glVertexPointer(3, GL_FLOAT, sizeof(_prvert), &plane->buffer->x); + glTexCoordPointer(2, GL_FLOAT, sizeof(_prvert), &plane->buffer->u); } curlight = 0; @@ -2370,19 +2370,19 @@ static void polymer_drawplane(_prplane* plane) if (materialbits & prprogrambits[PR_BIT_NORMAL_MAP].bit) { - bglVertexAttrib3fvARB(prprograms[materialbits].attrib_T, &plane->tbn[0][0]); - bglVertexAttrib3fvARB(prprograms[materialbits].attrib_B, &plane->tbn[1][0]); - bglVertexAttrib3fvARB(prprograms[materialbits].attrib_N, &plane->tbn[2][0]); + glVertexAttrib3fv(prprograms[materialbits].attrib_T, &plane->tbn[0][0]); + glVertexAttrib3fv(prprograms[materialbits].attrib_B, &plane->tbn[1][0]); + glVertexAttrib3fv(prprograms[materialbits].attrib_N, &plane->tbn[2][0]); } if (plane->indices) { if (planevbo && (pr_vbos > 0)) - bglDrawElements(GL_TRIANGLES, plane->indicescount, GL_UNSIGNED_SHORT, NULL); + glDrawElements(GL_TRIANGLES, plane->indicescount, GL_UNSIGNED_SHORT, NULL); else - bglDrawElements(GL_TRIANGLES, plane->indicescount, GL_UNSIGNED_SHORT, plane->indices); + glDrawElements(GL_TRIANGLES, plane->indicescount, GL_UNSIGNED_SHORT, plane->indices); } else - bglDrawArrays(GL_QUADS, 0, 4); + glDrawArrays(GL_QUADS, 0, 4); polymer_unbindmaterial(materialbits); @@ -2394,9 +2394,9 @@ static void polymer_drawplane(_prplane* plane) if (planevbo && (pr_vbos > 0)) { - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); if (plane->indices) - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } } @@ -2429,13 +2429,13 @@ static inline void polymer_inb4mirror(_prvert* buffer, GLfloat* plane) reflectionmatrix[14] = 2 * pv * plane[2]; reflectionmatrix[15] = 1; - bglMultMatrixf(reflectionmatrix); + glMultMatrixf(reflectionmatrix); - bglPushMatrix(); - bglLoadMatrixf(curskymodelviewmatrix); - bglMultMatrixf(reflectionmatrix); - bglGetFloatv(GL_MODELVIEW_MATRIX, curskymodelviewmatrix); - bglPopMatrix(); + glPushMatrix(); + glLoadMatrixf(curskymodelviewmatrix); + glMultMatrixf(reflectionmatrix); + glGetFloatv(GL_MODELVIEW_MATRIX, curskymodelviewmatrix); + glPopMatrix(); } static void polymer_animatesprites(void) @@ -2458,10 +2458,10 @@ static void polymer_freeboard(void) Bfree(prsectors[i]->ceil.buffer); Bfree(prsectors[i]->floor.indices); Bfree(prsectors[i]->ceil.indices); - if (prsectors[i]->ceil.vbo) bglDeleteBuffersARB(1, &prsectors[i]->ceil.vbo); - if (prsectors[i]->ceil.ivbo) bglDeleteBuffersARB(1, &prsectors[i]->ceil.ivbo); - if (prsectors[i]->floor.vbo) bglDeleteBuffersARB(1, &prsectors[i]->floor.vbo); - if (prsectors[i]->floor.ivbo) bglDeleteBuffersARB(1, &prsectors[i]->floor.ivbo); + if (prsectors[i]->ceil.vbo) glDeleteBuffers(1, &prsectors[i]->ceil.vbo); + if (prsectors[i]->ceil.ivbo) glDeleteBuffers(1, &prsectors[i]->ceil.ivbo); + if (prsectors[i]->floor.vbo) glDeleteBuffers(1, &prsectors[i]->floor.vbo); + if (prsectors[i]->floor.ivbo) glDeleteBuffers(1, &prsectors[i]->floor.ivbo); DO_FREE_AND_NULL(prsectors[i]); } @@ -2479,10 +2479,10 @@ static void polymer_freeboard(void) Bfree(prwalls[i]->over.buffer); // Bfree(prwalls[i]->cap); Bfree(prwalls[i]->wall.buffer); - if (prwalls[i]->wall.vbo) bglDeleteBuffersARB(1, &prwalls[i]->wall.vbo); - if (prwalls[i]->over.vbo) bglDeleteBuffersARB(1, &prwalls[i]->over.vbo); - if (prwalls[i]->mask.vbo) bglDeleteBuffersARB(1, &prwalls[i]->mask.vbo); - if (prwalls[i]->stuffvbo) bglDeleteBuffersARB(1, &prwalls[i]->stuffvbo); + if (prwalls[i]->wall.vbo) glDeleteBuffers(1, &prwalls[i]->wall.vbo); + if (prwalls[i]->over.vbo) glDeleteBuffers(1, &prwalls[i]->over.vbo); + if (prwalls[i]->mask.vbo) glDeleteBuffers(1, &prwalls[i]->mask.vbo); + if (prwalls[i]->stuffvbo) glDeleteBuffers(1, &prwalls[i]->stuffvbo); DO_FREE_AND_NULL(prwalls[i]); } @@ -2496,7 +2496,7 @@ static void polymer_freeboard(void) if (prsprites[i]) { Bfree(prsprites[i]->plane.buffer); - if (prsprites[i]->plane.vbo) bglDeleteBuffersARB(1, &prsprites[i]->plane.vbo); + if (prsprites[i]->plane.vbo) glDeleteBuffers(1, &prsprites[i]->plane.vbo); DO_FREE_AND_NULL(prsprites[i]); } @@ -2515,7 +2515,7 @@ static void polymer_freeboard(void) { if (prbasepalmaps[i]) { - bglDeleteTextures(1, &prbasepalmaps[i]); + glDeleteTextures(1, &prbasepalmaps[i]); prbasepalmaps[i] = 0; } @@ -2527,7 +2527,7 @@ static void polymer_freeboard(void) { if (prlookups[i]) { - bglDeleteTextures(1, &prlookups[i]); + glDeleteTextures(1, &prlookups[i]); prlookups[i] = 0; } @@ -2552,18 +2552,18 @@ static int32_t polymer_initsector(int16_t sectnum) s->ceil.buffer = (_prvert *)Xcalloc(sec->wallnum, sizeof(_prvert)); s->ceil.vertcount = sec->wallnum; - bglGenBuffersARB(1, &s->floor.vbo); - bglGenBuffersARB(1, &s->ceil.vbo); - bglGenBuffersARB(1, &s->floor.ivbo); - bglGenBuffersARB(1, &s->ceil.ivbo); + glGenBuffers(1, &s->floor.vbo); + glGenBuffers(1, &s->ceil.vbo); + glGenBuffers(1, &s->floor.ivbo); + glGenBuffers(1, &s->ceil.ivbo); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, s->floor.vbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, sec->wallnum * sizeof(GLfloat) * 5, NULL, mapvbousage); + glBindBuffer(GL_ARRAY_BUFFER, s->floor.vbo); + glBufferData(GL_ARRAY_BUFFER, sec->wallnum * sizeof(GLfloat) * 5, NULL, mapvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, s->ceil.vbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, sec->wallnum * sizeof(GLfloat) * 5, NULL, mapvbousage); + glBindBuffer(GL_ARRAY_BUFFER, s->ceil.vbo); + glBufferData(GL_ARRAY_BUFFER, sec->wallnum * sizeof(GLfloat) * 5, NULL, mapvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); s->flags.empty = 1; // let updatesector know that everything needs to go @@ -2773,23 +2773,23 @@ attributes: { if (pr_nullrender < 2) { - /*bglBindBufferARB(GL_ARRAY_BUFFER_ARB, s->floor.vbo); - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sec->wallnum * sizeof(GLfloat)* 5, s->floor.buffer); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, s->ceil.vbo); - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sec->wallnum * sizeof(GLfloat)* 5, s->ceil.buffer); + /*glBindBuffer(GL_ARRAY_BUFFER, s->floor.vbo); + glBufferSubData(GL_ARRAY_BUFFER, 0, sec->wallnum * sizeof(GLfloat)* 5, s->floor.buffer); + glBindBuffer(GL_ARRAY_BUFFER, s->ceil.vbo); + glBufferSubData(GL_ARRAY_BUFFER, 0, sec->wallnum * sizeof(GLfloat)* 5, s->ceil.buffer); */ s->floor.mapvbo_vertoffset = sec->wallptr * 2; s->ceil.mapvbo_vertoffset = s->floor.mapvbo_vertoffset + sec->wallnum; - GLintptrARB sector_offset = s->floor.mapvbo_vertoffset * sizeof(_prvert); - GLsizeiptrARB cur_sector_size = sec->wallnum * sizeof(_prvert); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, prmapvbo); + GLintptr sector_offset = s->floor.mapvbo_vertoffset * sizeof(_prvert); + GLsizeiptr cur_sector_size = sec->wallnum * sizeof(_prvert); + glBindBuffer(GL_ARRAY_BUFFER, prmapvbo); // floor - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, sector_offset, cur_sector_size, s->floor.buffer); + glBufferSubData(GL_ARRAY_BUFFER, sector_offset, cur_sector_size, s->floor.buffer); // ceiling - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, sector_offset + cur_sector_size, cur_sector_size, s->ceil.buffer); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBufferSubData(GL_ARRAY_BUFFER, sector_offset + cur_sector_size, cur_sector_size, s->ceil.buffer); + glBindBuffer(GL_ARRAY_BUFFER, 0); } } else @@ -2843,17 +2843,17 @@ finish: { if (s->oldindicescount < s->indicescount) { - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, s->floor.ivbo); - bglBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, s->indicescount * sizeof(GLushort), NULL, mapvbousage); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, s->ceil.ivbo); - bglBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, s->indicescount * sizeof(GLushort), NULL, mapvbousage); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->floor.ivbo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, s->indicescount * sizeof(GLushort), NULL, mapvbousage); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->ceil.ivbo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, s->indicescount * sizeof(GLushort), NULL, mapvbousage); s->oldindicescount = s->indicescount; } - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, s->floor.ivbo); - bglBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, s->indicescount * sizeof(GLushort), s->floor.indices); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, s->ceil.ivbo); - bglBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, s->indicescount * sizeof(GLushort), s->ceil.indices); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->floor.ivbo); + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, s->indicescount * sizeof(GLushort), s->floor.indices); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->ceil.ivbo); + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, s->indicescount * sizeof(GLushort), s->ceil.indices); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } } } @@ -3062,24 +3062,24 @@ static int32_t polymer_initwall(int16_t wallnum) //if (w->cap == NULL) // w->cap = (GLfloat *)Xmalloc(4 * sizeof(GLfloat) * 3); - bglGenBuffersARB(1, &w->wall.vbo); - bglGenBuffersARB(1, &w->over.vbo); - bglGenBuffersARB(1, &w->mask.vbo); - bglGenBuffersARB(1, &w->stuffvbo); + glGenBuffers(1, &w->wall.vbo); + glGenBuffers(1, &w->over.vbo); + glGenBuffers(1, &w->mask.vbo); + glGenBuffers(1, &w->stuffvbo); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, w->wall.vbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, 4 * sizeof(GLfloat) * 5, NULL, mapvbousage); + glBindBuffer(GL_ARRAY_BUFFER, w->wall.vbo); + glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(GLfloat) * 5, NULL, mapvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, w->over.vbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, 4 * sizeof(GLfloat) * 5, NULL, mapvbousage); + glBindBuffer(GL_ARRAY_BUFFER, w->over.vbo); + glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(GLfloat) * 5, NULL, mapvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, w->mask.vbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, 4 * sizeof(GLfloat) * 5, NULL, mapvbousage); + glBindBuffer(GL_ARRAY_BUFFER, w->mask.vbo); + glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(GLfloat) * 5, NULL, mapvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, w->stuffvbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, 8 * sizeof(GLfloat) * 5, NULL, mapvbousage); + glBindBuffer(GL_ARRAY_BUFFER, w->stuffvbo); + glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(GLfloat) * 5, NULL, mapvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); w->flags.empty = 1; @@ -3509,20 +3509,20 @@ static void polymer_updatewall(int16_t wallnum) { if (pr_nullrender < 2) { - const GLintptrARB thiswalloffset = prwalldataoffset + (prwalldatasize * wallnum); - const GLintptrARB thisoveroffset = thiswalloffset + proneplanesize; - const GLintptrARB thismaskoffset = thisoveroffset + proneplanesize; - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, prmapvbo); - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, thiswalloffset, proneplanesize, w->wall.buffer); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, prmapvbo); + const GLintptr thiswalloffset = prwalldataoffset + (prwalldatasize * wallnum); + const GLintptr thisoveroffset = thiswalloffset + proneplanesize; + const GLintptr thismaskoffset = thisoveroffset + proneplanesize; + glBindBuffer(GL_ARRAY_BUFFER, prmapvbo); + glBufferSubData(GL_ARRAY_BUFFER, thiswalloffset, proneplanesize, w->wall.buffer); + glBindBuffer(GL_ARRAY_BUFFER, prmapvbo); if (w->over.buffer) - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, thisoveroffset, proneplanesize, w->over.buffer); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, prmapvbo); - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, thismaskoffset, proneplanesize, w->mask.buffer); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, w->stuffvbo); - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, 4 * sizeof(GLfloat)* 5, w->bigportal); - //bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 4 * sizeof(GLfloat)* 5, 4 * sizeof(GLfloat)* 3, w->cap); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBufferSubData(GL_ARRAY_BUFFER, thisoveroffset, proneplanesize, w->over.buffer); + glBindBuffer(GL_ARRAY_BUFFER, prmapvbo); + glBufferSubData(GL_ARRAY_BUFFER, thismaskoffset, proneplanesize, w->mask.buffer); + glBindBuffer(GL_ARRAY_BUFFER, w->stuffvbo); + glBufferSubData(GL_ARRAY_BUFFER, 0, 4 * sizeof(GLfloat)* 5, w->bigportal); + //glBufferSubData(GL_ARRAY_BUFFER, 4 * sizeof(GLfloat)* 5, 4 * sizeof(GLfloat)* 3, w->cap); + glBindBuffer(GL_ARRAY_BUFFER, 0); w->wall.mapvbo_vertoffset = thiswalloffset / sizeof(_prvert); w->over.mapvbo_vertoffset = thisoveroffset / sizeof(_prvert); @@ -3598,22 +3598,22 @@ static void polymer_drawwall(int16_t sectnum, int16_t wallnum) // ((wall[wallnum].nextsector < 0) || // !(sector[wall[wallnum].nextsector].ceilingstat & 1))) //{ - // bglColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); + // glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); // if (pr_vbos) // { - // bglBindBufferARB(GL_ARRAY_BUFFER_ARB, w->stuffvbo); - // bglVertexPointer(3, GL_FLOAT, 0, (const GLvoid*)(4 * sizeof(GLfloat) * 5)); + // glBindBuffer(GL_ARRAY_BUFFER, w->stuffvbo); + // glVertexPointer(3, GL_FLOAT, 0, (const GLvoid*)(4 * sizeof(GLfloat) * 5)); // } // else - // bglVertexPointer(3, GL_FLOAT, 0, w->cap); + // glVertexPointer(3, GL_FLOAT, 0, w->cap); - // bglDrawArrays(GL_QUADS, 0, 4); + // glDrawArrays(GL_QUADS, 0, 4); // if (pr_vbos) - // bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + // glBindBuffer(GL_ARRAY_BUFFER, 0); - // bglColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + // glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); //} if (pr_verbosity >= 3) OSD_Printf("PR : Finished drawing wall %i...\n", wallnum); @@ -3762,12 +3762,12 @@ static void polymer_extractfrustum(GLfloat* modelview, GLfloat* projecti GLfloat matrix[16]; int32_t i; - bglMatrixMode(GL_TEXTURE); - bglLoadMatrixf(projection); - bglMultMatrixf(modelview); - bglGetFloatv(GL_TEXTURE_MATRIX, matrix); - bglLoadIdentity(); - bglMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_TEXTURE); + glLoadMatrixf(projection); + glMultMatrixf(modelview); + glGetFloatv(GL_TEXTURE_MATRIX, matrix); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); i = 0; do @@ -3873,9 +3873,9 @@ void polymer_updatesprite(int32_t snum) { if (pr_nullrender < 2) { - bglGenBuffersARB(1, &s->plane.vbo); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, s->plane.vbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, 4 * sizeof(_prvert), NULL, mapvbousage); + glGenBuffers(1, &s->plane.vbo); + glBindBuffer(GL_ARRAY_BUFFER, s->plane.vbo); + glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(_prvert), NULL, mapvbousage); } } @@ -3948,9 +3948,9 @@ void polymer_updatesprite(int32_t snum) spos[1] = -(float)(tspr->z) / 16.0f; spos[2] = -(float)tspr->x; - bglMatrixMode(GL_MODELVIEW); - bglPushMatrix(); - bglLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); inbuffer = vertsprite; @@ -3981,34 +3981,34 @@ void polymer_updatesprite(int32_t snum) case 0: ang = (float)((viewangle) & 2047) * (360.f/2048.f); - bglTranslatef(spos[0], spos[1], spos[2]); - bglRotatef(-ang, 0.0f, 1.0f, 0.0f); - bglRotatef(-horizang, 1.0f, 0.0f, 0.0f); - bglTranslatef((float)(-xoff), (float)(yoff), 0.0f); - bglScalef((float)(xsize), (float)(ysize), 1.0f); + glTranslatef(spos[0], spos[1], spos[2]); + glRotatef(-ang, 0.0f, 1.0f, 0.0f); + glRotatef(-horizang, 1.0f, 0.0f, 0.0f); + glTranslatef((float)(-xoff), (float)(yoff), 0.0f); + glScalef((float)(xsize), (float)(ysize), 1.0f); break; case SPR_WALL: ang = (float)((tspr->ang + 1024) & 2047) * (360.f/2048.f); - bglTranslatef(spos[0], spos[1], spos[2]); - bglRotatef(-ang, 0.0f, 1.0f, 0.0f); - bglTranslatef((float)(-xoff), (float)(yoff-centeryoff), 0.0f); - bglScalef((float)(xsize), (float)(ysize), 1.0f); + glTranslatef(spos[0], spos[1], spos[2]); + glRotatef(-ang, 0.0f, 1.0f, 0.0f); + glTranslatef((float)(-xoff), (float)(yoff-centeryoff), 0.0f); + glScalef((float)(xsize), (float)(ysize), 1.0f); break; case SPR_FLOOR: ang = (float)((tspr->ang + 1024) & 2047) * (360.f/2048.f); - bglTranslatef(spos[0], spos[1], spos[2]); - bglRotatef(-ang, 0.0f, 1.0f, 0.0f); - bglTranslatef((float)(-xoff), 1.0f, (float)(yoff)); - bglScalef((float)(xsize), 1.0f, (float)(ysize)); + glTranslatef(spos[0], spos[1], spos[2]); + glRotatef(-ang, 0.0f, 1.0f, 0.0f); + glTranslatef((float)(-xoff), 1.0f, (float)(yoff)); + glScalef((float)(xsize), 1.0f, (float)(ysize)); inbuffer = horizsprite; break; } - bglGetFloatv(GL_MODELVIEW_MATRIX, spritemodelview); - bglPopMatrix(); + glGetFloatv(GL_MODELVIEW_MATRIX, spritemodelview); + glPopMatrix(); Bmemcpy(s->plane.buffer, inbuffer, sizeof(_prvert) * 4); @@ -4038,13 +4038,13 @@ void polymer_updatesprite(int32_t snum) { if (alignmask && (pr_vbos > 0)) { - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, s->plane.vbo); - bglBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, 4 * sizeof(_prvert), s->plane.buffer); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, s->plane.vbo); + glBufferSubData(GL_ARRAY_BUFFER, 0, 4 * sizeof(_prvert), s->plane.buffer); + glBindBuffer(GL_ARRAY_BUFFER, 0); } else if (s->plane.vbo) // clean up the vbo if a wall/floor sprite becomes a face sprite { - bglDeleteBuffersARB(1, &s->plane.vbo); + glDeleteBuffers(1, &s->plane.vbo); s->plane.vbo = 0; } } @@ -4129,13 +4129,13 @@ void polymer_drawsky(int16_t tilenum, char palnum, int8_t shade) pos[1] = fglobalposz * (-1.f/16.f); pos[2] = -fglobalposx; - bglPushMatrix(); - bglLoadIdentity(); + glPushMatrix(); + glLoadIdentity(); - bglLoadMatrixf(curskymodelviewmatrix); + glLoadMatrixf(curskymodelviewmatrix); - bglTranslatef(pos[0], pos[1], pos[2]); - bglScalef(1000.0f, 1000.0f, 1000.0f); + glTranslatef(pos[0], pos[1], pos[2]); + glScalef(1000.0f, 1000.0f, 1000.0f); drawingskybox = 1; pth = texcache_fetch(tilenum, 0, 0, DAMETH_NOMASK); @@ -4146,7 +4146,7 @@ void polymer_drawsky(int16_t tilenum, char palnum, int8_t shade) else polymer_drawartsky(tilenum, palnum, shade); - bglPopMatrix(); + glPopMatrix(); } static void polymer_initartsky(void) @@ -4224,15 +4224,15 @@ static void polymer_drawartsky(int16_t tilenum, char palnum, int8_t shad // ... but in case a multi-psky specifies less than 8, repeat cyclically: const int8_t tileofs = dapskyoff[i&numskytilesm1]; - bglColor4f(glcolors[tileofs][0], glcolors[tileofs][1], glcolors[tileofs][2], 1.0f); - bglBindTexture(GL_TEXTURE_2D, glpics[tileofs]); + glColor4f(glcolors[tileofs][0], glcolors[tileofs][1], glcolors[tileofs][2], 1.0f); + glBindTexture(GL_TEXTURE_2D, glpics[tileofs]); - bglGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &oldswrap); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &oldswrap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); polymer_drawartskyquad(i, (i + 1) & (j - 1), height); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, oldswrap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, oldswrap); i++; } @@ -4240,20 +4240,20 @@ static void polymer_drawartsky(int16_t tilenum, char palnum, int8_t shad static void polymer_drawartskyquad(int32_t p1, int32_t p2, GLfloat height) { - bglBegin(GL_QUADS); - bglTexCoord2f(0.0f, 0.0f); + glBegin(GL_QUADS); + glTexCoord2f(0.0f, 0.0f); //OSD_Printf("PR: drawing %f %f %f\n", skybox[(p1 * 2) + 1], height, skybox[p1 * 2]); - bglVertex3f(artskydata[(p1 * 2) + 1], height, artskydata[p1 * 2]); - bglTexCoord2f(0.0f, 1.0f); + glVertex3f(artskydata[(p1 * 2) + 1], height, artskydata[p1 * 2]); + glTexCoord2f(0.0f, 1.0f); //OSD_Printf("PR: drawing %f %f %f\n", skybox[(p1 * 2) + 1], -height, skybox[p1 * 2]); - bglVertex3f(artskydata[(p1 * 2) + 1], -height, artskydata[p1 * 2]); - bglTexCoord2f(1.0f, 1.0f); + glVertex3f(artskydata[(p1 * 2) + 1], -height, artskydata[p1 * 2]); + glTexCoord2f(1.0f, 1.0f); //OSD_Printf("PR: drawing %f %f %f\n", skybox[(p2 * 2) + 1], -height, skybox[p2 * 2]); - bglVertex3f(artskydata[(p2 * 2) + 1], -height, artskydata[p2 * 2]); - bglTexCoord2f(1.0f, 0.0f); + glVertex3f(artskydata[(p2 * 2) + 1], -height, artskydata[p2 * 2]); + glTexCoord2f(1.0f, 0.0f); //OSD_Printf("PR: drawing %f %f %f\n", skybox[(p2 * 2) + 1], height, skybox[p2 * 2]); - bglVertex3f(artskydata[(p2 * 2) + 1], height, artskydata[p2 * 2]); - bglEnd(); + glVertex3f(artskydata[(p2 * 2) + 1], height, artskydata[p2 * 2]); + glEnd(); } static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shade) @@ -4264,16 +4264,16 @@ static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shad if ((pr_vbos > 0) && (skyboxdatavbo == 0)) { - bglGenBuffersARB(1, &skyboxdatavbo); + glGenBuffers(1, &skyboxdatavbo); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, skyboxdatavbo); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, 4 * sizeof(GLfloat) * 5 * 6, skyboxdata, modelvbousage); + glBindBuffer(GL_ARRAY_BUFFER, skyboxdatavbo); + glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(GLfloat) * 5 * 6, skyboxdata, modelvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); } if (pr_vbos > 0) - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, skyboxdatavbo); + glBindBuffer(GL_ARRAY_BUFFER, skyboxdatavbo); DO_TILE_ANIM(tilenum, 0); @@ -4307,24 +4307,24 @@ static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shad globaltinting_apply(color); } - bglColor4f(color[0], color[1], color[2], 1.0); - bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); + glColor4f(color[0], color[1], color[2], 1.0); + glBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); if (pr_vbos > 0) { - bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), (GLfloat*)(4 * 5 * i * sizeof(GLfloat))); - bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), (GLfloat*)(((4 * 5 * i) + 3) * sizeof(GLfloat))); + glVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), (GLfloat*)(4 * 5 * i * sizeof(GLfloat))); + glTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), (GLfloat*)(((4 * 5 * i) + 3) * sizeof(GLfloat))); } else { - bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), &skyboxdata[4 * 5 * i]); - bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), &skyboxdata[3 + (4 * 5 * i)]); + glVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), &skyboxdata[4 * 5 * i]); + glTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), &skyboxdata[3 + (4 * 5 * i)]); } - bglDrawArrays(GL_QUADS, 0, 4); + glDrawArrays(GL_QUADS, 0, 4); i++; } drawingskybox = 0; if (pr_vbos > 0) - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); return; } @@ -4386,9 +4386,9 @@ static void polymer_drawmdsprite(uspritetype *tspr) if (((tspr->cstat>>4) & 3) == 2) ang -= 90.0f; - bglMatrixMode(GL_MODELVIEW); - bglPushMatrix(); - bglLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); scale = (1.0/4.0); scale *= m->scale; if (pr_overridemodelscale) { @@ -4406,40 +4406,40 @@ static void polymer_drawmdsprite(uspritetype *tspr) sinminusradplayerang = sin(-radplayerang); hudzoom = 65536.0 / spriteext[tspr->owner].offset.z; - bglTranslatef(spos[0], spos[1], spos[2]); - bglRotatef(horizang, -cosminusradplayerang, 0.0f, sinminusradplayerang); - bglRotatef(spriteext[tspr->owner].roll * (360.f/2048.f), sinminusradplayerang, 0.0f, cosminusradplayerang); - bglRotatef(-playerang, 0.0f, 1.0f, 0.0f); - bglScalef(hudzoom, 1.0f, 1.0f); - bglRotatef(playerang, 0.0f, 1.0f, 0.0f); - bglTranslatef(spos2[0], spos2[1], spos2[2]); - bglRotatef(-ang, 0.0f, 1.0f, 0.0f); + glTranslatef(spos[0], spos[1], spos[2]); + glRotatef(horizang, -cosminusradplayerang, 0.0f, sinminusradplayerang); + glRotatef(spriteext[tspr->owner].roll * (360.f/2048.f), sinminusradplayerang, 0.0f, cosminusradplayerang); + glRotatef(-playerang, 0.0f, 1.0f, 0.0f); + glScalef(hudzoom, 1.0f, 1.0f); + glRotatef(playerang, 0.0f, 1.0f, 0.0f); + glTranslatef(spos2[0], spos2[1], spos2[2]); + glRotatef(-ang, 0.0f, 1.0f, 0.0f); } else { - bglTranslatef(spos[0], spos[1], spos[2]); - bglRotatef(-ang, 0.0f, 1.0f, 0.0f); + glTranslatef(spos[0], spos[1], spos[2]); + glRotatef(-ang, 0.0f, 1.0f, 0.0f); } if (((tspr->cstat>>4) & 3) == 2) { - bglTranslatef(0.0f, 0.0, -(float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 8.0f); - bglRotatef(90.0f, 0.0f, 0.0f, 1.0f); + glTranslatef(0.0f, 0.0, -(float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 8.0f); + glRotatef(90.0f, 0.0f, 0.0f, 1.0f); } else - bglRotatef(-90.0f, 1.0f, 0.0f, 0.0f); + glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); if ((tspr->cstat & 128) && (((tspr->cstat>>4) & 3) != 2)) - bglTranslatef(0.0f, 0.0, -(float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 8.0f); + glTranslatef(0.0f, 0.0, -(float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 8.0f); // yoffset differs from zadd in that it does not follow cstat&8 y-flipping - bglTranslatef(0.0f, 0.0, m->yoffset * 64 * scale * tspr->yrepeat); + glTranslatef(0.0f, 0.0, m->yoffset * 64 * scale * tspr->yrepeat); if (tspr->cstat & 8) { - bglTranslatef(0.0f, 0.0, (float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 4.0f); - bglScalef(1.0f, 1.0f, -1.0f); + glTranslatef(0.0f, 0.0, (float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 4.0f); + glScalef(1.0f, 1.0f, -1.0f); } if (tspr->cstat & 4) - bglScalef(1.0f, -1.0f, 1.0f); + glScalef(1.0f, -1.0f, 1.0f); if (!(tspr->cstat & 4) != !(tspr->cstat & 8)) { // Only inverting one coordinate will reverse the winding order of @@ -4447,8 +4447,8 @@ static void polymer_drawmdsprite(uspritetype *tspr) SWITCH_CULL_DIRECTION; } - bglScalef(scale * tspr->xrepeat, scale * tspr->xrepeat, scale * tspr->yrepeat); - bglTranslatef(0.0f, 0.0, m->zadd * 64); + glScalef(scale * tspr->xrepeat, scale * tspr->xrepeat, scale * tspr->yrepeat); + glTranslatef(0.0f, 0.0, m->zadd * 64); // scripted model rotation if (tspr->owner < MAXSPRITES && @@ -4463,50 +4463,50 @@ static void polymer_drawmdsprite(uspritetype *tspr) offsets[1] = -spriteext[tspr->owner].offset.y / (scale * tspr->xrepeat); offsets[2] = (float)(spriteext[tspr->owner].offset.z) / 16.0f / (scale * tspr->yrepeat); - bglTranslatef(-offsets[0], -offsets[1], -offsets[2]); + glTranslatef(-offsets[0], -offsets[1], -offsets[2]); - bglRotatef(pitchang, 0.0f, 1.0f, 0.0f); - bglRotatef(rollang, -1.0f, 0.0f, 0.0f); + glRotatef(pitchang, 0.0f, 1.0f, 0.0f); + glRotatef(rollang, -1.0f, 0.0f, 0.0f); - bglTranslatef(offsets[0], offsets[1], offsets[2]); + glTranslatef(offsets[0], offsets[1], offsets[2]); } - bglGetFloatv(GL_MODELVIEW_MATRIX, spritemodelview); + glGetFloatv(GL_MODELVIEW_MATRIX, spritemodelview); - bglPopMatrix(); - bglPushMatrix(); - bglMultMatrixf(spritemodelview); + glPopMatrix(); + glPushMatrix(); + glMultMatrixf(spritemodelview); // invert this matrix to get the polymer -> mdsprite space memcpy(mat, spritemodelview, sizeof(float) * 16); INVERT_4X4(mdspritespace, det, mat); // debug code for drawing the model bounding sphere -// bglDisable(GL_TEXTURE_2D); -// bglBegin(GL_LINES); -// bglColor4f(1.0, 0.0, 0.0, 1.0); -// bglVertex3f(m->head.frames[m->cframe].cen.x, +// glDisable(GL_TEXTURE_2D); +// glBegin(GL_LINES); +// glColor4f(1.0, 0.0, 0.0, 1.0); +// glVertex3f(m->head.frames[m->cframe].cen.x, // m->head.frames[m->cframe].cen.y, // m->head.frames[m->cframe].cen.z); -// bglVertex3f(m->head.frames[m->cframe].cen.x + m->head.frames[m->cframe].r, +// glVertex3f(m->head.frames[m->cframe].cen.x + m->head.frames[m->cframe].r, // m->head.frames[m->cframe].cen.y, // m->head.frames[m->cframe].cen.z); -// bglColor4f(0.0, 1.0, 0.0, 1.0); -// bglVertex3f(m->head.frames[m->cframe].cen.x, +// glColor4f(0.0, 1.0, 0.0, 1.0); +// glVertex3f(m->head.frames[m->cframe].cen.x, // m->head.frames[m->cframe].cen.y, // m->head.frames[m->cframe].cen.z); -// bglVertex3f(m->head.frames[m->cframe].cen.x, +// glVertex3f(m->head.frames[m->cframe].cen.x, // m->head.frames[m->cframe].cen.y + m->head.frames[m->cframe].r, // m->head.frames[m->cframe].cen.z); -// bglColor4f(0.0, 0.0, 1.0, 1.0); -// bglVertex3f(m->head.frames[m->cframe].cen.x, +// glColor4f(0.0, 0.0, 1.0, 1.0); +// glVertex3f(m->head.frames[m->cframe].cen.x, // m->head.frames[m->cframe].cen.y, // m->head.frames[m->cframe].cen.z); -// bglVertex3f(m->head.frames[m->cframe].cen.x, +// glVertex3f(m->head.frames[m->cframe].cen.x, // m->head.frames[m->cframe].cen.y, // m->head.frames[m->cframe].cen.z + m->head.frames[m->cframe].r); -// bglEnd(); -// bglEnable(GL_TEXTURE_2D); +// glEnd(); +// glEnable(GL_TEXTURE_2D); polymer_getscratchmaterial(&mdspritematerial); @@ -4629,23 +4629,23 @@ static void polymer_drawmdsprite(uspritetype *tspr) v1 = &s->geometry[m->nframe*s->numverts*15]; // debug code for drawing model normals -// bglDisable(GL_TEXTURE_2D); -// bglBegin(GL_LINES); -// bglColor4f(1.0, 1.0, 1.0, 1.0); +// glDisable(GL_TEXTURE_2D); +// glBegin(GL_LINES); +// glColor4f(1.0, 1.0, 1.0, 1.0); // // int i = 0; // while (i < s->numverts) // { -// bglVertex3f(v0[(i * 6) + 0], +// glVertex3f(v0[(i * 6) + 0], // v0[(i * 6) + 1], // v0[(i * 6) + 2]); -// bglVertex3f(v0[(i * 6) + 0] + v0[(i * 6) + 3] * 100, +// glVertex3f(v0[(i * 6) + 0] + v0[(i * 6) + 3] * 100, // v0[(i * 6) + 1] + v0[(i * 6) + 4] * 100, // v0[(i * 6) + 2] + v0[(i * 6) + 5] * 100); // i++; // } -// bglEnd(); -// bglEnable(GL_TEXTURE_2D); +// glEnd(); +// glEnable(GL_TEXTURE_2D); targetpal = tspr->pal; @@ -4707,16 +4707,16 @@ static void polymer_drawmdsprite(uspritetype *tspr) mdloadskin((md2model_t *)m,tile2model[Ptile2tile(tspr->picnum,lpal)].skinnum,GLOWPAL,surfi); } - bglEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); if (pr_vbos > 1) { - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, m->texcoords[surfi]); - bglTexCoordPointer(2, GL_FLOAT, 0, 0); + glBindBuffer(GL_ARRAY_BUFFER, m->texcoords[surfi]); + glTexCoordPointer(2, GL_FLOAT, 0, 0); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, m->geometry[surfi]); - bglVertexPointer(3, GL_FLOAT, sizeof(float) * 15, (GLfloat*)(m->cframe * s->numverts * sizeof(float) * 15)); - bglNormalPointer(GL_FLOAT, sizeof(float) * 15, (GLfloat*)(m->cframe * s->numverts * sizeof(float) * 15) + 3); + glBindBuffer(GL_ARRAY_BUFFER, m->geometry[surfi]); + glVertexPointer(3, GL_FLOAT, sizeof(float) * 15, (GLfloat*)(m->cframe * s->numverts * sizeof(float) * 15)); + glNormalPointer(GL_FLOAT, sizeof(float) * 15, (GLfloat*)(m->cframe * s->numverts * sizeof(float) * 15) + 3); mdspritematerial.tbn = (GLfloat*)(m->cframe * s->numverts * sizeof(float) * 15) + 6; @@ -4724,23 +4724,23 @@ static void polymer_drawmdsprite(uspritetype *tspr) mdspritematerial.nextframedata = (GLfloat*)(m->nframe * s->numverts * sizeof(float) * 15); } - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, m->indices[surfi]); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m->indices[surfi]); curlight = 0; do { materialbits = polymer_bindmaterial(&mdspritematerial, modellights, modellightcount); - bglDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_INT, 0); + glDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_INT, 0); polymer_unbindmaterial(materialbits); } while ((++curlight < modellightcount) && (curlight < pr_maxlightpasses)); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); } else { - bglVertexPointer(3, GL_FLOAT, sizeof(float) * 15, v0); - bglNormalPointer(GL_FLOAT, sizeof(float) * 15, v0 + 3); - bglTexCoordPointer(2, GL_FLOAT, 0, s->uv); + glVertexPointer(3, GL_FLOAT, sizeof(float) * 15, v0); + glNormalPointer(GL_FLOAT, sizeof(float) * 15, v0 + 3); + glTexCoordPointer(2, GL_FLOAT, 0, s->uv); mdspritematerial.tbn = v0 + 6; @@ -4751,15 +4751,15 @@ static void polymer_drawmdsprite(uspritetype *tspr) curlight = 0; do { materialbits = polymer_bindmaterial(&mdspritematerial, modellights, modellightcount); - bglDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_INT, s->tris); + glDrawElements(GL_TRIANGLES, s->numtris * 3, GL_UNSIGNED_INT, s->tris); polymer_unbindmaterial(materialbits); } while ((++curlight < modellightcount) && (curlight < pr_maxlightpasses)); } - bglDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); } - bglPopMatrix(); + glPopMatrix(); if (!(tspr->cstat & 4) != !(tspr->cstat & 8)) { SWITCH_CULL_DIRECTION; @@ -4777,27 +4777,27 @@ static void polymer_loadmodelvbos(md3model_t* m) m->texcoords = (GLuint *)Xmalloc(m->head.numsurfs * sizeof(GLuint)); m->geometry = (GLuint *)Xmalloc(m->head.numsurfs * sizeof(GLuint)); - bglGenBuffersARB(m->head.numsurfs, m->indices); - bglGenBuffersARB(m->head.numsurfs, m->texcoords); - bglGenBuffersARB(m->head.numsurfs, m->geometry); + glGenBuffers(m->head.numsurfs, m->indices); + glGenBuffers(m->head.numsurfs, m->texcoords); + glGenBuffers(m->head.numsurfs, m->geometry); i = 0; while (i < m->head.numsurfs) { s = &m->head.surfs[i]; - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, m->indices[i]); - bglBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, s->numtris * sizeof(md3tri_t), s->tris, modelvbousage); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m->indices[i]); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, s->numtris * sizeof(md3tri_t), s->tris, modelvbousage); - bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, m->texcoords[i]); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, s->numverts * sizeof(md3uv_t), s->uv, modelvbousage); + glBindBuffer(GL_ARRAY_BUFFER, m->texcoords[i]); + glBufferData(GL_ARRAY_BUFFER, s->numverts * sizeof(md3uv_t), s->uv, modelvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, m->geometry[i]); - bglBufferDataARB(GL_ARRAY_BUFFER_ARB, s->numframes * s->numverts * sizeof(float) * (15), s->geometry, modelvbousage); + glBindBuffer(GL_ARRAY_BUFFER, m->geometry[i]); + glBufferData(GL_ARRAY_BUFFER, s->numframes * s->numverts * sizeof(float) * (15), s->geometry, modelvbousage); - bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); i++; } } @@ -4863,29 +4863,29 @@ static void polymer_setupartmap(int16_t tilenum, char pal) i++; } - bglGenTextures(1, &prartmaps[tilenum]); - bglBindTexture(GL_TEXTURE_2D, prartmaps[tilenum]); - bglTexImage2D(GL_TEXTURE_2D, + glGenTextures(1, &prartmaps[tilenum]); + glBindTexture(GL_TEXTURE_2D, prartmaps[tilenum]); + glTexImage2D(GL_TEXTURE_2D, 0, - GL_R8, + GL_RED, tilesiz[tilenum].x, tilesiz[tilenum].y, 0, GL_RED, GL_UNSIGNED_BYTE, tempbuffer); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - bglBindTexture(GL_TEXTURE_2D, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glBindTexture(GL_TEXTURE_2D, 0); Bfree(tempbuffer); } if (!prbasepalmaps[curbasepal]) { - bglGenTextures(1, &prbasepalmaps[curbasepal]); - bglBindTexture(GL_TEXTURE_2D, prbasepalmaps[curbasepal]); - bglTexImage2D(GL_TEXTURE_2D, + glGenTextures(1, &prbasepalmaps[curbasepal]); + glBindTexture(GL_TEXTURE_2D, prbasepalmaps[curbasepal]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 256, @@ -4894,30 +4894,30 @@ static void polymer_setupartmap(int16_t tilenum, char pal) GL_RGB, GL_UNSIGNED_BYTE, basepaltable[curbasepal]); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP); - bglBindTexture(GL_TEXTURE_2D, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP); + glBindTexture(GL_TEXTURE_2D, 0); } if (!prlookups[pal]) { - bglGenTextures(1, &prlookups[pal]); - bglBindTexture(GL_TEXTURE_RECTANGLE, prlookups[pal]); - bglTexImage2D(GL_TEXTURE_RECTANGLE, + glGenTextures(1, &prlookups[pal]); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, prlookups[pal]); + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, - GL_R8, + GL_RED, 256, numshades, 0, GL_RED, GL_UNSIGNED_BYTE, palookup[pal]); - bglTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - bglTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - bglTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_S, glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP); - bglTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_T, glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP); - bglBindTexture(GL_TEXTURE_RECTANGLE, 0); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0); } } @@ -5158,7 +5158,7 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l if (!prprograms[programbits].handle) polymer_compileprogram(programbits); - bglUseProgramObjectARB(prprograms[programbits].handle); + glUseProgram(prprograms[programbits].handle); // --------- bit setup @@ -5167,31 +5167,31 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l // PR_BIT_ANIM_INTERPOLATION if (programbits & prprogrambits[PR_BIT_ANIM_INTERPOLATION].bit) { - bglEnableVertexAttribArrayARB(prprograms[programbits].attrib_nextFrameData); + glEnableVertexAttribArray(prprograms[programbits].attrib_nextFrameData); if (prprograms[programbits].attrib_nextFrameNormal != -1) - bglEnableVertexAttribArrayARB(prprograms[programbits].attrib_nextFrameNormal); - bglVertexAttribPointerARB(prprograms[programbits].attrib_nextFrameData, - 3, GL_FLOAT, GL_FALSE, - sizeof(float) * 15, - material->nextframedata); + glEnableVertexAttribArray(prprograms[programbits].attrib_nextFrameNormal); + glVertexAttribPointer(prprograms[programbits].attrib_nextFrameData, + 3, GL_FLOAT, GL_FALSE, + sizeof(float) * 15, + material->nextframedata); if (prprograms[programbits].attrib_nextFrameNormal != -1) - bglVertexAttribPointerARB(prprograms[programbits].attrib_nextFrameNormal, - 3, GL_FLOAT, GL_FALSE, - sizeof(float) * 15, - material->nextframedata + 3); + glVertexAttribPointer(prprograms[programbits].attrib_nextFrameNormal, + 3, GL_FLOAT, GL_FALSE, + sizeof(float) * 15, + material->nextframedata + 3); - bglUniform1fARB(prprograms[programbits].uniform_frameProgress, material->frameprogress); + glUniform1f(prprograms[programbits].uniform_frameProgress, material->frameprogress); } // PR_BIT_LIGHTING_PASS if (programbits & prprogrambits[PR_BIT_LIGHTING_PASS].bit) { - bglPushAttrib(GL_COLOR_BUFFER_BIT); - bglEnable(GL_BLEND); - bglBlendFunc(GL_ONE, GL_ONE); + glPushAttrib(GL_COLOR_BUFFER_BIT); + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE); if (prlights[lights[curlight]].publicflags.negative) { - bglBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); } } @@ -5204,37 +5204,37 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l pos[1] = fglobalposz * (-1.f/16.f); pos[2] = -fglobalposx; - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_2D, material->normalmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, material->normalmap); if (material->mdspritespace == GL_TRUE) { float mdspritespacepos[3]; polymer_transformpoint(pos, mdspritespacepos, (float *)mdspritespace); - bglUniform3fvARB(prprograms[programbits].uniform_eyePosition, 1, mdspritespacepos); + glUniform3fv(prprograms[programbits].uniform_eyePosition, 1, mdspritespacepos); } else - bglUniform3fvARB(prprograms[programbits].uniform_eyePosition, 1, pos); - bglUniform1iARB(prprograms[programbits].uniform_normalMap, texunit); + glUniform3fv(prprograms[programbits].uniform_eyePosition, 1, pos); + glUniform1i(prprograms[programbits].uniform_normalMap, texunit); if (pr_overrideparallax) { bias[0] = pr_parallaxscale; bias[1] = pr_parallaxbias; - bglUniform2fvARB(prprograms[programbits].uniform_normalBias, 1, bias); + glUniform2fv(prprograms[programbits].uniform_normalBias, 1, bias); } else - bglUniform2fvARB(prprograms[programbits].uniform_normalBias, 1, material->normalbias); + glUniform2fv(prprograms[programbits].uniform_normalBias, 1, material->normalbias); if (material->tbn) { - bglEnableVertexAttribArrayARB(prprograms[programbits].attrib_T); - bglEnableVertexAttribArrayARB(prprograms[programbits].attrib_B); - bglEnableVertexAttribArrayARB(prprograms[programbits].attrib_N); + glEnableVertexAttribArray(prprograms[programbits].attrib_T); + glEnableVertexAttribArray(prprograms[programbits].attrib_B); + glEnableVertexAttribArray(prprograms[programbits].attrib_N); - bglVertexAttribPointerARB(prprograms[programbits].attrib_T, + glVertexAttribPointer(prprograms[programbits].attrib_T, 3, GL_FLOAT, GL_FALSE, sizeof(float) * 15, material->tbn); - bglVertexAttribPointerARB(prprograms[programbits].attrib_B, + glVertexAttribPointer(prprograms[programbits].attrib_B, 3, GL_FLOAT, GL_FALSE, sizeof(float) * 15, material->tbn + 3); - bglVertexAttribPointerARB(prprograms[programbits].attrib_N, + glVertexAttribPointer(prprograms[programbits].attrib_N, 3, GL_FLOAT, GL_FALSE, sizeof(float) * 15, material->tbn + 6); @@ -5246,32 +5246,32 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l // PR_BIT_ART_MAP if (programbits & prprogrambits[PR_BIT_ART_MAP].bit) { - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_2D, material->artmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, material->artmap); - bglUniform1iARB(prprograms[programbits].uniform_artMap, texunit); + glUniform1i(prprograms[programbits].uniform_artMap, texunit); texunit++; - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_2D, material->basepalmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, material->basepalmap); - bglUniform1iARB(prprograms[programbits].uniform_basePalMap, texunit); + glUniform1i(prprograms[programbits].uniform_basePalMap, texunit); texunit++; - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_RECTANGLE, material->lookupmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, material->lookupmap); - bglUniform1iARB(prprograms[programbits].uniform_lookupMap, texunit); + glUniform1i(prprograms[programbits].uniform_lookupMap, texunit); texunit++; - bglUniform1fARB(prprograms[programbits].uniform_shadeOffset, (GLfloat)material->shadeoffset); + glUniform1f(prprograms[programbits].uniform_shadeOffset, (GLfloat)material->shadeoffset); if (r_usenewshading == 4) { // the fog in Polymer is a sphere insted of a plane, the furthest visible point should be the same as Polymost - bglUniform1fARB(prprograms[programbits].uniform_visibility, globalvisibility / 262144.f * material->visibility); + glUniform1f(prprograms[programbits].uniform_visibility, globalvisibility / 262144.f * material->visibility); } else { @@ -5285,18 +5285,18 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l static constexpr float factor_old = 1.f / ((2048.f * (1.07f / 1.024f) / 35.f) * material_visibility_divisor); - bglUniform1fARB(prprograms[programbits].uniform_visibility, globalvisibility * material->visibility * r_usenewshading > 1 ? factor_new : factor_old); + glUniform1f(prprograms[programbits].uniform_visibility, globalvisibility * material->visibility * r_usenewshading > 1 ? factor_new : factor_old); } } // PR_BIT_DIFFUSE_MAP if (programbits & prprogrambits[PR_BIT_DIFFUSE_MAP].bit) { - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_2D, material->diffusemap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, material->diffusemap); - bglUniform1iARB(prprograms[programbits].uniform_diffuseMap, texunit); - bglUniform2fvARB(prprograms[programbits].uniform_diffuseScale, 1, material->diffusescale); + glUniform1i(prprograms[programbits].uniform_diffuseMap, texunit); + glUniform2fv(prprograms[programbits].uniform_diffuseScale, 1, material->diffusescale); texunit++; } @@ -5304,10 +5304,10 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l // PR_BIT_HIGHPALOOKUP_MAP if (programbits & prprogrambits[PR_BIT_HIGHPALOOKUP_MAP].bit) { - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_3D, material->highpalookupmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_3D, material->highpalookupmap); - bglUniform1iARB(prprograms[programbits].uniform_highPalookupMap, texunit); + glUniform1i(prprograms[programbits].uniform_highPalookupMap, texunit); texunit++; } @@ -5327,11 +5327,11 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l scale[1] = material->detailscale[1]; } - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_2D, material->detailmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, material->detailmap); - bglUniform1iARB(prprograms[programbits].uniform_detailMap, texunit); - bglUniform2fvARB(prprograms[programbits].uniform_detailScale, 1, scale); + glUniform1i(prprograms[programbits].uniform_detailMap, texunit); + glUniform2fv(prprograms[programbits].uniform_detailScale, 1, scale); texunit++; } @@ -5339,7 +5339,7 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l // PR_BIT_DIFFUSE_MODULATION if (programbits & prprogrambits[PR_BIT_DIFFUSE_MODULATION].bit) { - bglColor4ub(material->diffusemodulation[0], + glColor4ub(material->diffusemodulation[0], material->diffusemodulation[1], material->diffusemodulation[2], material->diffusemodulation[3]); @@ -5348,10 +5348,10 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l // PR_BIT_SPECULAR_MAP if (programbits & prprogrambits[PR_BIT_SPECULAR_MAP].bit) { - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_2D, material->specmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, material->specmap); - bglUniform1iARB(prprograms[programbits].uniform_specMap, texunit); + glUniform1i(prprograms[programbits].uniform_specMap, texunit); texunit++; } @@ -5364,34 +5364,34 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l if (pr_overridespecular) { specmaterial[0] = pr_specularpower; specmaterial[1] = pr_specularfactor; - bglUniform2fvARB(prprograms[programbits].uniform_specMaterial, 1, specmaterial); + glUniform2fv(prprograms[programbits].uniform_specMaterial, 1, specmaterial); } else - bglUniform2fvARB(prprograms[programbits].uniform_specMaterial, 1, material->specmaterial); + glUniform2fv(prprograms[programbits].uniform_specMaterial, 1, material->specmaterial); } // PR_BIT_MIRROR_MAP if (programbits & prprogrambits[PR_BIT_MIRROR_MAP].bit) { - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_RECTANGLE, material->mirrormap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, material->mirrormap); - bglUniform1iARB(prprograms[programbits].uniform_mirrorMap, texunit); + glUniform1i(prprograms[programbits].uniform_mirrorMap, texunit); texunit++; } #ifdef PR_LINEAR_FOG if (programbits & prprogrambits[PR_BIT_FOG].bit) { - bglUniform1iARB(prprograms[programbits].uniform_linearFog, r_usenewshading >= 2); + glUniform1i(prprograms[programbits].uniform_linearFog, r_usenewshading >= 2); } #endif // PR_BIT_GLOW_MAP if (programbits & prprogrambits[PR_BIT_GLOW_MAP].bit) { - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_2D, material->glowmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, material->glowmap); - bglUniform1iARB(prprograms[programbits].uniform_glowMap, texunit); + glUniform1i(prprograms[programbits].uniform_glowMap, texunit); texunit++; } @@ -5434,33 +5434,33 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l indir[1] = (float)(sintable[(prlights[lights[curlight]].faderadius+512)&2047]) / 16383.0f; indir[1] = 1.0 / (indir[1] - indir[0]); - bglUniform3fvARB(prprograms[programbits].uniform_spotDir, 1, dir); - bglUniform2fvARB(prprograms[programbits].uniform_spotRadius, 1, indir); + glUniform3fv(prprograms[programbits].uniform_spotDir, 1, dir); + glUniform2fv(prprograms[programbits].uniform_spotRadius, 1, indir); // PR_BIT_PROJECTION_MAP if (programbits & prprogrambits[PR_BIT_PROJECTION_MAP].bit) { GLfloat matrix[16]; - bglMatrixMode(GL_TEXTURE); - bglLoadMatrixf(shadowBias); - bglMultMatrixf(prlights[lights[curlight]].proj); - bglMultMatrixf(prlights[lights[curlight]].transform); + glMatrixMode(GL_TEXTURE); + glLoadMatrixf(shadowBias); + glMultMatrixf(prlights[lights[curlight]].proj); + glMultMatrixf(prlights[lights[curlight]].transform); if (material->mdspritespace == GL_TRUE) - bglMultMatrixf(spritemodelview); - bglGetFloatv(GL_TEXTURE_MATRIX, matrix); - bglLoadIdentity(); - bglMatrixMode(GL_MODELVIEW); + glMultMatrixf(spritemodelview); + glGetFloatv(GL_TEXTURE_MATRIX, matrix); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); - bglUniformMatrix4fvARB(prprograms[programbits].uniform_shadowProjMatrix, 1, GL_FALSE, matrix); + glUniformMatrix4fv(prprograms[programbits].uniform_shadowProjMatrix, 1, GL_FALSE, matrix); // PR_BIT_SHADOW_MAP if (programbits & prprogrambits[PR_BIT_SHADOW_MAP].bit) { - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(prrts[prlights[lights[curlight]].rtindex].target, prrts[prlights[lights[curlight]].rtindex].z); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(prrts[prlights[lights[curlight]].rtindex].target, prrts[prlights[lights[curlight]].rtindex].z); - bglUniform1iARB(prprograms[programbits].uniform_shadowMap, texunit); + glUniform1i(prprograms[programbits].uniform_shadowMap, texunit); texunit++; } @@ -5468,10 +5468,10 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l // PR_BIT_LIGHT_MAP if (programbits & prprogrambits[PR_BIT_LIGHT_MAP].bit) { - bglActiveTextureARB(texunit + GL_TEXTURE0_ARB); - bglBindTexture(GL_TEXTURE_2D, prlights[lights[curlight]].lightmap); + glActiveTexture(texunit + GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, prlights[lights[curlight]].lightmap); - bglUniform1iARB(prprograms[programbits].uniform_lightMap, texunit); + glUniform1i(prprograms[programbits].uniform_lightMap, texunit); texunit++; } @@ -5492,19 +5492,19 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l color[2] = -color[2]; } - bglLightfv(GL_LIGHT0, GL_AMBIENT, pos); - bglLightfv(GL_LIGHT0, GL_DIFFUSE, color); + glLightfv(GL_LIGHT0, GL_AMBIENT, pos); + glLightfv(GL_LIGHT0, GL_DIFFUSE, color); if (material->mdspritespace == GL_TRUE) { float mdspritespacepos[3]; polymer_transformpoint(inpos, mdspritespacepos, (float *)mdspritespace); - bglLightfv(GL_LIGHT0, GL_SPECULAR, mdspritespacepos); + glLightfv(GL_LIGHT0, GL_SPECULAR, mdspritespacepos); } else { - bglLightfv(GL_LIGHT0, GL_SPECULAR, inpos); + glLightfv(GL_LIGHT0, GL_SPECULAR, inpos); } - bglLightfv(GL_LIGHT0, GL_LINEAR_ATTENUATION, &range[1]); + glLightfv(GL_LIGHT0, GL_LINEAR_ATTENUATION, &range[1]); } - bglActiveTextureARB(GL_TEXTURE0_ARB); + glActiveTexture(GL_TEXTURE0); return programbits; } @@ -5517,37 +5517,37 @@ static void polymer_unbindmaterial(int32_t programbits) if (programbits & prprogrambits[PR_BIT_ANIM_INTERPOLATION].bit) { if (prprograms[programbits].attrib_nextFrameNormal != -1) - bglDisableVertexAttribArrayARB(prprograms[programbits].attrib_nextFrameNormal); - bglDisableVertexAttribArrayARB(prprograms[programbits].attrib_nextFrameData); + glDisableVertexAttribArray(prprograms[programbits].attrib_nextFrameNormal); + glDisableVertexAttribArray(prprograms[programbits].attrib_nextFrameData); } // PR_BIT_LIGHTING_PASS if (programbits & prprogrambits[PR_BIT_LIGHTING_PASS].bit) { - bglPopAttrib(); + glPopAttrib(); } // PR_BIT_NORMAL_MAP if (programbits & prprogrambits[PR_BIT_NORMAL_MAP].bit) { - bglDisableVertexAttribArrayARB(prprograms[programbits].attrib_T); - bglDisableVertexAttribArrayARB(prprograms[programbits].attrib_B); - bglDisableVertexAttribArrayARB(prprograms[programbits].attrib_N); + glDisableVertexAttribArray(prprograms[programbits].attrib_T); + glDisableVertexAttribArray(prprograms[programbits].attrib_B); + glDisableVertexAttribArray(prprograms[programbits].attrib_N); } - bglUseProgramObjectARB(0); + glUseProgram(0); } static void polymer_compileprogram(int32_t programbits) { int32_t i, enabledbits; - GLhandleARB vert, frag, program; - const GLcharARB* source[PR_BIT_COUNT * 2]; - GLcharARB infobuffer[PR_INFO_LOG_BUFFER_SIZE]; + GLuint vert, frag, program; + const GLchar* source[PR_BIT_COUNT * 2]; + GLchar infobuffer[PR_INFO_LOG_BUFFER_SIZE]; GLint linkstatus; // --------- VERTEX - vert = bglCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); + vert = glCreateShader(GL_VERTEX_SHADER); enabledbits = i = 0; while (i < PR_BIT_COUNT) @@ -5564,12 +5564,12 @@ static void polymer_compileprogram(int32_t programbits) i++; } - bglShaderSourceARB(vert, enabledbits, source, NULL); + glShaderSource(vert, enabledbits, source, NULL); - bglCompileShaderARB(vert); + glCompileShader(vert); // --------- FRAGMENT - frag = bglCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); + frag = glCreateShader(GL_FRAGMENT_SHADER); enabledbits = i = 0; while (i < PR_BIT_COUNT) @@ -5586,21 +5586,21 @@ static void polymer_compileprogram(int32_t programbits) i++; } - bglShaderSourceARB(frag, enabledbits, (const GLcharARB**)source, NULL); + glShaderSource(frag, enabledbits, (const GLchar**)source, NULL); - bglCompileShaderARB(frag); + glCompileShader(frag); // --------- PROGRAM - program = bglCreateProgramObjectARB(); + program = glCreateProgram(); - bglAttachObjectARB(program, vert); - bglAttachObjectARB(program, frag); + glAttachShader(program, vert); + glAttachShader(program, frag); - bglLinkProgramARB(program); + glLinkProgram(program); - bglGetObjectParameterivARB(program, GL_OBJECT_LINK_STATUS_ARB, &linkstatus); + glGetProgramiv(program, GL_LINK_STATUS, &linkstatus); - bglGetInfoLogARB(program, PR_INFO_LOG_BUFFER_SIZE, NULL, infobuffer); + glGetProgramInfoLog(program, PR_INFO_LOG_BUFFER_SIZE, NULL, infobuffer); prprograms[programbits].handle = program; @@ -5613,9 +5613,9 @@ static void polymer_compileprogram(int32_t programbits) if (!linkstatus) { OSD_Printf("PR : Failed to compile GPU program with bits (octal) %o!\n", (unsigned)programbits); if (pr_verbosity >= 1) OSD_Printf("PR : Compilation log:\n%s\n", infobuffer); - bglGetShaderSourceARB(vert, PR_INFO_LOG_BUFFER_SIZE, NULL, infobuffer); + glGetShaderSource(vert, PR_INFO_LOG_BUFFER_SIZE, NULL, infobuffer); if (pr_verbosity >= 1) OSD_Printf("PR : Vertex source dump:\n%s\n", infobuffer); - bglGetShaderSourceARB(frag, PR_INFO_LOG_BUFFER_SIZE, NULL, infobuffer); + glGetShaderSource(frag, PR_INFO_LOG_BUFFER_SIZE, NULL, infobuffer); if (pr_verbosity >= 1) OSD_Printf("PR : Fragment source dump:\n%s\n", infobuffer); } @@ -5624,104 +5624,104 @@ static void polymer_compileprogram(int32_t programbits) // PR_BIT_ANIM_INTERPOLATION if (programbits & prprogrambits[PR_BIT_ANIM_INTERPOLATION].bit) { - prprograms[programbits].attrib_nextFrameData = bglGetAttribLocationARB(program, "nextFrameData"); - prprograms[programbits].attrib_nextFrameNormal = bglGetAttribLocationARB(program, "nextFrameNormal"); - prprograms[programbits].uniform_frameProgress = bglGetUniformLocationARB(program, "frameProgress"); + prprograms[programbits].attrib_nextFrameData = glGetAttribLocation(program, "nextFrameData"); + prprograms[programbits].attrib_nextFrameNormal = glGetAttribLocation(program, "nextFrameNormal"); + prprograms[programbits].uniform_frameProgress = glGetUniformLocation(program, "frameProgress"); } // PR_BIT_NORMAL_MAP if (programbits & prprogrambits[PR_BIT_NORMAL_MAP].bit) { - prprograms[programbits].attrib_T = bglGetAttribLocationARB(program, "T"); - prprograms[programbits].attrib_B = bglGetAttribLocationARB(program, "B"); - prprograms[programbits].attrib_N = bglGetAttribLocationARB(program, "N"); - prprograms[programbits].uniform_eyePosition = bglGetUniformLocationARB(program, "eyePosition"); - prprograms[programbits].uniform_normalMap = bglGetUniformLocationARB(program, "normalMap"); - prprograms[programbits].uniform_normalBias = bglGetUniformLocationARB(program, "normalBias"); + prprograms[programbits].attrib_T = glGetAttribLocation(program, "T"); + prprograms[programbits].attrib_B = glGetAttribLocation(program, "B"); + prprograms[programbits].attrib_N = glGetAttribLocation(program, "N"); + prprograms[programbits].uniform_eyePosition = glGetUniformLocation(program, "eyePosition"); + prprograms[programbits].uniform_normalMap = glGetUniformLocation(program, "normalMap"); + prprograms[programbits].uniform_normalBias = glGetUniformLocation(program, "normalBias"); } // PR_BIT_ART_MAP if (programbits & prprogrambits[PR_BIT_ART_MAP].bit) { - prprograms[programbits].uniform_artMap = bglGetUniformLocationARB(program, "artMap"); - prprograms[programbits].uniform_basePalMap = bglGetUniformLocationARB(program, "basePalMap"); - prprograms[programbits].uniform_lookupMap = bglGetUniformLocationARB(program, "lookupMap"); - prprograms[programbits].uniform_shadeOffset = bglGetUniformLocationARB(program, "shadeOffset"); - prprograms[programbits].uniform_visibility = bglGetUniformLocationARB(program, "visibility"); + prprograms[programbits].uniform_artMap = glGetUniformLocation(program, "artMap"); + prprograms[programbits].uniform_basePalMap = glGetUniformLocation(program, "basePalMap"); + prprograms[programbits].uniform_lookupMap = glGetUniformLocation(program, "lookupMap"); + prprograms[programbits].uniform_shadeOffset = glGetUniformLocation(program, "shadeOffset"); + prprograms[programbits].uniform_visibility = glGetUniformLocation(program, "visibility"); } // PR_BIT_DIFFUSE_MAP if (programbits & prprogrambits[PR_BIT_DIFFUSE_MAP].bit) { - prprograms[programbits].uniform_diffuseMap = bglGetUniformLocationARB(program, "diffuseMap"); - prprograms[programbits].uniform_diffuseScale = bglGetUniformLocationARB(program, "diffuseScale"); + prprograms[programbits].uniform_diffuseMap = glGetUniformLocation(program, "diffuseMap"); + prprograms[programbits].uniform_diffuseScale = glGetUniformLocation(program, "diffuseScale"); } // PR_BIT_HIGHPALOOKUP_MAP if (programbits & prprogrambits[PR_BIT_HIGHPALOOKUP_MAP].bit) { - prprograms[programbits].uniform_highPalookupMap = bglGetUniformLocationARB(program, "highPalookupMap"); + prprograms[programbits].uniform_highPalookupMap = glGetUniformLocation(program, "highPalookupMap"); } // PR_BIT_DIFFUSE_DETAIL_MAP if (programbits & prprogrambits[PR_BIT_DIFFUSE_DETAIL_MAP].bit) { - prprograms[programbits].uniform_detailMap = bglGetUniformLocationARB(program, "detailMap"); - prprograms[programbits].uniform_detailScale = bglGetUniformLocationARB(program, "detailScale"); + prprograms[programbits].uniform_detailMap = glGetUniformLocation(program, "detailMap"); + prprograms[programbits].uniform_detailScale = glGetUniformLocation(program, "detailScale"); } // PR_BIT_SPECULAR_MAP if (programbits & prprogrambits[PR_BIT_SPECULAR_MAP].bit) { - prprograms[programbits].uniform_specMap = bglGetUniformLocationARB(program, "specMap"); + prprograms[programbits].uniform_specMap = glGetUniformLocation(program, "specMap"); } // PR_BIT_SPECULAR_MATERIAL if (programbits & prprogrambits[PR_BIT_SPECULAR_MATERIAL].bit) { - prprograms[programbits].uniform_specMaterial = bglGetUniformLocationARB(program, "specMaterial"); + prprograms[programbits].uniform_specMaterial = glGetUniformLocation(program, "specMaterial"); } // PR_BIT_MIRROR_MAP if (programbits & prprogrambits[PR_BIT_MIRROR_MAP].bit) { - prprograms[programbits].uniform_mirrorMap = bglGetUniformLocationARB(program, "mirrorMap"); + prprograms[programbits].uniform_mirrorMap = glGetUniformLocation(program, "mirrorMap"); } #ifdef PR_LINEAR_FOG if (programbits & prprogrambits[PR_BIT_FOG].bit) { - prprograms[programbits].uniform_linearFog = bglGetUniformLocationARB(program, "linearFog"); + prprograms[programbits].uniform_linearFog = glGetUniformLocation(program, "linearFog"); } #endif // PR_BIT_GLOW_MAP if (programbits & prprogrambits[PR_BIT_GLOW_MAP].bit) { - prprograms[programbits].uniform_glowMap = bglGetUniformLocationARB(program, "glowMap"); + prprograms[programbits].uniform_glowMap = glGetUniformLocation(program, "glowMap"); } // PR_BIT_PROJECTION_MAP if (programbits & prprogrambits[PR_BIT_PROJECTION_MAP].bit) { - prprograms[programbits].uniform_shadowProjMatrix = bglGetUniformLocationARB(program, "shadowProjMatrix"); + prprograms[programbits].uniform_shadowProjMatrix = glGetUniformLocation(program, "shadowProjMatrix"); } // PR_BIT_SHADOW_MAP if (programbits & prprogrambits[PR_BIT_SHADOW_MAP].bit) { - prprograms[programbits].uniform_shadowMap = bglGetUniformLocationARB(program, "shadowMap"); + prprograms[programbits].uniform_shadowMap = glGetUniformLocation(program, "shadowMap"); } // PR_BIT_LIGHT_MAP if (programbits & prprogrambits[PR_BIT_LIGHT_MAP].bit) { - prprograms[programbits].uniform_lightMap = bglGetUniformLocationARB(program, "lightMap"); + prprograms[programbits].uniform_lightMap = glGetUniformLocation(program, "lightMap"); } // PR_BIT_SPOT_LIGHT if (programbits & prprogrambits[PR_BIT_SPOT_LIGHT].bit) { - prprograms[programbits].uniform_spotDir = bglGetUniformLocationARB(program, "spotDir"); - prprograms[programbits].uniform_spotRadius = bglGetUniformLocationARB(program, "spotRadius"); + prprograms[programbits].uniform_spotDir = glGetUniformLocation(program, "spotDir"); + prprograms[programbits].uniform_spotRadius = glGetUniformLocation(program, "spotRadius"); } } @@ -5952,22 +5952,22 @@ static void polymer_processspotlight(_prlight* light) ang = (float)(light->angle) * (360.f/2048.f); horizang = (float)(-getangle(128, light->horiz-100)) * (360.f/2048.f); - bglMatrixMode(GL_PROJECTION); - bglPushMatrix(); - bglLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); bgluPerspective(radius * 2, 1, 0.1f, light->range * (1.f/1000.f)); - bglGetFloatv(GL_PROJECTION_MATRIX, light->proj); - bglPopMatrix(); + glGetFloatv(GL_PROJECTION_MATRIX, light->proj); + glPopMatrix(); - bglMatrixMode(GL_MODELVIEW); - bglPushMatrix(); - bglLoadIdentity(); - bglRotatef(horizang, 1.0f, 0.0f, 0.0f); - bglRotatef(ang, 0.0f, 1.0f, 0.0f); - bglScalef(1.0f / 1000.0f, 1.0f / 1000.0f, 1.0f / 1000.0f); - bglTranslatef(-lightpos[0], -lightpos[1], -lightpos[2]); - bglGetFloatv(GL_MODELVIEW_MATRIX, light->transform); - bglPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + glRotatef(horizang, 1.0f, 0.0f, 0.0f); + glRotatef(ang, 0.0f, 1.0f, 0.0f); + glScalef(1.0f / 1000.0f, 1.0f / 1000.0f, 1.0f / 1000.0f); + glTranslatef(-lightpos[0], -lightpos[1], -lightpos[2]); + glGetFloatv(GL_MODELVIEW_MATRIX, light->transform); + glPopMatrix(); polymer_extractfrustum(light->transform, light->proj, light->frustum); @@ -6156,20 +6156,20 @@ static void polymer_prepareshadows(void) prlights[i].rtindex = j + 1; if (pr_verbosity >= 3) OSD_Printf("PR : Drawing shadow %i...\n", i); - bglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prrts[prlights[i].rtindex].fbo); - bglPushAttrib(GL_VIEWPORT_BIT); - bglViewport(0, 0, prrts[prlights[i].rtindex].xdim, prrts[prlights[i].rtindex].ydim); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prrts[prlights[i].rtindex].fbo); + glPushAttrib(GL_VIEWPORT_BIT); + glViewport(0, 0, prrts[prlights[i].rtindex].xdim, prrts[prlights[i].rtindex].ydim); - bglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - bglMatrixMode(GL_PROJECTION); - bglPushMatrix(); - bglLoadMatrixf(prlights[i].proj); - bglMatrixMode(GL_MODELVIEW); - bglLoadMatrixf(prlights[i].transform); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadMatrixf(prlights[i].proj); + glMatrixMode(GL_MODELVIEW); + glLoadMatrixf(prlights[i].transform); - bglEnable(GL_POLYGON_OFFSET_FILL); - bglPolygonOffset(5, SHADOW_DEPTH_OFFSET); + glEnable(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(5, SHADOW_DEPTH_OFFSET); set_globalpos(prlights[i].x, prlights[i].y, prlights[i].z); @@ -6191,13 +6191,13 @@ static void polymer_prepareshadows(void) overridematerial = oldoverridematerial; - bglDisable(GL_POLYGON_OFFSET_FILL); + glDisable(GL_POLYGON_OFFSET_FILL); - bglMatrixMode(GL_PROJECTION); - bglPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); - bglPopAttrib(); - bglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glPopAttrib(); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); j++; } @@ -6226,13 +6226,13 @@ static void polymer_initrendertargets(int32_t count) { if (prrts[i].color) { - bglDeleteTextures(1, &prrts[i].color); + glDeleteTextures(1, &prrts[i].color); prrts[i].color = 0; } - bglDeleteTextures(1, &prrts[i].z); + glDeleteTextures(1, &prrts[i].z); prrts[i].z = 0; - bglDeleteFramebuffersEXT(1, &prrts[i].fbo); + glDeleteFramebuffersEXT(1, &prrts[i].fbo); prrts[i].fbo = 0; } DO_FREE_AND_NULL(prrts); @@ -6251,18 +6251,18 @@ static void polymer_initrendertargets(int32_t count) while (i < count) { if (!i) { - prrts[i].target = GL_TEXTURE_RECTANGLE; + prrts[i].target = GL_TEXTURE_RECTANGLE_ARB; prrts[i].xdim = xdim; prrts[i].ydim = ydim; - bglGenTextures(1, &prrts[i].color); - bglBindTexture(prrts[i].target, prrts[i].color); + glGenTextures(1, &prrts[i].color); + glBindTexture(prrts[i].target, prrts[i].color); - bglTexImage2D(prrts[i].target, 0, GL_RGB, prrts[i].xdim, prrts[i].ydim, 0, GL_RGB, GL_SHORT, NULL); - bglTexParameteri(prrts[i].target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - bglTexParameteri(prrts[i].target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); - bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_T, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glTexImage2D(prrts[i].target, 0, GL_RGB, prrts[i].xdim, prrts[i].ydim, 0, GL_RGB, GL_SHORT, NULL); + glTexParameteri(prrts[i].target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(prrts[i].target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_T, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); } else { prrts[i].target = GL_TEXTURE_2D; prrts[i].xdim = 128 << pr_shadowdetail; @@ -6270,48 +6270,48 @@ static void polymer_initrendertargets(int32_t count) prrts[i].color = 0; if (pr_ati_fboworkaround) { - bglGenTextures(1, &prrts[i].color); - bglBindTexture(prrts[i].target, prrts[i].color); + glGenTextures(1, &prrts[i].color); + glBindTexture(prrts[i].target, prrts[i].color); - bglTexImage2D(prrts[i].target, 0, GL_RGB, prrts[i].xdim, prrts[i].ydim, 0, GL_RGB, GL_SHORT, NULL); - bglTexParameteri(prrts[i].target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - bglTexParameteri(prrts[i].target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); - bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_T, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glTexImage2D(prrts[i].target, 0, GL_RGB, prrts[i].xdim, prrts[i].ydim, 0, GL_RGB, GL_SHORT, NULL); + glTexParameteri(prrts[i].target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(prrts[i].target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_T, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); } } - bglGenTextures(1, &prrts[i].z); - bglBindTexture(prrts[i].target, prrts[i].z); + glGenTextures(1, &prrts[i].z); + glBindTexture(prrts[i].target, prrts[i].z); - bglTexImage2D(prrts[i].target, 0, GL_DEPTH_COMPONENT, prrts[i].xdim, prrts[i].ydim, 0, GL_DEPTH_COMPONENT, GL_SHORT, NULL); - bglTexParameteri(prrts[i].target, GL_TEXTURE_MIN_FILTER, pr_shadowfiltering ? GL_LINEAR : GL_NEAREST); - bglTexParameteri(prrts[i].target, GL_TEXTURE_MAG_FILTER, pr_shadowfiltering ? GL_LINEAR : GL_NEAREST); - bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); - bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_T, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); - bglTexParameteri(prrts[i].target, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB); - bglTexParameteri(prrts[i].target, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL); - bglTexParameteri(prrts[i].target, GL_DEPTH_TEXTURE_MODE_ARB, GL_ALPHA); + glTexImage2D(prrts[i].target, 0, GL_DEPTH_COMPONENT, prrts[i].xdim, prrts[i].ydim, 0, GL_DEPTH_COMPONENT, GL_SHORT, NULL); + glTexParameteri(prrts[i].target, GL_TEXTURE_MIN_FILTER, pr_shadowfiltering ? GL_LINEAR : GL_NEAREST); + glTexParameteri(prrts[i].target, GL_TEXTURE_MAG_FILTER, pr_shadowfiltering ? GL_LINEAR : GL_NEAREST); + glTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_S, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_T, glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP); + glTexParameteri(prrts[i].target, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); + glTexParameteri(prrts[i].target, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); + glTexParameteri(prrts[i].target, GL_DEPTH_TEXTURE_MODE, GL_ALPHA); - bglGenFramebuffersEXT(1, &prrts[i].fbo); - bglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prrts[i].fbo); + glGenFramebuffersEXT(1, &prrts[i].fbo); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prrts[i].fbo); if (prrts[i].color) - bglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, prrts[i].target, prrts[i].color, 0); else { - bglDrawBuffer(GL_NONE); - bglReadBuffer(GL_NONE); + glDrawBuffer(GL_NONE); + glReadBuffer(GL_NONE); } - bglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, prrts[i].target, prrts[i].z, 0); + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, prrts[i].target, prrts[i].z, 0); - if (bglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) + if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) { OSD_Printf("PR : FBO #%d initialization failed.\n", i); } - bglBindTexture(prrts[i].target, 0); - bglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glBindTexture(prrts[i].target, 0); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); i++; } diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 72b21510b..d730524b6 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -8,7 +8,7 @@ Ken Silverman's official web site: http://www.advsys.net/ken #include "compat.h" #include "build.h" -#include "glbuild.h" +#include "glad/glad.h" #include "mdsprite.h" #include "pragmas.h" #include "baselayer.h" @@ -213,12 +213,12 @@ static void bind_2d_texture(GLuint texture, int filter) if (filter == -1) filter = gltexfiltermode; - bglBindTexture(GL_TEXTURE_2D, texture); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glfiltermodes[filter].mag); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, glfiltermodes[filter].min); + glBindTexture(GL_TEXTURE_2D, texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glfiltermodes[filter].mag); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, glfiltermodes[filter].min); #ifdef USE_GLEXT if (glinfo.maxanisotropy > 1.f) - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, glanisotropy); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, glanisotropy); #endif } @@ -308,11 +308,11 @@ void polymost_glreset() if (pth->flags & PTH_HASFULLBRIGHT) { - bglDeleteTextures(1, &pth->ofb->glpic); + glDeleteTextures(1, &pth->ofb->glpic); Bfree(pth->ofb); } - bglDeleteTextures(1, &pth->glpic); + glDeleteTextures(1, &pth->glpic); Bfree(pth); pth = next; } @@ -324,7 +324,7 @@ void polymost_glreset() } if (polymosttext) - bglDeleteTextures(1,&polymosttext); + glDeleteTextures(1,&polymosttext); polymosttext=0; #ifdef USE_GLEXT @@ -349,43 +349,43 @@ static void Polymost_DetermineTextureFormatSupport(void); // reset vertex pointers to polymost default void polymost_resetVertexPointers() { - bglVertexPointer(3, GL_FLOAT, 5*sizeof(float), drawpolyVerts); - bglTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (drawpolyVerts+3)); + glVertexPointer(3, GL_FLOAT, 5*sizeof(float), drawpolyVerts); + glTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (drawpolyVerts+3)); #ifdef USE_GLEXT if (r_detailmapping) { - bglClientActiveTextureARB(GL_TEXTURE1); - bglTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (drawpolyVerts+3)); + glClientActiveTexture(GL_TEXTURE1); + glTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (drawpolyVerts+3)); } if (r_glowmapping) { - bglClientActiveTextureARB(GL_TEXTURE2); - bglTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (drawpolyVerts+3)); + glClientActiveTexture(GL_TEXTURE2); + glTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (drawpolyVerts+3)); } - bglClientActiveTextureARB(GL_TEXTURE0_ARB); + glClientActiveTexture(GL_TEXTURE0); #endif } // one-time initialization of OpenGL for polymost void polymost_glinit() { - bglHint(GL_FOG_HINT, GL_NICEST); - bglFogi(GL_FOG_MODE, (r_usenewshading < 2) ? GL_EXP2 : GL_LINEAR); - bglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glHint(GL_FOG_HINT, GL_NICEST); + glFogi(GL_FOG_MODE, (r_usenewshading < 2) ? GL_EXP2 : GL_LINEAR); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - bglPixelStorei(GL_PACK_ALIGNMENT, 1); - bglPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - //bglHint(GL_LINE_SMOOTH_HINT, GL_NICEST); - //bglEnable(GL_LINE_SMOOTH); + //glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + //glEnable(GL_LINE_SMOOTH); #ifdef USE_GLEXT if (glmultisample > 0 && glinfo.multisample) { if (glinfo.nvmultisamplehint) - bglHint(GL_MULTISAMPLE_FILTER_HINT_NV, glnvmultisamplehint ? GL_NICEST:GL_FASTEST); - bglEnable(GL_MULTISAMPLE_ARB); + glHint(GL_MULTISAMPLE_FILTER_HINT_NV, glnvmultisamplehint ? GL_NICEST:GL_FASTEST); + glEnable(GL_MULTISAMPLE); } if (!glinfo.multitex || !glinfo.envcombine) @@ -410,8 +410,8 @@ void polymost_glinit() } #endif - bglEnableClientState(GL_VERTEX_ARRAY); - bglEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); polymost_resetVertexPointers(); @@ -538,22 +538,22 @@ void calc_and_apply_fog(int32_t tile, int32_t shade, int32_t vis, int32_t pal) } } - bglFogf(GL_FOG_START, fogresult); - bglFogf(GL_FOG_END, fogresult2); - bglFogfv(GL_FOG_COLOR, (GLfloat *)&fogcol); + glFogf(GL_FOG_START, fogresult); + glFogf(GL_FOG_END, fogresult2); + glFogfv(GL_FOG_COLOR, (GLfloat *)&fogcol); return; } fogcalc(tile, shade, vis, pal); - bglFogfv(GL_FOG_COLOR, (GLfloat *)&fogcol); + glFogfv(GL_FOG_COLOR, (GLfloat *)&fogcol); if (r_usenewshading < 2) - bglFogf(GL_FOG_DENSITY, fogresult); + glFogf(GL_FOG_DENSITY, fogresult); else { - bglFogf(GL_FOG_START, fogresult); - bglFogf(GL_FOG_END, fogresult2); + glFogf(GL_FOG_START, fogresult); + glFogf(GL_FOG_END, fogresult2); } } @@ -580,9 +580,9 @@ void calc_and_apply_fog_factor(int32_t tile, int32_t shade, int32_t vis, int32_t fogresult2 = GL_FOG_MAX - (GL_FOG_MAX * fogrange); } - bglFogf(GL_FOG_START, fogresult); - bglFogf(GL_FOG_END, fogresult2); - bglFogfv(GL_FOG_COLOR, (GLfloat *)&fogcol); + glFogf(GL_FOG_START, fogresult); + glFogf(GL_FOG_END, fogresult2); + glFogfv(GL_FOG_COLOR, (GLfloat *)&fogcol); return; } @@ -590,14 +590,14 @@ void calc_and_apply_fog_factor(int32_t tile, int32_t shade, int32_t vis, int32_t // NOTE: for r_usenewshading >= 2, the fog beginning/ending distance results are // unused. fogcalc(tile, shade, vis, pal); - bglFogfv(GL_FOG_COLOR, (GLfloat *)&fogcol); + glFogfv(GL_FOG_COLOR, (GLfloat *)&fogcol); if (r_usenewshading < 2) - bglFogf(GL_FOG_DENSITY, fogresult*factor); + glFogf(GL_FOG_DENSITY, fogresult*factor); else { - bglFogf(GL_FOG_START, (GLfloat) FULLVIS_BEGIN); - bglFogf(GL_FOG_END, (GLfloat) FULLVIS_END); + glFogf(GL_FOG_START, (GLfloat) FULLVIS_BEGIN); + glFogf(GL_FOG_END, (GLfloat) FULLVIS_END); } } //////////////////// @@ -628,21 +628,21 @@ static void resizeglcheck(void) { default: case 0: - bglPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break; + glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break; case 1: - bglPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break; + glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break; case 2: - bglPolygonMode(GL_FRONT_AND_BACK,GL_POINT); break; + glPolygonMode(GL_FRONT_AND_BACK,GL_POINT); break; } } if (r_polygonmode) //FUK { - bglClearColor(1.0,1.0,1.0,0.0); - bglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); - bglDisable(GL_TEXTURE_2D); + glClearColor(1.0,1.0,1.0,0.0); + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); + glDisable(GL_TEXTURE_2D); } #else - bglPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); #endif if ((glox1 != windowxy1.x) || (gloy1 != windowxy1.y) || (glox2 != windowxy2.x) || (gloy2 != windowxy2.y)) @@ -656,10 +656,10 @@ static void resizeglcheck(void) glox1 = (float)windowxy1.x; gloy1 = (float)windowxy1.y; glox2 = (float)windowxy2.x; gloy2 = (float)windowxy2.y; - bglViewport(windowxy1.x-(fovcorrect/2), yres-(windowxy2.y+1), + glViewport(windowxy1.x-(fovcorrect/2), yres-(windowxy2.y+1), ourxdimen+fovcorrect, windowxy2.y-windowxy1.y+1); - bglMatrixMode(GL_PROJECTION); + glMatrixMode(GL_PROJECTION); float m[4][4]; Bmemset(m,0,sizeof(m)); @@ -669,14 +669,14 @@ static void resizeglcheck(void) m[1][1] = fxdimen; m[1][2] = 1.f; m[2][2] = 1.f; m[2][3] = fydimen * ratio; m[3][2] =-1.f; - bglLoadMatrixf(&m[0][0]); + glLoadMatrixf(&m[0][0]); - bglMatrixMode(GL_MODELVIEW); - bglLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); - if (!nofog) bglEnable(GL_FOG); + if (!nofog) glEnable(GL_FOG); - //bglEnable(GL_TEXTURE_2D); + //glEnable(GL_TEXTURE_2D); } } @@ -785,7 +785,7 @@ static ETCFunction_t Polymost_PickETCFunction(int32_t const comprtexfmt) static int Polymost_ConfirmNoGLError(void) { GLenum checkerr, err = GL_NO_ERROR; - while ((checkerr = bglGetError()) != GL_NO_ERROR) + while ((checkerr = glGetError()) != GL_NO_ERROR) err = checkerr; return err == GL_NO_ERROR; @@ -795,7 +795,7 @@ static int32_t Polymost_TryDummyTexture(coltype const * const pic, int32_t const { while (*formats) { - bglTexImage2D(GL_TEXTURE_2D, 0, *formats, 4,4, 0, GL_RGBA, GL_UNSIGNED_BYTE, pic); + glTexImage2D(GL_TEXTURE_2D, 0, *formats, 4,4, 0, GL_RGBA, GL_UNSIGNED_BYTE, pic); if (Polymost_ConfirmNoGLError()) return *formats; @@ -831,8 +831,8 @@ static void Polymost_DetermineTextureFormatSupport(void) coltype pic[4*4] = { { 0, 0, 0, 0 } }; GLuint tex = 0; - bglGenTextures(1, &tex); - bglBindTexture(GL_TEXTURE_2D, tex); + glGenTextures(1, &tex); + glBindTexture(GL_TEXTURE_2D, tex); BuildGLErrorCheck(); // XXX: Clear errors. @@ -844,7 +844,7 @@ static void Polymost_DetermineTextureFormatSupport(void) comprtexfmt_rgba = Polymost_TryCompressedDummyTexture(pic, comprtexfmts_rgba); comprtexfmt_rgb_mask = Polymost_TryCompressedDummyTexture(pic, comprtexfmts_rgb_mask); - bglDeleteTextures(1, &tex); + glDeleteTextures(1, &tex); } #endif @@ -911,9 +911,9 @@ static void Polymost_SendTexToDriver(int32_t const doalloc, GLenum type = GL_UNSIGNED_INT_8_8_8_8_REV; #endif if (doalloc & 1) - bglTexImage2D(GL_TEXTURE_2D, level, intexfmt, siz.x,siz.y, 0, texfmt, type, pic); + glTexImage2D(GL_TEXTURE_2D, level, intexfmt, siz.x,siz.y, 0, texfmt, type, pic); else - bglTexSubImage2D(GL_TEXTURE_2D, level, 0,0, siz.x,siz.y, texfmt, type, pic); + glTexSubImage2D(GL_TEXTURE_2D, level, 0,0, siz.x,siz.y, texfmt, type, pic); } void uploadtexture(int32_t doalloc, vec2_t siz, int32_t texfmt, @@ -928,7 +928,7 @@ void uploadtexture(int32_t doalloc, vec2_t siz, int32_t texfmt, #if !defined EDUKE32_GLES int32_t intexfmt; if (texcompress_ok && glinfo.texcompr) - intexfmt = GL_COMPRESSED_RGBA_ARB; + intexfmt = GL_COMPRESSED_RGBA; else intexfmt = GL_RGBA8; #else @@ -943,7 +943,7 @@ void uploadtexture(int32_t doalloc, vec2_t siz, int32_t texfmt, if (gltexmaxsize <= 0) { GLint i = 0; - bglGetIntegerv(GL_MAX_TEXTURE_SIZE, &i); + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &i); if (!i) gltexmaxsize = 6; // 2^6 = 64 == default GL max texture size else { @@ -970,8 +970,8 @@ void uploadtexture(int32_t doalloc, vec2_t siz, int32_t texfmt, if (glfiltermodes[gltexfiltermode].min == GL_NEAREST || glfiltermodes[gltexfiltermode].min == GL_LINEAR) { - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); } if (!miplevel) @@ -1072,8 +1072,8 @@ static void polymost_setuptexture(const int32_t dameth, int filter) if (filter == -1) filter = gltexfiltermode; - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glfiltermodes[filter].mag); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, glfiltermodes[filter].min); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glfiltermodes[filter].mag); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, glfiltermodes[filter].min); #ifdef USE_GLEXT if (glinfo.maxanisotropy > 1.f) @@ -1083,20 +1083,20 @@ static void polymost_setuptexture(const int32_t dameth, int filter) if ((unsigned)glanisotropy > i) glanisotropy = i; - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, glanisotropy); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, glanisotropy); } #endif if (!(dameth & DAMETH_CLAMPED)) { - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_if_tile_is_sky(dapic, clamp_mode)); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_if_tile_is_sky(dapic, clamp_mode)); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } else { // For sprite textures, clamping looks better than wrapping - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_mode); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp_mode); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_mode); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp_mode); } } @@ -1259,8 +1259,8 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das } } - if (doalloc) bglGenTextures(1,(GLuint *)&pth->glpic); //# of textures (make OpenGL allocate structure) - bglBindTexture(GL_TEXTURE_2D,pth->glpic); + if (doalloc) glGenTextures(1,(GLuint *)&pth->glpic); //# of textures (make OpenGL allocate structure) + glBindTexture(GL_TEXTURE_2D,pth->glpic); fixtransparency(pic,tsiz,siz,dameth); @@ -1575,8 +1575,8 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp hicr->flags |= HICR_ARTIMMUNITY; if ((doalloc&3)==1) - bglGenTextures(1, &pth->glpic); //# of textures (make OpenGL allocate structure) - bglBindTexture(GL_TEXTURE_2D,pth->glpic); + glGenTextures(1, &pth->glpic); //# of textures (make OpenGL allocate structure) + glBindTexture(GL_TEXTURE_2D,pth->glpic); fixtransparency(pic,tsiz,siz,dameth); @@ -1664,61 +1664,61 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp #ifdef USE_GLEXT void polymost_setupdetailtexture(const int32_t texunits, const int32_t tex) { - bglActiveTextureARB(texunits); + glActiveTexture(texunits); - bglEnable(GL_TEXTURE_2D); - bglBindTexture(GL_TEXTURE_2D, tex); + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, tex); - bglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); - bglTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); - bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB); - bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR); + glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS); + glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); - bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE); - bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR); + glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_TEXTURE); + glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); - bglTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE); - bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB); - bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE); + glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_PREVIOUS); + glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); - bglTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2.0f); - - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE, 2.0f); - bglClientActiveTextureARB(texunits); - bglEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + + glClientActiveTexture(texunits); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); } void polymost_setupglowtexture(const int32_t texunits, const int32_t tex) { - bglActiveTextureARB(texunits); + glActiveTexture(texunits); - bglEnable(GL_TEXTURE_2D); - bglBindTexture(GL_TEXTURE_2D, tex); + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, tex); - bglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); - bglTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_INTERPOLATE_ARB); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE); - bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB); - bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR); + glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS); + glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); - bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE); - bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR); + glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_TEXTURE); + glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); - bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE2_RGB_ARB, GL_TEXTURE); - bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND2_RGB_ARB, GL_ONE_MINUS_SRC_ALPHA); + glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_TEXTURE); + glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_ONE_MINUS_SRC_ALPHA); - bglTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE); - bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB); - bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); - - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE); + glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_PREVIOUS); + glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); - bglClientActiveTextureARB(texunits); - bglEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + + glClientActiveTexture(texunits); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); } #endif @@ -1750,7 +1750,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 #endif (uint32_t)globalpicnum >= MAXTILES) return; - + const int32_t method_ = method; if (n == 3) @@ -1851,25 +1851,25 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 // just submit the geometry and don't mess with textures. if (getrendermode() == REND_POLYMOST) { - bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); + glBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); if (drawpoly_srepeat) - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); if (drawpoly_trepeat) - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); } // texture scale by parkar request if (pth && pth->hicr && !drawingskybox && ((pth->hicr->scale.x != 1.0f) || (pth->hicr->scale.y != 1.0f))) { - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglScalef(pth->hicr->scale.x, pth->hicr->scale.y, 1.0f); - bglMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glScalef(pth->hicr->scale.x, pth->hicr->scale.y, 1.0f); + glMatrixMode(GL_MODELVIEW); } #ifdef USE_GLEXT - int32_t texunits = GL_TEXTURE0_ARB; + int32_t texunits = GL_TEXTURE0; // detail texture if (r_detailmapping) @@ -1882,16 +1882,16 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 { polymost_setupdetailtexture(++texunits, detailpth->glpic); - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); if (pth && pth->hicr && ((pth->hicr->scale.x != 1.0f) || (pth->hicr->scale.y != 1.0f))) - bglScalef(pth->hicr->scale.x, pth->hicr->scale.y, 1.0f); + glScalef(pth->hicr->scale.x, pth->hicr->scale.y, 1.0f); if ((detailpth->hicr->scale.x != 1.0f) || (detailpth->hicr->scale.y != 1.0f)) - bglScalef(detailpth->hicr->scale.x, detailpth->hicr->scale.y, 1.0f); + glScalef(detailpth->hicr->scale.x, detailpth->hicr->scale.y, 1.0f); - bglMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_MODELVIEW); } } @@ -1929,19 +1929,19 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 if (!(method & DAMETH_MASKPROPS) && fullbright_pass < 2) { - bglDisable(GL_BLEND); - bglDisable(GL_ALPHA_TEST); + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); } else { float const al = waloff[globalpicnum] ? alphahackarray[globalpicnum] != 0 ? alphahackarray[globalpicnum] * (1.f/255.f): (pth && pth->hicr && pth->hicr->alphacut >= 0.f ? pth->hicr->alphacut : 0.f) : 0.f; - bglAlphaFunc(GL_GREATER, al); + glAlphaFunc(GL_GREATER, al); handle_blend((method & DAMETH_MASKPROPS) > DAMETH_MASK, drawpoly_blend, (method & DAMETH_MASKPROPS) == DAMETH_TRANS2); - bglEnable(GL_BLEND); - bglEnable(GL_ALPHA_TEST); + glEnable(GL_BLEND); + glEnable(GL_ALPHA_TEST); } float pc[4]; @@ -1982,8 +1982,8 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 globaltinting_apply(pc); } - - bglColor4f(pc[0], pc[1], pc[2], pc[3]); + + glColor4f(pc[0], pc[1], pc[2], pc[3]); //Hack for walls&masked walls which use textures that are not a power of 2 if ((pow2xsplit) && (tsiz.x != tsiz2.x)) @@ -2109,7 +2109,7 @@ do drawpolyVerts[i*5+3] = (p.u * r - du0 + uoffs) * invtsiz2.x; drawpolyVerts[i*5+4] = p.v * r * invtsiz2.y; } - bglDrawArrays(GL_TRIANGLE_FAN, 0, nn); + glDrawArrays(GL_TRIANGLE_FAN, 0, nn); } } else @@ -2129,33 +2129,33 @@ do drawpolyVerts[i*5+3] = uu[i] * r * scale.x; drawpolyVerts[i*5+4] = vv[i] * r * scale.y; } - bglDrawArrays(GL_TRIANGLE_FAN, 0, npoints); + glDrawArrays(GL_TRIANGLE_FAN, 0, npoints); } #ifdef USE_GLEXT - while (texunits > GL_TEXTURE0_ARB) + while (texunits > GL_TEXTURE0) { - bglActiveTextureARB(texunits); - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglMatrixMode(GL_MODELVIEW); + glActiveTexture(texunits); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); - bglClientActiveTextureARB(texunits); - bglDisableClientState(GL_TEXTURE_COORD_ARRAY); + glClientActiveTexture(texunits); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); - bglTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 1.0f); - bglDisable(GL_TEXTURE_2D); + glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE, 1.0f); + glDisable(GL_TEXTURE_2D); --texunits; } - bglActiveTextureARB(GL_TEXTURE0_ARB); + glActiveTexture(GL_TEXTURE0); #endif - bglMatrixMode(GL_TEXTURE); - bglLoadIdentity(); - bglMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); - bglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); if (getrendermode() != REND_POLYMOST) return; @@ -2163,10 +2163,10 @@ do int const clamp_mode = glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP; if (drawpoly_srepeat) - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_mode); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_mode); if (drawpoly_trepeat) - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp_mode); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp_mode); if (fullbright_pass == 1) { @@ -2175,16 +2175,16 @@ do globalshade = -128; fullbright_pass = 2; - bglDisable(GL_FOG); + glDisable(GL_FOG); - bglDepthFunc(GL_EQUAL); + glDepthFunc(GL_EQUAL); polymost_drawpoly(dpxy, n, method_); - bglDepthFunc(GL_LEQUAL); + glDepthFunc(GL_LEQUAL); if (!nofog) - bglEnable(GL_FOG); + glEnable(GL_FOG); globalshade = shade; fullbright_pass = 0; @@ -3345,7 +3345,7 @@ static void polymost_drawalls(int32_t const bunch) skyclamphack = 0; if (!nofog) - bglEnable(GL_FOG); + glEnable(GL_FOG); } // Ceiling @@ -3677,7 +3677,7 @@ static void polymost_drawalls(int32_t const bunch) skyclamphack = 0; if (!nofog) - bglEnable(GL_FOG); + glEnable(GL_FOG); } // Wall @@ -4066,15 +4066,15 @@ void polymost_drawrooms() if (numyaxbunches==0) #endif if (editstatus) - bglClear(GL_COLOR_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT); - bglClear(GL_DEPTH_BUFFER_BIT); + glClear(GL_DEPTH_BUFFER_BIT); - bglDisable(GL_BLEND); - bglEnable(GL_TEXTURE_2D); - bglEnable(GL_DEPTH_TEST); - bglDepthFunc(GL_LEQUAL); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS -// bglDepthRange(0.0, 1.0); //<- this is more widely supported than glPolygonOffset + glDisable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS +// glDepthRange(0.0, 1.0); //<- this is more widely supported than glPolygonOffset //Polymost supports true look up/down :) Here, we convert horizon to angle. //gchang&gshang are cos&sin of this angle (respectively) @@ -4219,8 +4219,8 @@ void polymost_drawrooms() bunchlast[closest] = bunchlast[numbunches]; } - bglDepthFunc(GL_LEQUAL); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS -// bglDepthRange(0.0, 1.0); //<- this is more widely supported than glPolygonOffset + glDepthFunc(GL_LEQUAL); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS +// glDepthRange(0.0, 1.0); //<- this is more widely supported than glPolygonOffset enddrawing(); } @@ -4631,7 +4631,7 @@ void polymost_drawsprite(int32_t snum) (float) (sintable[(ang) & 2047] >> 6) * foffs }; vec2f_t s0 = { (float)(tspr->x - globalposx) + offs.x, - (float)(tspr->y - globalposy) + offs.y }; + (float)(tspr->y - globalposy) + offs.y}; vec2f_t p0 = { s0.y * gcosang - s0.x * gsinang, s0.x * gcosang2 + s0.y * gsinang2 }; @@ -5264,16 +5264,16 @@ void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, tspr.cstat = globalorientation = (dastat&RS_TRANS1) | ((dastat&RS_TRANS2)<<4) | ((dastat&RS_YFLIP)<<1); if ((dastat&(RS_AUTO|RS_NOCLIP)) == RS_AUTO) - bglViewport(windowxy1.x, yres-(windowxy2.y+1), windowxy2.x-windowxy1.x+1, windowxy2.y-windowxy1.y+1); + glViewport(windowxy1.x, yres-(windowxy2.y+1), windowxy2.x-windowxy1.x+1, windowxy2.y-windowxy1.y+1); else { - bglViewport(0, 0, xdim, ydim); + glViewport(0, 0, xdim, ydim); glox1 = -1; //Force fullscreen (glox1=-1 forces it to restore) } if (getrendermode() < REND_POLYMER) { - bglMatrixMode(GL_PROJECTION); + glMatrixMode(GL_PROJECTION); Bmemset(m, 0, sizeof(m)); if ((dastat&(RS_AUTO|RS_NOCLIP)) == RS_AUTO) @@ -5300,31 +5300,31 @@ void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, m[3][2] = 1-m[2][2]; } - bglLoadMatrixf(&m[0][0]); + glLoadMatrixf(&m[0][0]); - bglMatrixMode(GL_MODELVIEW); - bglLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); } if (hud->flags & HUDFLAG_NODEPTH) - bglDisable(GL_DEPTH_TEST); + glDisable(GL_DEPTH_TEST); else { static int32_t onumframes = 0; - bglEnable(GL_DEPTH_TEST); + glEnable(GL_DEPTH_TEST); if (onumframes != numframes) { onumframes = numframes; - bglClear(GL_DEPTH_BUFFER_BIT); + glClear(GL_DEPTH_BUFFER_BIT); } } spriteext[tspr.owner].alpha = daalpha * (1.0f / 255.0f); tspr.blend = dablend; - bglDisable(GL_FOG); + glDisable(GL_FOG); if (getrendermode() == REND_POLYMOST) polymost_mddraw(&tspr); @@ -5335,8 +5335,8 @@ void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, tspriteptr[maxspritesonscreen] = &tspr; - bglEnable(GL_ALPHA_TEST); - bglEnable(GL_BLEND); + glEnable(GL_ALPHA_TEST); + glEnable(GL_BLEND); spriteext[tspr.owner].roll = a; spriteext[tspr.owner].offset.z = z; @@ -5358,11 +5358,11 @@ void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, spriteext[tspr.owner].offset.z = 0; spriteext[tspr.owner].roll = 0; - bglDisable(GL_BLEND); - bglDisable(GL_ALPHA_TEST); + glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); } # endif - if (!nofog) bglEnable(GL_FOG); + if (!nofog) glEnable(GL_FOG); viewingrange = oldviewingrange; fviewingrange = oldfviewingrange; @@ -5385,9 +5385,9 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 return; } - bglViewport(0,0,xdim,ydim); glox1 = -1; //Force fullscreen (glox1=-1 forces it to restore) - bglMatrixMode(GL_PROJECTION); - bglPushMatrix(); + glViewport(0,0,xdim,ydim); glox1 = -1; //Force fullscreen (glox1=-1 forces it to restore) + glMatrixMode(GL_PROJECTION); + glPushMatrix(); globvis = 0; @@ -5424,14 +5424,14 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 m[2][2] = 1.0001f; m[3][2] = 1 - m[2][2]; - bglLoadMatrixf(&m[0][0]); - bglMatrixMode(GL_MODELVIEW); - bglPushMatrix(); - bglLoadIdentity(); + glLoadMatrixf(&m[0][0]); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); - bglDisable(GL_DEPTH_TEST); - bglDisable(GL_ALPHA_TEST); - bglEnable(GL_TEXTURE_2D); + glDisable(GL_DEPTH_TEST); + glDisable(GL_ALPHA_TEST); + glEnable(GL_TEXTURE_2D); #if defined(POLYMER) # ifdef USE_GLEXT @@ -5577,9 +5577,9 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 } while (z); - bglDisable(GL_FOG); + glDisable(GL_FOG); pow2xsplit = 0; polymost_drawpoly(pxy, n,method); - if (!nofog) bglEnable(GL_FOG); + if (!nofog) glEnable(GL_FOG); } #ifdef POLYMER @@ -5593,9 +5593,9 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 pr_normalmapping = oldnormalmapping; } #endif - bglPopMatrix(); - bglMatrixMode(GL_PROJECTION); - bglPopMatrix(); + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); globalpicnum = ogpicnum; globalshade = ogshade; @@ -5624,15 +5624,15 @@ static void drawtrap(float x0, float x1, float y0, float x2, float x3, float y1) else if (x2 == x3) { px[1] = x1; py[1] = y0; px[2] = x3; } else { px[1] = x1; py[1] = y0; px[2] = x3; px[3] = x2; py[3] = y1; n = 4; } - bglBegin(GL_TRIANGLE_FAN); + glBegin(GL_TRIANGLE_FAN); for (bssize_t i=0; iglpic : 0); + glBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); float const f = getshadefactor(globalshade); @@ -5802,13 +5802,13 @@ void polymost_fillpolygon(int32_t npoints) handle_blend(maskprops > DAMETH_MASK, 0, maskprops == DAMETH_TRANS2); if (maskprops > DAMETH_MASK) { - bglEnable(GL_BLEND); - bglColor4f(f, f, f, float_trans(maskprops, 0)); + glEnable(GL_BLEND); + glColor4f(f, f, f, float_trans(maskprops, 0)); } else { - bglDisable(GL_BLEND); - bglColor3f(f, f, f); + glDisable(GL_BLEND); + glColor3f(f, f, f); } tessectrap((float *)rx1,(float *)ry1,xb1,npoints); @@ -5859,9 +5859,9 @@ int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, i loadedhitile[wallnum>>3] |= (1<<(wallnum&7)); usehightile = ousehightile; - bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); + glBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); - bglDisable(GL_ALPHA_TEST); + glDisable(GL_ALPHA_TEST); if (tilezoom) { @@ -5871,32 +5871,32 @@ int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, i if (!pth || (pth->flags & PTH_HASALPHA)) { - bglDisable(GL_TEXTURE_2D); - bglBegin(GL_TRIANGLE_FAN); + glDisable(GL_TEXTURE_2D); + glBegin(GL_TRIANGLE_FAN); if (gammabrightness) - bglColor3f((float)curpalette[255].r*(1.0f/255.f), + glColor3f((float)curpalette[255].r*(1.0f/255.f), (float)curpalette[255].g*(1.0f/255.f), (float)curpalette[255].b*(1.0f/255.f)); else - bglColor3f((float)britable[curbrightness][ curpalette[255].r ] * (1.0f/255.f), + glColor3f((float)britable[curbrightness][ curpalette[255].r ] * (1.0f/255.f), (float)britable[curbrightness][ curpalette[255].g ] * (1.0f/255.f), (float)britable[curbrightness][ curpalette[255].b ] * (1.0f/255.f)); - bglVertex2f((float)tilex ,(float)tiley); - bglVertex2f((float)tilex+(scx*ratio),(float)tiley); - bglVertex2f((float)tilex+(scx*ratio),(float)tiley+(scy*ratio)); - bglVertex2f((float)tilex ,(float)tiley+(scy*ratio)); - bglEnd(); + glVertex2f((float)tilex ,(float)tiley); + glVertex2f((float)tilex+(scx*ratio),(float)tiley); + glVertex2f((float)tilex+(scx*ratio),(float)tiley+(scy*ratio)); + glVertex2f((float)tilex ,(float)tiley+(scy*ratio)); + glEnd(); } - bglColor3f(1,1,1); - bglEnable(GL_TEXTURE_2D); - bglEnable(GL_BLEND); - bglBegin(GL_TRIANGLE_FAN); - bglTexCoord2f(0, 0); bglVertex2f((float)tilex ,(float)tiley); - bglTexCoord2f(xdimepad, 0); bglVertex2f((float)tilex+(scx*ratio),(float)tiley); - bglTexCoord2f(xdimepad,ydimepad); bglVertex2f((float)tilex+(scx*ratio),(float)tiley+(scy*ratio)); - bglTexCoord2f(0, ydimepad); bglVertex2f((float)tilex ,(float)tiley+(scy*ratio)); - bglEnd(); + glColor3f(1,1,1); + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBegin(GL_TRIANGLE_FAN); + glTexCoord2f(0, 0); glVertex2f((float)tilex ,(float)tiley); + glTexCoord2f(xdimepad, 0); glVertex2f((float)tilex+(scx*ratio),(float)tiley); + glTexCoord2f(xdimepad,ydimepad); glVertex2f((float)tilex+(scx*ratio),(float)tiley+(scy*ratio)); + glTexCoord2f(0, ydimepad); glVertex2f((float)tilex ,(float)tiley+(scy*ratio)); + glEnd(); return 0; } @@ -5905,7 +5905,7 @@ static int32_t gen_font_glyph_tex(void) { // construct a 256x128 8-bit alpha-only texture for the font glyph matrix - bglGenTextures(1,&polymosttext); + glGenTextures(1,&polymosttext); if (!polymosttext) return -1; @@ -5943,10 +5943,10 @@ static int32_t gen_font_glyph_tex(void) } } - bglBindTexture(GL_TEXTURE_2D, polymosttext); - bglTexImage2D(GL_TEXTURE_2D,0,GL_ALPHA,256,128,0,GL_ALPHA,GL_UNSIGNED_BYTE,(GLvoid *)tbuf); - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); - bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); + glBindTexture(GL_TEXTURE_2D, polymosttext); + glTexImage2D(GL_TEXTURE_2D,0,GL_ALPHA,256,128,0,GL_ALPHA,GL_UNSIGNED_BYTE,(GLvoid *)tbuf); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); Bfree(tbuf); return 0; @@ -5968,43 +5968,43 @@ int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t ba if (getrendermode() < REND_POLYMOST || !in3dmode() || (!polymosttext && gen_font_glyph_tex() < 0)) return -1; else - bglBindTexture(GL_TEXTURE_2D, polymosttext); + glBindTexture(GL_TEXTURE_2D, polymosttext); setpolymost2dview(); // disables blending, texturing, and depth testing - bglDisable(GL_ALPHA_TEST); - bglDepthMask(GL_FALSE); // disable writing to the z-buffer + glDisable(GL_ALPHA_TEST); + glDepthMask(GL_FALSE); // disable writing to the z-buffer -// bglPushAttrib(GL_POLYGON_BIT|GL_ENABLE_BIT); +// glPushAttrib(GL_POLYGON_BIT|GL_ENABLE_BIT); // XXX: Don't fogify the OSD text in Mapster32 with r_usenewshading >= 2. - bglDisable(GL_FOG); + glDisable(GL_FOG); // We want to have readable text in wireframe mode, too: - bglPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); if (backcol >= 0) { int const c = Bstrlen(name); - bglColor4ub(b.r,b.g,b.b,255); + glColor4ub(b.r,b.g,b.b,255); - bglBegin(GL_QUADS); + glBegin(GL_QUADS); - bglVertex2i(xpos,ypos); - bglVertex2i(xpos,ypos+(fontsize?6:8)); - bglVertex2i(xpos+(c<<(3-fontsize)), ypos+(fontsize ? 6 : 8)); - bglVertex2i(xpos+(c<<(3-fontsize)), ypos); + glVertex2i(xpos,ypos); + glVertex2i(xpos,ypos+(fontsize?6:8)); + glVertex2i(xpos+(c<<(3-fontsize)), ypos+(fontsize ? 6 : 8)); + glVertex2i(xpos+(c<<(3-fontsize)), ypos); - bglEnd(); + glEnd(); } - bglEnable(GL_TEXTURE_2D); - bglEnable(GL_BLEND); - bglColor4ub(p.r,p.g,p.b,255); + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glColor4ub(p.r,p.g,p.b,255); vec2f_t const tc = { fontsize ? (4.f / 256.f) : (8.f / 256.f), fontsize ? (6.f / 128.f) : (8.f / 128.f) }; - bglBegin(GL_QUADS); + glBegin(GL_QUADS); for (bssize_t c=0; name[c]; ++c) { @@ -6031,7 +6031,7 @@ int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t ba bricolor(&p, col); - bglColor4ub(p.r, p.g, p.b, 255); + glColor4ub(p.r, p.g, p.b, 255); continue; } @@ -6039,28 +6039,28 @@ int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t ba vec2f_t const t = { (float)(name[c] % 32) * (1.0f / 32.f), (float)((name[c] / 32) + (fontsize * 8)) * (1.0f / 16.f) }; - bglTexCoord2f(t.x, t.y); - bglVertex2i(xpos, ypos); + glTexCoord2f(t.x, t.y); + glVertex2i(xpos, ypos); - bglTexCoord2f(t.x + tc.x, t.y); - bglVertex2i(xpos + (8 >> fontsize), ypos); + glTexCoord2f(t.x + tc.x, t.y); + glVertex2i(xpos + (8 >> fontsize), ypos); - bglTexCoord2f(t.x + tc.x, t.y + tc.y); - bglVertex2i(xpos + (8 >> fontsize), ypos + (fontsize ? 6 : 8)); + glTexCoord2f(t.x + tc.x, t.y + tc.y); + glVertex2i(xpos + (8 >> fontsize), ypos + (fontsize ? 6 : 8)); - bglTexCoord2f(t.x, t.y + tc.y); - bglVertex2i(xpos, ypos + (fontsize ? 6 : 8)); + glTexCoord2f(t.x, t.y + tc.y); + glVertex2i(xpos, ypos + (fontsize ? 6 : 8)); xpos += (8>>fontsize); } - bglEnd(); + glEnd(); - bglDepthMask(GL_TRUE); // re-enable writing to the z-buffer + glDepthMask(GL_TRUE); // re-enable writing to the z-buffer -// bglPopAttrib(); +// glPopAttrib(); - if (!nofog) bglEnable(GL_FOG); + if (!nofog) glEnable(GL_FOG); return 0; } @@ -6148,7 +6148,7 @@ static int32_t osdcmd_cvar_set_polymost(osdfuncparm_t const * const parm) else if (!Bstrcasecmp(parm->name, "r_texfilter")) gltexturemode(parm); else if (!Bstrcasecmp(parm->name, "r_usenewshading")) - bglFogi(GL_FOG_MODE, (r_usenewshading < 2) ? GL_EXP2 : GL_LINEAR); + glFogi(GL_FOG_MODE, (r_usenewshading < 2) ? GL_EXP2 : GL_LINEAR); #ifdef POLYMER else if (!Bstrcasecmp(parm->name, "r_pr_maxlightpasses")) { diff --git a/source/build/src/screenshot.cpp b/source/build/src/screenshot.cpp index c530b101e..59ecc8906 100644 --- a/source/build/src/screenshot.cpp +++ b/source/build/src/screenshot.cpp @@ -70,7 +70,7 @@ int screencapture(const char *filename, char inverseit) #ifdef USE_OPENGL if (HICOLOR) { - bglReadPixels(0, 0, xdim, ydim, GL_RGB, GL_UNSIGNED_BYTE, imgBuf); + glReadPixels(0, 0, xdim, ydim, GL_RGB, GL_UNSIGNED_BYTE, imgBuf); int const bytesPerLine = xdim * 3; if (inverseit) @@ -198,7 +198,7 @@ int screencapture_tga(const char *filename, char inverseit) int const size = xdim * ydim * 3; uint8_t *inversebuf = (uint8_t *) Xmalloc(size); - bglReadPixels(0, 0, xdim, ydim, GL_RGB, GL_UNSIGNED_BYTE, inversebuf); + glReadPixels(0, 0, xdim, ydim, GL_RGB, GL_UNSIGNED_BYTE, inversebuf); for (i = 0; i < size; i += 3) swapchar(&inversebuf[i], &inversebuf[i + 2]); diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 57f65bd84..4a156b8d8 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -17,6 +17,7 @@ #include "palette.h" #ifdef USE_OPENGL +# include "glad/glad.h" # include "glbuild.h" #endif @@ -616,11 +617,18 @@ int32_t initsystem(void) if (!novideo) { #ifdef USE_OPENGL - if (loadgldriver(getenv("BUILD_GLDRV"))) + if (SDL_GL_LoadLibrary(0)) { - initprintf("Failed loading OpenGL driver. GL modes will be unavailable.\n"); + initprintf("Failed loading OpenGL Driver. GL modes will be unavailable. Error: %s\n", SDL_GetError()); nogl = 1; } +#ifdef POLYMER + if (loadglulibrary(getenv("BUILD_GLULIB"))) + { + initprintf("Failed loading GLU. GL modes will be unavailable. Error: %s\n", SDL_GetError()); + nogl = 1; + } +#endif #endif #ifndef _WIN32 @@ -658,7 +666,10 @@ void uninitsystem(void) #endif #ifdef USE_OPENGL - unloadgldriver(); + SDL_GL_UnloadLibrary(); +#ifdef POLYMER + unloadglulibrary(); +#endif #endif } @@ -1294,20 +1305,20 @@ void sdlayer_setvideomode_opengl(void) { polymost_glreset(); - bglEnable(GL_TEXTURE_2D); - bglShadeModel(GL_SMOOTH); // GL_FLAT - bglClearColor(0, 0, 0, 1.0); // Black Background - bglHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Use FASTEST for ortho! -// bglHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_SMOOTH); // GL_FLAT + glClearColor(0, 0, 0, 1.0); // Black Background + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Use FASTEST for ortho! +// glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); #ifndef EDUKE32_GLES - bglDisable(GL_DITHER); + glDisable(GL_DITHER); #endif - glinfo.vendor = (const char *) bglGetString(GL_VENDOR); - glinfo.renderer = (const char *) bglGetString(GL_RENDERER); - glinfo.version = (const char *) bglGetString(GL_VERSION); - glinfo.extensions = (const char *) bglGetString(GL_EXTENSIONS); + glinfo.vendor = (const char *) glGetString(GL_VENDOR); + glinfo.renderer = (const char *) glGetString(GL_RENDERER); + glinfo.version = (const char *) glGetString(GL_VERSION); + glinfo.extensions = (const char *) glGetString(GL_EXTENSIONS); #ifdef POLYMER if (!Bstrcmp(glinfo.vendor, "ATI Technologies Inc.")) @@ -1355,7 +1366,7 @@ void sdlayer_setvideomode_opengl(void) #if !defined EDUKE32_GLES glinfo.texcompr = !!Bstrstr(glinfo.extensions, "GL_ARB_texture_compression") && Bstrcmp(glinfo.vendor, "ATI Technologies Inc."); # ifdef DYNAMIC_GLEXT - if (glinfo.texcompr && (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)) + if (glinfo.texcompr && (!glCompressedTexImage2D || !glGetCompressedTexImage)) { // lacking the necessary extensions to do this initprintf("Warning: the GL driver lacks necessary functions to use caching\n"); @@ -1394,7 +1405,7 @@ void sdlayer_setvideomode_opengl(void) #endif // if (Bstrstr(glinfo.extensions, "GL_EXT_texture_filter_anisotropic")) - bglGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glinfo.maxanisotropy); + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glinfo.maxanisotropy); if (!glinfo.dumped) { @@ -1627,14 +1638,12 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) return -1; } + gladLoadGLLoader(SDL_GL_GetProcAddress); + SDL_SetWindowFullscreen(sdl_window, ((fs & 1) ? SDL_WINDOW_FULLSCREEN : 0)); SDL_GL_SetSwapInterval(vsync_renderlayer); setrefreshrate(); - -#ifdef _WIN32 - loadglextensions(); -#endif } while (multisamplecheck--); } else diff --git a/source/build/src/sdlayer12.cpp b/source/build/src/sdlayer12.cpp index 7083305ec..aa889e997 100644 --- a/source/build/src/sdlayer12.cpp +++ b/source/build/src/sdlayer12.cpp @@ -93,11 +93,18 @@ int32_t initsystem(void) char drvname[32]; #ifdef USE_OPENGL - if (loadgldriver(getenv("BUILD_GLDRV"))) + if (SDL_GL_LoadLibrary(0)) { initprintf("Failed loading OpenGL driver. GL modes will be unavailable.\n"); nogl = 1; } +#ifdef POLYMER + if (loadglulibrary(getenv("BUILD_GLULIB"))) + { + initprintf("Failed loading GLU. GL modes will be unavailable.\n"); + nogl = 1; + } +#endif #endif if (SDL_VideoDriverName(drvname, 32)) diff --git a/source/build/src/texcache.cpp b/source/build/src/texcache.cpp index 3b5ba76e4..28e90d4ed 100644 --- a/source/build/src/texcache.cpp +++ b/source/build/src/texcache.cpp @@ -11,7 +11,7 @@ #include "xxhash.h" #include "kplib.h" -#define CLEAR_GL_ERRORS() while(bglGetError() != GL_NO_ERROR) { } +#define CLEAR_GL_ERRORS() while(glGetError() != GL_NO_ERROR) { } #define TEXCACHE_FREEBUFS() { Bfree(pic), Bfree(packbuf), Bfree(midbuf); } globaltexcache texcache; @@ -23,8 +23,8 @@ static const char *texcache_errors[TEXCACHEERRORS] = { "out of memory!", "read too few bytes from cache file", "dedxtfilter failed", - "bglCompressedTexImage2DARB failed", - "bglGetTexLevelParameteriv failed", + "glCompressedTexImage2DARB failed", + "glGetTexLevelParameteriv failed", }; static pthtyp *texcache_tryart(int32_t const dapicnum, int32_t const dapalnum, int32_t const dashade, int32_t const dameth) @@ -544,14 +544,14 @@ void texcache_prewritetex(texcacheheader *head) head->quality = B_LITTLE32(head->quality); } -#define WRITEX_FAIL_ON_ERROR() if (bglGetError() != GL_NO_ERROR) goto failure +#define WRITEX_FAIL_ON_ERROR() if (glGetError() != GL_NO_ERROR) goto failure void texcache_writetex_fromdriver(char const * const cacheid, texcacheheader *head) { if (!texcache_enabled()) return; GLint gi = GL_FALSE; - bglGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_ARB, &gi); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED, &gi); if (gi != GL_TRUE) { static GLint glGetTexLevelParameterivOK = GL_TRUE; @@ -581,12 +581,12 @@ void texcache_writetex_fromdriver(char const * const cacheid, texcacheheader *he for (uint32_t level = 0, padx = 0, pady = 0; level == 0 || (padx > 1 || pady > 1); ++level) { - bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_COMPRESSED_ARB, &gi); + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_COMPRESSED, &gi); WRITEX_FAIL_ON_ERROR(); if (gi != GL_TRUE) goto failure; // an uncompressed mipmap - bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, &gi); + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, &gi); WRITEX_FAIL_ON_ERROR(); #if defined __APPLE__ && defined POLYMER @@ -595,25 +595,25 @@ void texcache_writetex_fromdriver(char const * const cacheid, texcacheheader *he // native -> external (little endian) pict.format = B_LITTLE32(gi); - bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_WIDTH, &gi); + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_WIDTH, &gi); WRITEX_FAIL_ON_ERROR(); padx = gi; pict.xdim = B_LITTLE32(gi); - bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_HEIGHT, &gi); + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_HEIGHT, &gi); WRITEX_FAIL_ON_ERROR(); pady = gi; pict.ydim = B_LITTLE32(gi); - bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_BORDER, &gi); + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_BORDER, &gi); WRITEX_FAIL_ON_ERROR(); pict.border = B_LITTLE32(gi); - bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_DEPTH, &gi); + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_DEPTH, &gi); WRITEX_FAIL_ON_ERROR(); pict.depth = B_LITTLE32(gi); - bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &gi); + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &gi); WRITEX_FAIL_ON_ERROR(); uint32_t miplen = gi; pict.size = B_LITTLE32(gi); @@ -626,7 +626,7 @@ void texcache_writetex_fromdriver(char const * const cacheid, texcacheheader *he midbuf = (void *)Xrealloc(midbuf, miplen); } - bglGetCompressedTexImageARB(GL_TEXTURE_2D, level, pic); + glGetCompressedTexImage(GL_TEXTURE_2D, level, pic); WRITEX_FAIL_ON_ERROR(); if (Bwrite(texcache.handle, &pict, sizeof(texcachepicture)) != sizeof(texcachepicture)) goto failure; @@ -698,11 +698,11 @@ static void texcache_setuptexture(int32_t *doalloc, GLuint *glpic) { if (*doalloc&1) { - bglGenTextures(1, glpic); //# of textures (make OpenGL allocate structure) - *doalloc |= 2; // prevents bglGenTextures being called again if we fail in here + glGenTextures(1, glpic); //# of textures (make OpenGL allocate structure) + *doalloc |= 2; // prevents glGenTextures being called again if we fail in here } - bglBindTexture(GL_TEXTURE_2D, *glpic); + glBindTexture(GL_TEXTURE_2D, *glpic); } static int32_t texcache_loadmips(const texcacheheader *head, GLenum *glerr) @@ -751,16 +751,16 @@ static int32_t texcache_loadmips(const texcacheheader *head, GLenum *glerr) return TEXCACHERR_DEDXT; } - bglCompressedTexImage2DARB(GL_TEXTURE_2D, level, pict.format, pict.xdim, pict.ydim, pict.border, pict.size, pic); - if ((*glerr=bglGetError()) != GL_NO_ERROR) + glCompressedTexImage2D(GL_TEXTURE_2D, level, pict.format, pict.xdim, pict.ydim, pict.border, pict.size, pic); + if ((*glerr=glGetError()) != GL_NO_ERROR) { TEXCACHE_FREEBUFS(); return TEXCACHERR_COMPTEX; } GLint format; - bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, &format); - if ((*glerr = bglGetError()) != GL_NO_ERROR) + glGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, &format); + if ((*glerr = glGetError()) != GL_NO_ERROR) { TEXCACHE_FREEBUFS(); return TEXCACHERR_GETTEXLEVEL; diff --git a/source/build/src/voxmodel.cpp b/source/build/src/voxmodel.cpp index 05be7e6a4..0a81def1c 100644 --- a/source/build/src/voxmodel.cpp +++ b/source/build/src/voxmodel.cpp @@ -4,7 +4,7 @@ #include "compat.h" #include "build.h" -#include "glbuild.h" +#include "glad/glad.h" #include "pragmas.h" #include "baselayer.h" #include "engine_priv.h" @@ -71,11 +71,11 @@ uint32_t gloadtex(int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, i uint32_t rtexid; - bglGenTextures(1, (GLuint *) &rtexid); - bglBindTexture(GL_TEXTURE_2D, rtexid); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - bglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - bglTexImage2D(GL_TEXTURE_2D, 0, 4, xsiz, ysiz, 0, GL_RGBA, GL_UNSIGNED_BYTE, (char *) pic2); + glGenTextures(1, (GLuint *) &rtexid); + glBindTexture(GL_TEXTURE_2D, rtexid); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, 4, xsiz, ysiz, 0, GL_RGBA, GL_UNSIGNED_BYTE, (char *) pic2); Bfree(pic2); @@ -954,21 +954,21 @@ int32_t polymost_voxdraw(voxmodel_t *m, const uspritetype *tspr) if (tspr->extra&TSPR_EXTRA_MDHACK) { - bglDepthFunc(GL_LESS); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS -// bglDepthRange(0.0, 0.9999); + glDepthFunc(GL_LESS); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS +// glDepthRange(0.0, 0.9999); } -// bglPushAttrib(GL_POLYGON_BIT); +// glPushAttrib(GL_POLYGON_BIT); if ((grhalfxdown10x >= 0) /*^ ((globalorientation&8) != 0) ^ ((globalorientation&4) != 0)*/) - bglFrontFace(GL_CW); + glFrontFace(GL_CW); else - bglFrontFace(GL_CCW); + glFrontFace(GL_CCW); - bglEnable(GL_CULL_FACE); - bglCullFace(GL_BACK); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); - bglEnable(GL_TEXTURE_2D); + glEnable(GL_TEXTURE_2D); float pc[4]; @@ -982,7 +982,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, const uspritetype *tspr) handle_blend(!!(tspr->cstat & 2), tspr->blend, !!(tspr->cstat & 512)); if ((tspr->cstat&2) || spriteext[tspr->owner].alpha > 0.f || pc[3] < 1.0f) - bglEnable(GL_BLEND); //else bglDisable(GL_BLEND); + glEnable(GL_BLEND); //else glDisable(GL_BLEND); //------------ //transform to Build coords @@ -998,10 +998,10 @@ int32_t polymost_voxdraw(voxmodel_t *m, const uspritetype *tspr) mat[13] -= (m->piv.x*mat[1] + m->piv.y*mat[5] + (m->piv.z+m->siz.z*.5f)*mat[9]); mat[14] -= (m->piv.x*mat[2] + m->piv.y*mat[6] + (m->piv.z+m->siz.z*.5f)*mat[10]); // - bglMatrixMode(GL_MODELVIEW); //Let OpenGL (and perhaps hardware :) handle the matrix rotation + glMatrixMode(GL_MODELVIEW); //Let OpenGL (and perhaps hardware :) handle the matrix rotation mat[3] = mat[7] = mat[11] = 0.f; mat[15] = 1.f; - bglLoadMatrixf(mat); + glLoadMatrixf(mat); const float ru = 1.f/((float)m->mytexx); const float rv = 1.f/((float)m->mytexy); @@ -1014,16 +1014,16 @@ int32_t polymost_voxdraw(voxmodel_t *m, const uspritetype *tspr) if (!m->texid[globalpal]) m->texid[globalpal] = gloadtex(m->mytex, m->mytexx, m->mytexy, m->is8bit, globalpal); else - bglBindTexture(GL_TEXTURE_2D, m->texid[globalpal]); + glBindTexture(GL_TEXTURE_2D, m->texid[globalpal]); - bglBegin(GL_QUADS); // {{{ + glBegin(GL_QUADS); // {{{ for (bssize_t i=0, fi=0; iqcnt; i++) { if (i == m->qfacind[fi]) { f = 1 /*clut[fi++]*/; - bglColor4f(pc[0]*f, pc[1]*f, pc[2]*f, pc[3]*f); + glColor4f(pc[0]*f, pc[1]*f, pc[2]*f, pc[3]*f); } const vert_t *const vptr = &m->quad[i].v[0]; @@ -1036,30 +1036,30 @@ int32_t polymost_voxdraw(voxmodel_t *m, const uspritetype *tspr) { vec3f_t fp; #if (VOXBORDWIDTH == 0) - bglTexCoord2f(((float)vptr[j].u)*ru + uhack[vptr[j].u!=vptr[0].u], + glTexCoord2f(((float)vptr[j].u)*ru + uhack[vptr[j].u!=vptr[0].u], ((float)vptr[j].v)*rv + vhack[vptr[j].v!=vptr[0].v]); #else - bglTexCoord2f(((float)vptr[j].u)*ru, ((float)vptr[j].v)*rv); + glTexCoord2f(((float)vptr[j].u)*ru, ((float)vptr[j].v)*rv); #endif fp.x = ((float)vptr[j].x) - phack[xx>vptr[j].x*2] + phack[xxvptr[j].y*2] + phack[yyvptr[j].z*2] + phack[zzextra&TSPR_EXTRA_MDHACK) { - bglDepthFunc(GL_LESS); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS -// bglDepthRange(0.0, 0.99999); + glDepthFunc(GL_LESS); //NEVER,LESS,(,L)EQUAL,GREATER,(NOT,G)EQUAL,ALWAYS +// glDepthRange(0.0, 0.99999); } - bglLoadIdentity(); + glLoadIdentity(); return 1; } diff --git a/source/build/src/winlayer.cpp b/source/build/src/winlayer.cpp index 3e3c70a9b..7ad9ac946 100644 --- a/source/build/src/winlayer.cpp +++ b/source/build/src/winlayer.cpp @@ -5,6 +5,11 @@ #include "build.h" +#ifdef USE_OPENGL +#include "glbuild.h" +#include "glad/glad_wgl.h" +#endif + #define NEED_DINPUT_H #define NEED_DDRAW_H #ifdef _MSC_VER @@ -488,7 +493,7 @@ int32_t initsystem(void) win_init(); #ifdef USE_OPENGL - if (loadgldriver(getenv("BUILD_GLDRV"))) + if (loadwgl(getenv("BUILD_GLDRV"))) { initprintf("Failure loading OpenGL. GL modes are unavailable.\n"); nogl = 1; @@ -539,7 +544,12 @@ void uninitsystem(void) win_uninit(); #ifdef USE_OPENGL - unloadgldriver(); + //POGO: there is no equivalent to unloadgldriver() with GLAD's loader, but this shouldn't be a problem. + //unloadgldriver(); + unloadwgl(); +#ifdef POLYMER + unloadglulibrary(); +#endif #endif } @@ -1631,7 +1641,7 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) } #if defined USE_OPENGL && defined USE_GLEXT - if (hGLWindow && glinfo.vsync) bwglSwapIntervalEXT(vsync_renderlayer); + if (hGLWindow && glinfo.vsync) wglSwapIntervalEXT(vsync_renderlayer); #endif if (inp) AcquireInputDevices(1); modechange=1; @@ -1667,7 +1677,7 @@ int32_t setvsync(int32_t newSync) return 0; } # ifdef USE_GLEXT - bwglSwapIntervalEXT(newSync); + wglSwapIntervalEXT(newSync); # endif #endif @@ -1902,7 +1912,7 @@ void showframe(int32_t w) if (palfadedelta) fullscreen_tint_gl(palfadergb.r, palfadergb.g, palfadergb.b, palfadedelta); - bwglSwapBuffers(hDC); + SwapBuffers(hDC); return; } #endif @@ -2568,8 +2578,8 @@ static void ReleaseOpenGL(void) if (hGLRC) { polymost_glreset(); - if (!bwglMakeCurrent(0,0)) { } - if (!bwglDeleteContext(hGLRC)) { } + if (!wglMakeCurrent(0,0)) { } + if (!wglDeleteContext(hGLRC)) { } hGLRC = NULL; } if (hGLWindow) @@ -2650,7 +2660,7 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) minidriver = Bstrcasecmp(gldriver,"opengl32.dll"); - if (minidriver) PixelFormat = bwglChoosePixelFormat(hDC,&pfd); + if (minidriver) PixelFormat = wglChoosePixelFormat(hDC,&pfd); else PixelFormat = ChoosePixelFormat(hDC,&pfd); if (!PixelFormat) { @@ -2659,7 +2669,7 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) return TRUE; } - if (minidriver) err = bwglSetPixelFormat(hDC, PixelFormat, &pfd); + if (minidriver) err = wglSetPixelFormat(hDC, PixelFormat, &pfd); else err = SetPixelFormat(hDC, PixelFormat, &pfd); if (!err) { @@ -2668,7 +2678,7 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) return TRUE; } - hGLRC = bwglCreateContext(hDC); + hGLRC = wglCreateContext(hDC); if (!hGLRC) { @@ -2677,19 +2687,40 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) return TRUE; } - if (!bwglMakeCurrent(hDC, hGLRC)) + if (!wglMakeCurrent(hDC, hGLRC)) { ReleaseOpenGL(); ShowErrorBox("Can't activate GL RC"); return TRUE; } - - loadglextensions(); + + static int32_t glLoaded = 0; + if (!glLoaded) + { + if (!gladLoadWGL(hDC) || !gladLoadGL()) + { + initprintf("Failure loading OpenGL. GL modes are unavailable.\n"); + nogl = 1; + ReleaseOpenGL(); + return TRUE; +#ifdef POLYMER + } else if (loadglulibrary(getenv("BUILD_GLULIB"))) + { + initprintf("Failure loading GLU. GL modes are unavailable.\n"); + nogl = 1; + ReleaseOpenGL(); + return TRUE; +#endif + } else + { + glLoaded = 1; + } + } # if defined DEBUGGINGAIDS && defined USE_GLEXT // We should really be checking for the new WGL extension string instead // Enable this to leverage ARB_debug_output - if (bwglCreateContextAttribsARB) { + if (wglCreateContextAttribsARB) { HGLRC debuggingContext = hGLRC; // This corresponds to WGL_CONTEXT_FLAGS_ARB set to WGL_CONTEXT_DEBUG_BIT_ARB @@ -2699,37 +2730,34 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) 0 }; - debuggingContext = bwglCreateContextAttribsARB(hDC, NULL, attribs); + debuggingContext = wglCreateContextAttribsARB(hDC, NULL, attribs); if (debuggingContext) { - bwglDeleteContext(hGLRC); - bwglMakeCurrent(hDC, debuggingContext); + wglDeleteContext(hGLRC); + wglMakeCurrent(hDC, debuggingContext); hGLRC = debuggingContext; - - // This should be able to get the ARB_debug_output symbols - loadglextensions(); } } # endif polymost_glreset(); - bglEnable(GL_TEXTURE_2D); - bglShadeModel(GL_SMOOTH); //GL_FLAT - bglClearColor(0,0,0,0.5); //Black Background - bglHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST); //Use FASTEST for ortho! - bglHint(GL_LINE_SMOOTH_HINT,GL_NICEST); - bglHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST); - bglDisable(GL_DITHER); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_SMOOTH); //GL_FLAT + glClearColor(0,0,0,0.5); //Black Background + glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST); //Use FASTEST for ortho! + glHint(GL_LINE_SMOOTH_HINT,GL_NICEST); + glHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST); + glDisable(GL_DITHER); { GLubyte *p,*p2,*p3; int32_t err = 0; - glinfo.vendor = (char const *)bglGetString(GL_VENDOR); - glinfo.renderer = (char const *)bglGetString(GL_RENDERER); - glinfo.version = (char const *)bglGetString(GL_VERSION); - glinfo.extensions = (char const *)bglGetString(GL_EXTENSIONS); + glinfo.vendor = (char const *)glGetString(GL_VENDOR); + glinfo.renderer = (char const *)glGetString(GL_RENDERER); + glinfo.version = (char const *)glGetString(GL_VERSION); + glinfo.extensions = (char const *)glGetString(GL_EXTENSIONS); // GL driver blacklist @@ -2779,7 +2807,9 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) OSD_Printf("Unsupported OpenGL driver detected. GL modes will be unavailable. Use -forcegl to override.\n"); wm_msgbox("Unsupported OpenGL driver", "Unsupported OpenGL driver detected. GL modes will be unavailable."); ReleaseOpenGL(); - unloadgldriver(); + //POGO: there is no equivalent to unloadgldriver() with GLAD's loader, but this shouldn't be a problem. + //unloadgldriver(); + unloadwgl(); nogl = 1; modeschecked = 0; getvalidmodes(); @@ -2798,7 +2828,7 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) if (!Bstrcmp((char *)p2, "GL_EXT_texture_filter_anisotropic")) { // supports anisotropy. get the maximum anisotropy level - bglGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glinfo.maxanisotropy); + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glinfo.maxanisotropy); } else if (!Bstrcmp((char *)p2, "GL_EXT_texture_edge_clamp") || !Bstrcmp((char *)p2, "GL_SGIS_texture_edge_clamp")) @@ -2817,7 +2847,7 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) glinfo.texcompr = 1; #ifdef DYNAMIC_GLEXT - if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB) + if (!glCompressedTexImage2D || !glGetCompressedTexImage) { // lacking the necessary extensions to do this initprintf("Warning: the GL driver lacks necessary functions to use caching\n"); diff --git a/source/duke3d/src/astub.cpp b/source/duke3d/src/astub.cpp index 0cbeb03e5..95cc30e3e 100644 --- a/source/duke3d/src/astub.cpp +++ b/source/duke3d/src/astub.cpp @@ -2362,7 +2362,7 @@ static void m32_showmouse(void) if (getrendermode() >= REND_POLYMOST) { push_nofog(); - bglDisable(GL_TEXTURE_2D); + glDisable(GL_TEXTURE_2D); } #endif @@ -2509,15 +2509,15 @@ static int32_t DrawTiles(int32_t iTopLeft, int32_t iSelected, int32_t nXTiles, i static inline void pushDisableFog(void) { #ifdef USE_OPENGL - bglPushAttrib(GL_ENABLE_BIT); - bglDisable(GL_FOG); + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_FOG); #endif } static inline void popDisableFog(void) { #ifdef USE_OPENGL - bglPopAttrib(); + glPopAttrib(); #endif } @@ -3264,7 +3264,7 @@ static int32_t OnSelectTile(int32_t tileNum) setpolymost2dview(); #ifdef USE_OPENGL - bglEnable(GL_TEXTURE_2D); + glEnable(GL_TEXTURE_2D); #endif clearview(-1); @@ -3497,10 +3497,10 @@ static int32_t DrawTiles(int32_t iTopLeft, int32_t iSelected, int32_t nXTiles, i if (getrendermode() >= REND_POLYMOST) { - bglEnable(GL_TEXTURE_2D); + glEnable(GL_TEXTURE_2D); if (lazyselector) - bglDrawBuffer(GL_FRONT_AND_BACK); + glDrawBuffer(GL_FRONT_AND_BACK); } #endif clearview(-1); @@ -3577,7 +3577,7 @@ restart: showframe(1); #ifdef USE_OPENGL if (getrendermode() >= REND_POLYMOST && lazyselector) - bglDrawBuffer(GL_BACK); + glDrawBuffer(GL_BACK); #endif return 1; } @@ -3609,7 +3609,7 @@ restart: #ifdef USE_OPENGL if (getrendermode() >= REND_POLYMOST && lazyselector) - bglDrawBuffer(GL_BACK); + glDrawBuffer(GL_BACK); #endif return 0; diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 0885c6158..056bdb175 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -62,7 +62,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #endif #ifdef _WIN32 -# define WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 # include # define UPDATEINTERVAL 604800 // 1w # include "winbits.h" @@ -670,7 +670,7 @@ static void G_ReadGLFrame(void) } begindrawing(); - bglReadPixels(0, 0, xdim, ydim, GL_RGBA, GL_UNSIGNED_BYTE, frame); + glReadPixels(0, 0, xdim, ydim, GL_RGBA, GL_UNSIGNED_BYTE, frame); enddrawing(); for (y = 0; y < 200; y++) diff --git a/source/duke3d/src/osdfuncs.cpp b/source/duke3d/src/osdfuncs.cpp index 5ec1f02f9..33c510679 100644 --- a/source/duke3d/src/osdfuncs.cpp +++ b/source/duke3d/src/osdfuncs.cpp @@ -145,18 +145,18 @@ void GAME_clearbackground(int32_t numcols, int32_t numrows) if (getrendermode() >= REND_POLYMOST && qsetmode==200) { const int32_t i8n8 = OSD_SCALE(OSDCHAR_HEIGHT*numrows); -// bglPushAttrib(GL_FOG_BIT); - bglDisable(GL_FOG); +// glPushAttrib(GL_FOG_BIT); + glDisable(GL_FOG); setpolymost2dview(); - bglColor4f(0.f, 0.f, 0.f, 0.67f); - bglEnable(GL_BLEND); - bglRecti(0, 0, xdim, i8n8+OSDCHAR_HEIGHT); - bglColor4f(0.f, 0.f, 0.f, 1.f); - bglRecti(0, i8n8+4, xdim, i8n8+OSDCHAR_HEIGHT); + glColor4f(0.f, 0.f, 0.f, 0.67f); + glEnable(GL_BLEND); + glRecti(0, 0, xdim, i8n8+OSDCHAR_HEIGHT); + glColor4f(0.f, 0.f, 0.f, 1.f); + glRecti(0, i8n8+4, xdim, i8n8+OSDCHAR_HEIGHT); if (!nofog) - bglEnable(GL_FOG); -// bglPopAttrib(); + glEnable(GL_FOG); +// glPopAttrib(); return; } diff --git a/source/glad/README.TXT b/source/glad/README.TXT new file mode 100644 index 000000000..c29a8fcc4 --- /dev/null +++ b/source/glad/README.TXT @@ -0,0 +1,3 @@ +Generated with GLAD (GL/GLES/EGL/GLX/WGL Loader-Generator): +GL: http://glad.dav1d.de/#profile=compatibility&api=gl%3D2.0&api=gles1%3D1.0&api=gles2%3D2.0&api=glsc2%3Dnone&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_debug_output&extensions=GL_ARB_map_buffer_range&extensions=GL_ARB_texture_rectangle&extensions=GL_EXT_fog_coord&extensions=GL_EXT_framebuffer_object&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_filter_anisotropic&extensions=GL_NV_fog_distance&extensions=GL_NV_multisample_filter_hint&extensions=GL_SGIS_fog_function&extensions=GL_SGIX_fog_offset&language=c&specification=gl&loader=on +WGL: http://glad.dav1d.de/#specification=wgl&api=wgl%3D1.0&extensions=WGL_ARB_create_context&extensions=WGL_ARB_create_context_profile&extensions=WGL_ARB_extensions_string&extensions=WGL_ARB_pixel_format&extensions=WGL_EXT_extensions_string&extensions=WGL_EXT_swap_control&language=c&loader=on diff --git a/source/glad/include/KHR/khrplatform.h b/source/glad/include/KHR/khrplatform.h new file mode 100644 index 000000000..1ad3554a7 --- /dev/null +++ b/source/glad/include/KHR/khrplatform.h @@ -0,0 +1,284 @@ +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. + * + * $Revision: 32517 $ on $Date: 2016-03-11 02:41:19 -0800 (Fri, 11 Mar 2016) $ + * + * Adopters may modify this file to suit their platform. Adopters are + * encouraged to submit platform specific modifications to the Khronos + * group so that they can be included in future versions of this file. + * Please submit changes by sending them to the public Khronos Bugzilla + * (http://khronos.org/bugzilla) by filing a bug against product + * "Khronos (general)" component "Registry". + * + * A predefined template which fills in some of the bug fields can be + * reached using http://tinyurl.com/khrplatform-h-bugreport, but you + * must create a Bugzilla login first. + * + * + * See the Implementer's Guidelines for information about where this file + * should be located on your system and for more details of its use: + * http://www.khronos.org/registry/implementers_guide.pdf + * + * This file should be included as + * #include + * by Khronos client API header files that use its types and defines. + * + * The types in khrplatform.h should only be used to define API-specific types. + * + * Types defined in khrplatform.h: + * khronos_int8_t signed 8 bit + * khronos_uint8_t unsigned 8 bit + * khronos_int16_t signed 16 bit + * khronos_uint16_t unsigned 16 bit + * khronos_int32_t signed 32 bit + * khronos_uint32_t unsigned 32 bit + * khronos_int64_t signed 64 bit + * khronos_uint64_t unsigned 64 bit + * khronos_intptr_t signed same number of bits as a pointer + * khronos_uintptr_t unsigned same number of bits as a pointer + * khronos_ssize_t signed size + * khronos_usize_t unsigned size + * khronos_float_t signed 32 bit floating point + * khronos_time_ns_t unsigned 64 bit time in nanoseconds + * khronos_utime_nanoseconds_t unsigned time interval or absolute time in + * nanoseconds + * khronos_stime_nanoseconds_t signed time interval in nanoseconds + * khronos_boolean_enum_t enumerated boolean type. This should + * only be used as a base type when a client API's boolean type is + * an enum. Client APIs which use an integer or other type for + * booleans cannot use this as the base type for their boolean. + * + * Tokens defined in khrplatform.h: + * + * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. + * + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. + * + * Calling convention macros defined in this file: + * KHRONOS_APICALL + * KHRONOS_APIENTRY + * KHRONOS_APIATTRIBUTES + * + * These may be used in function prototypes as: + * + * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( + * int arg1, + * int arg2) KHRONOS_APIATTRIBUTES; + */ + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APICALL + *------------------------------------------------------------------------- + * This precedes the return type of the function in the function prototype. + */ +#if defined(_WIN32) && !defined(__SCITECH_SNAP__) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#elif defined(__ANDROID__) +# define KHRONOS_APICALL __attribute__((visibility("default"))) +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIENTRY + *------------------------------------------------------------------------- + * This follows the return type of the function and precedes the function + * name in the function prototype. + */ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) + /* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIATTRIBUTES + *------------------------------------------------------------------------- + * This follows the closing parenthesis of the function prototype arguments. + */ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- + * basic type definitions + *-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__VMS ) || defined(__sgi) + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* + * Win32 + */ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* + * Sun or Digital + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* + * Hypothetical platform with no float or int64 support + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* + * Generic fallback + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* + * Types that are (so far) the same on all platforms + */ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; + +/* + * Types that differ between LLP64 and LP64 architectures - in LLP64, + * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears + * to be the only LLP64 architecture in current use. + */ +#ifdef _WIN64 +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; +#endif + +#if KHRONOS_SUPPORT_FLOAT +/* + * Float type + */ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types + * + * These types can be used to represent a time interval in nanoseconds or + * an absolute Unadjusted System Time. Unadjusted System Time is the number + * of nanoseconds since some arbitrary system event (e.g. since the last + * time the system booted). The Unadjusted System Time is an unsigned + * 64 bit value that wraps back to 0 every 584 years. Time intervals + * may be either signed or unsigned. + */ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* + * Dummy value used to pad enum types to 32 bits. + */ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* + * Enumerated boolean type + * + * Values other than zero should be considered to be true. Therefore + * comparisons should not be made against KHRONOS_TRUE. + */ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ diff --git a/source/glad/include/glad/glad.h b/source/glad/include/glad/glad.h new file mode 100644 index 000000000..c9372eae0 --- /dev/null +++ b/source/glad/include/glad/glad.h @@ -0,0 +1,3243 @@ +/* + + OpenGL, OpenGL ES loader generated by glad 0.1.16a0 on Sat Jan 27 02:35:01 2018. + + Language/Generator: C/C++ + Specification: gl + APIs: gl=2.0, gles2=2.0, gles1=1.0 + Profile: compatibility + Extensions: + GL_ARB_buffer_storage, + GL_ARB_debug_output, + GL_ARB_map_buffer_range, + GL_ARB_texture_rectangle, + GL_EXT_fog_coord, + GL_EXT_framebuffer_object, + GL_EXT_texture_compression_s3tc, + GL_EXT_texture_filter_anisotropic, + GL_NV_fog_distance, + GL_NV_multisample_filter_hint, + GL_SGIS_fog_function, + GL_SGIX_fog_offset + Loader: True + Local files: False + Omit khrplatform: False + + Commandline: + --profile="compatibility" --api="gl=2.0,gles2=2.0,gles1=1.0" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_debug_output,GL_ARB_map_buffer_range,GL_ARB_texture_rectangle,GL_EXT_fog_coord,GL_EXT_framebuffer_object,GL_EXT_texture_compression_s3tc,GL_EXT_texture_filter_anisotropic,GL_NV_fog_distance,GL_NV_multisample_filter_hint,GL_SGIS_fog_function,GL_SGIX_fog_offset" + Online: + http://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D2.0&api=gles2%3D2.0&api=gles1%3D1.0&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_debug_output&extensions=GL_ARB_map_buffer_range&extensions=GL_ARB_texture_rectangle&extensions=GL_EXT_fog_coord&extensions=GL_EXT_framebuffer_object&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_filter_anisotropic&extensions=GL_NV_fog_distance&extensions=GL_NV_multisample_filter_hint&extensions=GL_SGIS_fog_function&extensions=GL_SGIX_fog_offset +*/ + + +#ifndef __glad_h_ +#define __glad_h_ + +#ifdef __gl_h_ +#error OpenGL header already included, remove this include, glad already provides it +#endif +#define __gl_h_ + +#ifdef __gl2_h_ +#error OpenGL ES 2 header already included, remove this include, glad already provides it +#endif +#define __gl2_h_ + +#ifdef __gl3_h_ +#error OpenGL ES 3 header already included, remove this include, glad already provides it +#endif +#define __gl3_h_ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef NOMINMAX +#define NOMINMAX 1 +#endif +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct gladGLversionStruct { + int major; + int minor; +}; + +typedef void* (* GLADloadproc)(const char *name); + +#ifndef GLAPI +# if defined(GLAD_GLAPI_EXPORT) +# if defined(_WIN32) || defined(__CYGWIN__) +# if defined(GLAD_GLAPI_EXPORT_BUILD) +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllexport)) extern +# else +# define GLAPI __declspec(dllexport) extern +# endif +# else +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllimport)) extern +# else +# define GLAPI __declspec(dllimport) extern +# endif +# endif +# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) +# define GLAPI __attribute__ ((visibility ("default"))) extern +# else +# define GLAPI extern +# endif +# else +# define GLAPI extern +# endif +#endif + +GLAPI struct gladGLversionStruct GLVersion; + +GLAPI int gladLoadGL(void); + +GLAPI int gladLoadGLLoader(GLADloadproc); + +GLAPI int gladLoadGLES2Loader(GLADloadproc); + +GLAPI int gladLoadGLES1Loader(GLADloadproc); + +#include +#include +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif +#endif +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLclampx; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef int GLsizei; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void *GLeglClientBufferEXT; +typedef void *GLeglImageOES; +typedef char GLchar; +typedef char GLcharARB; +#ifdef __APPLE__ +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +typedef unsigned short GLhalfARB; +typedef unsigned short GLhalf; +typedef GLint GLfixed; +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) +typedef long GLintptr; +#else +typedef ptrdiff_t GLintptr; +#endif +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) +typedef long GLsizeiptr; +#else +typedef ptrdiff_t GLsizeiptr; +#endif +typedef int64_t GLint64; +typedef uint64_t GLuint64; +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) +typedef long GLintptrARB; +#else +typedef ptrdiff_t GLintptrARB; +#endif +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) +typedef long GLsizeiptrARB; +#else +typedef ptrdiff_t GLsizeiptrARB; +#endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +typedef struct __GLsync *GLsync; +struct _cl_context; +struct _cl_event; +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +typedef unsigned short GLhalfNV; +typedef GLintptr GLvdpauSurfaceNV; +typedef void (APIENTRY *GLVULKANPROCNV)(void); +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_FALSE 0 +#define GL_TRUE 1 +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_NONE 0 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_VIEWPORT 0x0BA2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_REPEAT 0x2901 +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_LOGIC_OP 0x0BF1 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_COLOR_INDEX 0x1900 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_CLAMP 0x2900 +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_DOUBLE 0x140A +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#define GL_BLEND_COLOR 0x8005 +#define GL_BLEND_EQUATION 0x8009 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_FUNC_SUBTRACT 0x800A +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_SRC1_ALPHA 0x8589 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC2_ALPHA 0x858A +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_FIXED 0x140C +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RGB565 0x8D62 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_VERSION_ES_CL_1_0 1 +#define GL_VERSION_ES_CM_1_1 1 +#define GL_VERSION_ES_CL_1_1 1 +#ifndef GL_VERSION_1_0 +#define GL_VERSION_1_0 1 +GLAPI int GLAD_GL_VERSION_1_0; +typedef void (APIENTRYP PFNGLCULLFACEPROC)(GLenum mode); +GLAPI PFNGLCULLFACEPROC glad_glCullFace; +#define glCullFace glad_glCullFace +typedef void (APIENTRYP PFNGLFRONTFACEPROC)(GLenum mode); +GLAPI PFNGLFRONTFACEPROC glad_glFrontFace; +#define glFrontFace glad_glFrontFace +typedef void (APIENTRYP PFNGLHINTPROC)(GLenum target, GLenum mode); +GLAPI PFNGLHINTPROC glad_glHint; +#define glHint glad_glHint +typedef void (APIENTRYP PFNGLLINEWIDTHPROC)(GLfloat width); +GLAPI PFNGLLINEWIDTHPROC glad_glLineWidth; +#define glLineWidth glad_glLineWidth +typedef void (APIENTRYP PFNGLPOINTSIZEPROC)(GLfloat size); +GLAPI PFNGLPOINTSIZEPROC glad_glPointSize; +#define glPointSize glad_glPointSize +typedef void (APIENTRYP PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode); +GLAPI PFNGLPOLYGONMODEPROC glad_glPolygonMode; +#define glPolygonMode glad_glPolygonMode +typedef void (APIENTRYP PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLSCISSORPROC glad_glScissor; +#define glScissor glad_glScissor +typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +#define glTexParameterf glad_glTexParameterf +typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +#define glTexParameterfv glad_glTexParameterfv +typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +#define glTexParameteri glad_glTexParameteri +typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +#define glTexParameteriv glad_glTexParameteriv +typedef void (APIENTRYP PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +#define glTexImage1D glad_glTexImage1D +typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +#define glTexImage2D glad_glTexImage2D +typedef void (APIENTRYP PFNGLDRAWBUFFERPROC)(GLenum buf); +GLAPI PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +#define glDrawBuffer glad_glDrawBuffer +typedef void (APIENTRYP PFNGLCLEARPROC)(GLbitfield mask); +GLAPI PFNGLCLEARPROC glad_glClear; +#define glClear glad_glClear +typedef void (APIENTRYP PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCLEARCOLORPROC glad_glClearColor; +#define glClearColor glad_glClearColor +typedef void (APIENTRYP PFNGLCLEARSTENCILPROC)(GLint s); +GLAPI PFNGLCLEARSTENCILPROC glad_glClearStencil; +#define glClearStencil glad_glClearStencil +typedef void (APIENTRYP PFNGLCLEARDEPTHPROC)(GLdouble depth); +GLAPI PFNGLCLEARDEPTHPROC glad_glClearDepth; +#define glClearDepth glad_glClearDepth +typedef void (APIENTRYP PFNGLSTENCILMASKPROC)(GLuint mask); +GLAPI PFNGLSTENCILMASKPROC glad_glStencilMask; +#define glStencilMask glad_glStencilMask +typedef void (APIENTRYP PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI PFNGLCOLORMASKPROC glad_glColorMask; +#define glColorMask glad_glColorMask +typedef void (APIENTRYP PFNGLDEPTHMASKPROC)(GLboolean flag); +GLAPI PFNGLDEPTHMASKPROC glad_glDepthMask; +#define glDepthMask glad_glDepthMask +typedef void (APIENTRYP PFNGLDISABLEPROC)(GLenum cap); +GLAPI PFNGLDISABLEPROC glad_glDisable; +#define glDisable glad_glDisable +typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum cap); +GLAPI PFNGLENABLEPROC glad_glEnable; +#define glEnable glad_glEnable +typedef void (APIENTRYP PFNGLFINISHPROC)(void); +GLAPI PFNGLFINISHPROC glad_glFinish; +#define glFinish glad_glFinish +typedef void (APIENTRYP PFNGLFLUSHPROC)(void); +GLAPI PFNGLFLUSHPROC glad_glFlush; +#define glFlush glad_glFlush +typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); +GLAPI PFNGLBLENDFUNCPROC glad_glBlendFunc; +#define glBlendFunc glad_glBlendFunc +typedef void (APIENTRYP PFNGLLOGICOPPROC)(GLenum opcode); +GLAPI PFNGLLOGICOPPROC glad_glLogicOp; +#define glLogicOp glad_glLogicOp +typedef void (APIENTRYP PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCPROC glad_glStencilFunc; +#define glStencilFunc glad_glStencilFunc +typedef void (APIENTRYP PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); +GLAPI PFNGLSTENCILOPPROC glad_glStencilOp; +#define glStencilOp glad_glStencilOp +typedef void (APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum func); +GLAPI PFNGLDEPTHFUNCPROC glad_glDepthFunc; +#define glDepthFunc glad_glDepthFunc +typedef void (APIENTRYP PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPIXELSTOREFPROC glad_glPixelStoref; +#define glPixelStoref glad_glPixelStoref +typedef void (APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELSTOREIPROC glad_glPixelStorei; +#define glPixelStorei glad_glPixelStorei +typedef void (APIENTRYP PFNGLREADBUFFERPROC)(GLenum src); +GLAPI PFNGLREADBUFFERPROC glad_glReadBuffer; +#define glReadBuffer glad_glReadBuffer +typedef void (APIENTRYP PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GLAPI PFNGLREADPIXELSPROC glad_glReadPixels; +#define glReadPixels glad_glReadPixels +typedef void (APIENTRYP PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean *data); +GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +#define glGetBooleanv glad_glGetBooleanv +typedef void (APIENTRYP PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble *data); +GLAPI PFNGLGETDOUBLEVPROC glad_glGetDoublev; +#define glGetDoublev glad_glGetDoublev +typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(void); +GLAPI PFNGLGETERRORPROC glad_glGetError; +#define glGetError glad_glGetError +typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum pname, GLfloat *data); +GLAPI PFNGLGETFLOATVPROC glad_glGetFloatv; +#define glGetFloatv glad_glGetFloatv +typedef void (APIENTRYP PFNGLGETINTEGERVPROC)(GLenum pname, GLint *data); +GLAPI PFNGLGETINTEGERVPROC glad_glGetIntegerv; +#define glGetIntegerv glad_glGetIntegerv +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC)(GLenum name); +GLAPI PFNGLGETSTRINGPROC glad_glGetString; +#define glGetString glad_glGetString +typedef void (APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +#define glGetTexImage glad_glGetTexImage +typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +#define glGetTexParameterfv glad_glGetTexParameterfv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +#define glGetTexParameteriv glad_glGetTexParameteriv +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv +typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum cap); +GLAPI PFNGLISENABLEDPROC glad_glIsEnabled; +#define glIsEnabled glad_glIsEnabled +typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble near, GLdouble far); +GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange; +#define glDepthRange glad_glDepthRange +typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLVIEWPORTPROC glad_glViewport; +#define glViewport glad_glViewport +typedef void (APIENTRYP PFNGLNEWLISTPROC)(GLuint list, GLenum mode); +GLAPI PFNGLNEWLISTPROC glad_glNewList; +#define glNewList glad_glNewList +typedef void (APIENTRYP PFNGLENDLISTPROC)(void); +GLAPI PFNGLENDLISTPROC glad_glEndList; +#define glEndList glad_glEndList +typedef void (APIENTRYP PFNGLCALLLISTPROC)(GLuint list); +GLAPI PFNGLCALLLISTPROC glad_glCallList; +#define glCallList glad_glCallList +typedef void (APIENTRYP PFNGLCALLLISTSPROC)(GLsizei n, GLenum type, const void *lists); +GLAPI PFNGLCALLLISTSPROC glad_glCallLists; +#define glCallLists glad_glCallLists +typedef void (APIENTRYP PFNGLDELETELISTSPROC)(GLuint list, GLsizei range); +GLAPI PFNGLDELETELISTSPROC glad_glDeleteLists; +#define glDeleteLists glad_glDeleteLists +typedef GLuint (APIENTRYP PFNGLGENLISTSPROC)(GLsizei range); +GLAPI PFNGLGENLISTSPROC glad_glGenLists; +#define glGenLists glad_glGenLists +typedef void (APIENTRYP PFNGLLISTBASEPROC)(GLuint base); +GLAPI PFNGLLISTBASEPROC glad_glListBase; +#define glListBase glad_glListBase +typedef void (APIENTRYP PFNGLBEGINPROC)(GLenum mode); +GLAPI PFNGLBEGINPROC glad_glBegin; +#define glBegin glad_glBegin +typedef void (APIENTRYP PFNGLBITMAPPROC)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI PFNGLBITMAPPROC glad_glBitmap; +#define glBitmap glad_glBitmap +typedef void (APIENTRYP PFNGLCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); +GLAPI PFNGLCOLOR3BPROC glad_glColor3b; +#define glColor3b glad_glColor3b +typedef void (APIENTRYP PFNGLCOLOR3BVPROC)(const GLbyte *v); +GLAPI PFNGLCOLOR3BVPROC glad_glColor3bv; +#define glColor3bv glad_glColor3bv +typedef void (APIENTRYP PFNGLCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); +GLAPI PFNGLCOLOR3DPROC glad_glColor3d; +#define glColor3d glad_glColor3d +typedef void (APIENTRYP PFNGLCOLOR3DVPROC)(const GLdouble *v); +GLAPI PFNGLCOLOR3DVPROC glad_glColor3dv; +#define glColor3dv glad_glColor3dv +typedef void (APIENTRYP PFNGLCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); +GLAPI PFNGLCOLOR3FPROC glad_glColor3f; +#define glColor3f glad_glColor3f +typedef void (APIENTRYP PFNGLCOLOR3FVPROC)(const GLfloat *v); +GLAPI PFNGLCOLOR3FVPROC glad_glColor3fv; +#define glColor3fv glad_glColor3fv +typedef void (APIENTRYP PFNGLCOLOR3IPROC)(GLint red, GLint green, GLint blue); +GLAPI PFNGLCOLOR3IPROC glad_glColor3i; +#define glColor3i glad_glColor3i +typedef void (APIENTRYP PFNGLCOLOR3IVPROC)(const GLint *v); +GLAPI PFNGLCOLOR3IVPROC glad_glColor3iv; +#define glColor3iv glad_glColor3iv +typedef void (APIENTRYP PFNGLCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); +GLAPI PFNGLCOLOR3SPROC glad_glColor3s; +#define glColor3s glad_glColor3s +typedef void (APIENTRYP PFNGLCOLOR3SVPROC)(const GLshort *v); +GLAPI PFNGLCOLOR3SVPROC glad_glColor3sv; +#define glColor3sv glad_glColor3sv +typedef void (APIENTRYP PFNGLCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); +GLAPI PFNGLCOLOR3UBPROC glad_glColor3ub; +#define glColor3ub glad_glColor3ub +typedef void (APIENTRYP PFNGLCOLOR3UBVPROC)(const GLubyte *v); +GLAPI PFNGLCOLOR3UBVPROC glad_glColor3ubv; +#define glColor3ubv glad_glColor3ubv +typedef void (APIENTRYP PFNGLCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); +GLAPI PFNGLCOLOR3UIPROC glad_glColor3ui; +#define glColor3ui glad_glColor3ui +typedef void (APIENTRYP PFNGLCOLOR3UIVPROC)(const GLuint *v); +GLAPI PFNGLCOLOR3UIVPROC glad_glColor3uiv; +#define glColor3uiv glad_glColor3uiv +typedef void (APIENTRYP PFNGLCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); +GLAPI PFNGLCOLOR3USPROC glad_glColor3us; +#define glColor3us glad_glColor3us +typedef void (APIENTRYP PFNGLCOLOR3USVPROC)(const GLushort *v); +GLAPI PFNGLCOLOR3USVPROC glad_glColor3usv; +#define glColor3usv glad_glColor3usv +typedef void (APIENTRYP PFNGLCOLOR4BPROC)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI PFNGLCOLOR4BPROC glad_glColor4b; +#define glColor4b glad_glColor4b +typedef void (APIENTRYP PFNGLCOLOR4BVPROC)(const GLbyte *v); +GLAPI PFNGLCOLOR4BVPROC glad_glColor4bv; +#define glColor4bv glad_glColor4bv +typedef void (APIENTRYP PFNGLCOLOR4DPROC)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI PFNGLCOLOR4DPROC glad_glColor4d; +#define glColor4d glad_glColor4d +typedef void (APIENTRYP PFNGLCOLOR4DVPROC)(const GLdouble *v); +GLAPI PFNGLCOLOR4DVPROC glad_glColor4dv; +#define glColor4dv glad_glColor4dv +typedef void (APIENTRYP PFNGLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCOLOR4FPROC glad_glColor4f; +#define glColor4f glad_glColor4f +typedef void (APIENTRYP PFNGLCOLOR4FVPROC)(const GLfloat *v); +GLAPI PFNGLCOLOR4FVPROC glad_glColor4fv; +#define glColor4fv glad_glColor4fv +typedef void (APIENTRYP PFNGLCOLOR4IPROC)(GLint red, GLint green, GLint blue, GLint alpha); +GLAPI PFNGLCOLOR4IPROC glad_glColor4i; +#define glColor4i glad_glColor4i +typedef void (APIENTRYP PFNGLCOLOR4IVPROC)(const GLint *v); +GLAPI PFNGLCOLOR4IVPROC glad_glColor4iv; +#define glColor4iv glad_glColor4iv +typedef void (APIENTRYP PFNGLCOLOR4SPROC)(GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI PFNGLCOLOR4SPROC glad_glColor4s; +#define glColor4s glad_glColor4s +typedef void (APIENTRYP PFNGLCOLOR4SVPROC)(const GLshort *v); +GLAPI PFNGLCOLOR4SVPROC glad_glColor4sv; +#define glColor4sv glad_glColor4sv +typedef void (APIENTRYP PFNGLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI PFNGLCOLOR4UBPROC glad_glColor4ub; +#define glColor4ub glad_glColor4ub +typedef void (APIENTRYP PFNGLCOLOR4UBVPROC)(const GLubyte *v); +GLAPI PFNGLCOLOR4UBVPROC glad_glColor4ubv; +#define glColor4ubv glad_glColor4ubv +typedef void (APIENTRYP PFNGLCOLOR4UIPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI PFNGLCOLOR4UIPROC glad_glColor4ui; +#define glColor4ui glad_glColor4ui +typedef void (APIENTRYP PFNGLCOLOR4UIVPROC)(const GLuint *v); +GLAPI PFNGLCOLOR4UIVPROC glad_glColor4uiv; +#define glColor4uiv glad_glColor4uiv +typedef void (APIENTRYP PFNGLCOLOR4USPROC)(GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI PFNGLCOLOR4USPROC glad_glColor4us; +#define glColor4us glad_glColor4us +typedef void (APIENTRYP PFNGLCOLOR4USVPROC)(const GLushort *v); +GLAPI PFNGLCOLOR4USVPROC glad_glColor4usv; +#define glColor4usv glad_glColor4usv +typedef void (APIENTRYP PFNGLEDGEFLAGPROC)(GLboolean flag); +GLAPI PFNGLEDGEFLAGPROC glad_glEdgeFlag; +#define glEdgeFlag glad_glEdgeFlag +typedef void (APIENTRYP PFNGLEDGEFLAGVPROC)(const GLboolean *flag); +GLAPI PFNGLEDGEFLAGVPROC glad_glEdgeFlagv; +#define glEdgeFlagv glad_glEdgeFlagv +typedef void (APIENTRYP PFNGLENDPROC)(void); +GLAPI PFNGLENDPROC glad_glEnd; +#define glEnd glad_glEnd +typedef void (APIENTRYP PFNGLINDEXDPROC)(GLdouble c); +GLAPI PFNGLINDEXDPROC glad_glIndexd; +#define glIndexd glad_glIndexd +typedef void (APIENTRYP PFNGLINDEXDVPROC)(const GLdouble *c); +GLAPI PFNGLINDEXDVPROC glad_glIndexdv; +#define glIndexdv glad_glIndexdv +typedef void (APIENTRYP PFNGLINDEXFPROC)(GLfloat c); +GLAPI PFNGLINDEXFPROC glad_glIndexf; +#define glIndexf glad_glIndexf +typedef void (APIENTRYP PFNGLINDEXFVPROC)(const GLfloat *c); +GLAPI PFNGLINDEXFVPROC glad_glIndexfv; +#define glIndexfv glad_glIndexfv +typedef void (APIENTRYP PFNGLINDEXIPROC)(GLint c); +GLAPI PFNGLINDEXIPROC glad_glIndexi; +#define glIndexi glad_glIndexi +typedef void (APIENTRYP PFNGLINDEXIVPROC)(const GLint *c); +GLAPI PFNGLINDEXIVPROC glad_glIndexiv; +#define glIndexiv glad_glIndexiv +typedef void (APIENTRYP PFNGLINDEXSPROC)(GLshort c); +GLAPI PFNGLINDEXSPROC glad_glIndexs; +#define glIndexs glad_glIndexs +typedef void (APIENTRYP PFNGLINDEXSVPROC)(const GLshort *c); +GLAPI PFNGLINDEXSVPROC glad_glIndexsv; +#define glIndexsv glad_glIndexsv +typedef void (APIENTRYP PFNGLNORMAL3BPROC)(GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI PFNGLNORMAL3BPROC glad_glNormal3b; +#define glNormal3b glad_glNormal3b +typedef void (APIENTRYP PFNGLNORMAL3BVPROC)(const GLbyte *v); +GLAPI PFNGLNORMAL3BVPROC glad_glNormal3bv; +#define glNormal3bv glad_glNormal3bv +typedef void (APIENTRYP PFNGLNORMAL3DPROC)(GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI PFNGLNORMAL3DPROC glad_glNormal3d; +#define glNormal3d glad_glNormal3d +typedef void (APIENTRYP PFNGLNORMAL3DVPROC)(const GLdouble *v); +GLAPI PFNGLNORMAL3DVPROC glad_glNormal3dv; +#define glNormal3dv glad_glNormal3dv +typedef void (APIENTRYP PFNGLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI PFNGLNORMAL3FPROC glad_glNormal3f; +#define glNormal3f glad_glNormal3f +typedef void (APIENTRYP PFNGLNORMAL3FVPROC)(const GLfloat *v); +GLAPI PFNGLNORMAL3FVPROC glad_glNormal3fv; +#define glNormal3fv glad_glNormal3fv +typedef void (APIENTRYP PFNGLNORMAL3IPROC)(GLint nx, GLint ny, GLint nz); +GLAPI PFNGLNORMAL3IPROC glad_glNormal3i; +#define glNormal3i glad_glNormal3i +typedef void (APIENTRYP PFNGLNORMAL3IVPROC)(const GLint *v); +GLAPI PFNGLNORMAL3IVPROC glad_glNormal3iv; +#define glNormal3iv glad_glNormal3iv +typedef void (APIENTRYP PFNGLNORMAL3SPROC)(GLshort nx, GLshort ny, GLshort nz); +GLAPI PFNGLNORMAL3SPROC glad_glNormal3s; +#define glNormal3s glad_glNormal3s +typedef void (APIENTRYP PFNGLNORMAL3SVPROC)(const GLshort *v); +GLAPI PFNGLNORMAL3SVPROC glad_glNormal3sv; +#define glNormal3sv glad_glNormal3sv +typedef void (APIENTRYP PFNGLRASTERPOS2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLRASTERPOS2DPROC glad_glRasterPos2d; +#define glRasterPos2d glad_glRasterPos2d +typedef void (APIENTRYP PFNGLRASTERPOS2DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv; +#define glRasterPos2dv glad_glRasterPos2dv +typedef void (APIENTRYP PFNGLRASTERPOS2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLRASTERPOS2FPROC glad_glRasterPos2f; +#define glRasterPos2f glad_glRasterPos2f +typedef void (APIENTRYP PFNGLRASTERPOS2FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv; +#define glRasterPos2fv glad_glRasterPos2fv +typedef void (APIENTRYP PFNGLRASTERPOS2IPROC)(GLint x, GLint y); +GLAPI PFNGLRASTERPOS2IPROC glad_glRasterPos2i; +#define glRasterPos2i glad_glRasterPos2i +typedef void (APIENTRYP PFNGLRASTERPOS2IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv; +#define glRasterPos2iv glad_glRasterPos2iv +typedef void (APIENTRYP PFNGLRASTERPOS2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLRASTERPOS2SPROC glad_glRasterPos2s; +#define glRasterPos2s glad_glRasterPos2s +typedef void (APIENTRYP PFNGLRASTERPOS2SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv; +#define glRasterPos2sv glad_glRasterPos2sv +typedef void (APIENTRYP PFNGLRASTERPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLRASTERPOS3DPROC glad_glRasterPos3d; +#define glRasterPos3d glad_glRasterPos3d +typedef void (APIENTRYP PFNGLRASTERPOS3DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv; +#define glRasterPos3dv glad_glRasterPos3dv +typedef void (APIENTRYP PFNGLRASTERPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLRASTERPOS3FPROC glad_glRasterPos3f; +#define glRasterPos3f glad_glRasterPos3f +typedef void (APIENTRYP PFNGLRASTERPOS3FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv; +#define glRasterPos3fv glad_glRasterPos3fv +typedef void (APIENTRYP PFNGLRASTERPOS3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLRASTERPOS3IPROC glad_glRasterPos3i; +#define glRasterPos3i glad_glRasterPos3i +typedef void (APIENTRYP PFNGLRASTERPOS3IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv; +#define glRasterPos3iv glad_glRasterPos3iv +typedef void (APIENTRYP PFNGLRASTERPOS3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLRASTERPOS3SPROC glad_glRasterPos3s; +#define glRasterPos3s glad_glRasterPos3s +typedef void (APIENTRYP PFNGLRASTERPOS3SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv; +#define glRasterPos3sv glad_glRasterPos3sv +typedef void (APIENTRYP PFNGLRASTERPOS4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLRASTERPOS4DPROC glad_glRasterPos4d; +#define glRasterPos4d glad_glRasterPos4d +typedef void (APIENTRYP PFNGLRASTERPOS4DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv; +#define glRasterPos4dv glad_glRasterPos4dv +typedef void (APIENTRYP PFNGLRASTERPOS4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLRASTERPOS4FPROC glad_glRasterPos4f; +#define glRasterPos4f glad_glRasterPos4f +typedef void (APIENTRYP PFNGLRASTERPOS4FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv; +#define glRasterPos4fv glad_glRasterPos4fv +typedef void (APIENTRYP PFNGLRASTERPOS4IPROC)(GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLRASTERPOS4IPROC glad_glRasterPos4i; +#define glRasterPos4i glad_glRasterPos4i +typedef void (APIENTRYP PFNGLRASTERPOS4IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv; +#define glRasterPos4iv glad_glRasterPos4iv +typedef void (APIENTRYP PFNGLRASTERPOS4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLRASTERPOS4SPROC glad_glRasterPos4s; +#define glRasterPos4s glad_glRasterPos4s +typedef void (APIENTRYP PFNGLRASTERPOS4SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv; +#define glRasterPos4sv glad_glRasterPos4sv +typedef void (APIENTRYP PFNGLRECTDPROC)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI PFNGLRECTDPROC glad_glRectd; +#define glRectd glad_glRectd +typedef void (APIENTRYP PFNGLRECTDVPROC)(const GLdouble *v1, const GLdouble *v2); +GLAPI PFNGLRECTDVPROC glad_glRectdv; +#define glRectdv glad_glRectdv +typedef void (APIENTRYP PFNGLRECTFPROC)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI PFNGLRECTFPROC glad_glRectf; +#define glRectf glad_glRectf +typedef void (APIENTRYP PFNGLRECTFVPROC)(const GLfloat *v1, const GLfloat *v2); +GLAPI PFNGLRECTFVPROC glad_glRectfv; +#define glRectfv glad_glRectfv +typedef void (APIENTRYP PFNGLRECTIPROC)(GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI PFNGLRECTIPROC glad_glRecti; +#define glRecti glad_glRecti +typedef void (APIENTRYP PFNGLRECTIVPROC)(const GLint *v1, const GLint *v2); +GLAPI PFNGLRECTIVPROC glad_glRectiv; +#define glRectiv glad_glRectiv +typedef void (APIENTRYP PFNGLRECTSPROC)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI PFNGLRECTSPROC glad_glRects; +#define glRects glad_glRects +typedef void (APIENTRYP PFNGLRECTSVPROC)(const GLshort *v1, const GLshort *v2); +GLAPI PFNGLRECTSVPROC glad_glRectsv; +#define glRectsv glad_glRectsv +typedef void (APIENTRYP PFNGLTEXCOORD1DPROC)(GLdouble s); +GLAPI PFNGLTEXCOORD1DPROC glad_glTexCoord1d; +#define glTexCoord1d glad_glTexCoord1d +typedef void (APIENTRYP PFNGLTEXCOORD1DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv; +#define glTexCoord1dv glad_glTexCoord1dv +typedef void (APIENTRYP PFNGLTEXCOORD1FPROC)(GLfloat s); +GLAPI PFNGLTEXCOORD1FPROC glad_glTexCoord1f; +#define glTexCoord1f glad_glTexCoord1f +typedef void (APIENTRYP PFNGLTEXCOORD1FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv; +#define glTexCoord1fv glad_glTexCoord1fv +typedef void (APIENTRYP PFNGLTEXCOORD1IPROC)(GLint s); +GLAPI PFNGLTEXCOORD1IPROC glad_glTexCoord1i; +#define glTexCoord1i glad_glTexCoord1i +typedef void (APIENTRYP PFNGLTEXCOORD1IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv; +#define glTexCoord1iv glad_glTexCoord1iv +typedef void (APIENTRYP PFNGLTEXCOORD1SPROC)(GLshort s); +GLAPI PFNGLTEXCOORD1SPROC glad_glTexCoord1s; +#define glTexCoord1s glad_glTexCoord1s +typedef void (APIENTRYP PFNGLTEXCOORD1SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv; +#define glTexCoord1sv glad_glTexCoord1sv +typedef void (APIENTRYP PFNGLTEXCOORD2DPROC)(GLdouble s, GLdouble t); +GLAPI PFNGLTEXCOORD2DPROC glad_glTexCoord2d; +#define glTexCoord2d glad_glTexCoord2d +typedef void (APIENTRYP PFNGLTEXCOORD2DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv; +#define glTexCoord2dv glad_glTexCoord2dv +typedef void (APIENTRYP PFNGLTEXCOORD2FPROC)(GLfloat s, GLfloat t); +GLAPI PFNGLTEXCOORD2FPROC glad_glTexCoord2f; +#define glTexCoord2f glad_glTexCoord2f +typedef void (APIENTRYP PFNGLTEXCOORD2FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv; +#define glTexCoord2fv glad_glTexCoord2fv +typedef void (APIENTRYP PFNGLTEXCOORD2IPROC)(GLint s, GLint t); +GLAPI PFNGLTEXCOORD2IPROC glad_glTexCoord2i; +#define glTexCoord2i glad_glTexCoord2i +typedef void (APIENTRYP PFNGLTEXCOORD2IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv; +#define glTexCoord2iv glad_glTexCoord2iv +typedef void (APIENTRYP PFNGLTEXCOORD2SPROC)(GLshort s, GLshort t); +GLAPI PFNGLTEXCOORD2SPROC glad_glTexCoord2s; +#define glTexCoord2s glad_glTexCoord2s +typedef void (APIENTRYP PFNGLTEXCOORD2SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv; +#define glTexCoord2sv glad_glTexCoord2sv +typedef void (APIENTRYP PFNGLTEXCOORD3DPROC)(GLdouble s, GLdouble t, GLdouble r); +GLAPI PFNGLTEXCOORD3DPROC glad_glTexCoord3d; +#define glTexCoord3d glad_glTexCoord3d +typedef void (APIENTRYP PFNGLTEXCOORD3DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv; +#define glTexCoord3dv glad_glTexCoord3dv +typedef void (APIENTRYP PFNGLTEXCOORD3FPROC)(GLfloat s, GLfloat t, GLfloat r); +GLAPI PFNGLTEXCOORD3FPROC glad_glTexCoord3f; +#define glTexCoord3f glad_glTexCoord3f +typedef void (APIENTRYP PFNGLTEXCOORD3FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv; +#define glTexCoord3fv glad_glTexCoord3fv +typedef void (APIENTRYP PFNGLTEXCOORD3IPROC)(GLint s, GLint t, GLint r); +GLAPI PFNGLTEXCOORD3IPROC glad_glTexCoord3i; +#define glTexCoord3i glad_glTexCoord3i +typedef void (APIENTRYP PFNGLTEXCOORD3IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv; +#define glTexCoord3iv glad_glTexCoord3iv +typedef void (APIENTRYP PFNGLTEXCOORD3SPROC)(GLshort s, GLshort t, GLshort r); +GLAPI PFNGLTEXCOORD3SPROC glad_glTexCoord3s; +#define glTexCoord3s glad_glTexCoord3s +typedef void (APIENTRYP PFNGLTEXCOORD3SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv; +#define glTexCoord3sv glad_glTexCoord3sv +typedef void (APIENTRYP PFNGLTEXCOORD4DPROC)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI PFNGLTEXCOORD4DPROC glad_glTexCoord4d; +#define glTexCoord4d glad_glTexCoord4d +typedef void (APIENTRYP PFNGLTEXCOORD4DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv; +#define glTexCoord4dv glad_glTexCoord4dv +typedef void (APIENTRYP PFNGLTEXCOORD4FPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI PFNGLTEXCOORD4FPROC glad_glTexCoord4f; +#define glTexCoord4f glad_glTexCoord4f +typedef void (APIENTRYP PFNGLTEXCOORD4FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv; +#define glTexCoord4fv glad_glTexCoord4fv +typedef void (APIENTRYP PFNGLTEXCOORD4IPROC)(GLint s, GLint t, GLint r, GLint q); +GLAPI PFNGLTEXCOORD4IPROC glad_glTexCoord4i; +#define glTexCoord4i glad_glTexCoord4i +typedef void (APIENTRYP PFNGLTEXCOORD4IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv; +#define glTexCoord4iv glad_glTexCoord4iv +typedef void (APIENTRYP PFNGLTEXCOORD4SPROC)(GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI PFNGLTEXCOORD4SPROC glad_glTexCoord4s; +#define glTexCoord4s glad_glTexCoord4s +typedef void (APIENTRYP PFNGLTEXCOORD4SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv; +#define glTexCoord4sv glad_glTexCoord4sv +typedef void (APIENTRYP PFNGLVERTEX2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLVERTEX2DPROC glad_glVertex2d; +#define glVertex2d glad_glVertex2d +typedef void (APIENTRYP PFNGLVERTEX2DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX2DVPROC glad_glVertex2dv; +#define glVertex2dv glad_glVertex2dv +typedef void (APIENTRYP PFNGLVERTEX2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLVERTEX2FPROC glad_glVertex2f; +#define glVertex2f glad_glVertex2f +typedef void (APIENTRYP PFNGLVERTEX2FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX2FVPROC glad_glVertex2fv; +#define glVertex2fv glad_glVertex2fv +typedef void (APIENTRYP PFNGLVERTEX2IPROC)(GLint x, GLint y); +GLAPI PFNGLVERTEX2IPROC glad_glVertex2i; +#define glVertex2i glad_glVertex2i +typedef void (APIENTRYP PFNGLVERTEX2IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX2IVPROC glad_glVertex2iv; +#define glVertex2iv glad_glVertex2iv +typedef void (APIENTRYP PFNGLVERTEX2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLVERTEX2SPROC glad_glVertex2s; +#define glVertex2s glad_glVertex2s +typedef void (APIENTRYP PFNGLVERTEX2SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX2SVPROC glad_glVertex2sv; +#define glVertex2sv glad_glVertex2sv +typedef void (APIENTRYP PFNGLVERTEX3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEX3DPROC glad_glVertex3d; +#define glVertex3d glad_glVertex3d +typedef void (APIENTRYP PFNGLVERTEX3DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX3DVPROC glad_glVertex3dv; +#define glVertex3dv glad_glVertex3dv +typedef void (APIENTRYP PFNGLVERTEX3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEX3FPROC glad_glVertex3f; +#define glVertex3f glad_glVertex3f +typedef void (APIENTRYP PFNGLVERTEX3FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX3FVPROC glad_glVertex3fv; +#define glVertex3fv glad_glVertex3fv +typedef void (APIENTRYP PFNGLVERTEX3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLVERTEX3IPROC glad_glVertex3i; +#define glVertex3i glad_glVertex3i +typedef void (APIENTRYP PFNGLVERTEX3IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX3IVPROC glad_glVertex3iv; +#define glVertex3iv glad_glVertex3iv +typedef void (APIENTRYP PFNGLVERTEX3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEX3SPROC glad_glVertex3s; +#define glVertex3s glad_glVertex3s +typedef void (APIENTRYP PFNGLVERTEX3SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX3SVPROC glad_glVertex3sv; +#define glVertex3sv glad_glVertex3sv +typedef void (APIENTRYP PFNGLVERTEX4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEX4DPROC glad_glVertex4d; +#define glVertex4d glad_glVertex4d +typedef void (APIENTRYP PFNGLVERTEX4DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX4DVPROC glad_glVertex4dv; +#define glVertex4dv glad_glVertex4dv +typedef void (APIENTRYP PFNGLVERTEX4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEX4FPROC glad_glVertex4f; +#define glVertex4f glad_glVertex4f +typedef void (APIENTRYP PFNGLVERTEX4FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX4FVPROC glad_glVertex4fv; +#define glVertex4fv glad_glVertex4fv +typedef void (APIENTRYP PFNGLVERTEX4IPROC)(GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLVERTEX4IPROC glad_glVertex4i; +#define glVertex4i glad_glVertex4i +typedef void (APIENTRYP PFNGLVERTEX4IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX4IVPROC glad_glVertex4iv; +#define glVertex4iv glad_glVertex4iv +typedef void (APIENTRYP PFNGLVERTEX4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEX4SPROC glad_glVertex4s; +#define glVertex4s glad_glVertex4s +typedef void (APIENTRYP PFNGLVERTEX4SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX4SVPROC glad_glVertex4sv; +#define glVertex4sv glad_glVertex4sv +typedef void (APIENTRYP PFNGLCLIPPLANEPROC)(GLenum plane, const GLdouble *equation); +GLAPI PFNGLCLIPPLANEPROC glad_glClipPlane; +#define glClipPlane glad_glClipPlane +typedef void (APIENTRYP PFNGLCOLORMATERIALPROC)(GLenum face, GLenum mode); +GLAPI PFNGLCOLORMATERIALPROC glad_glColorMaterial; +#define glColorMaterial glad_glColorMaterial +typedef void (APIENTRYP PFNGLFOGFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLFOGFPROC glad_glFogf; +#define glFogf glad_glFogf +typedef void (APIENTRYP PFNGLFOGFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLFOGFVPROC glad_glFogfv; +#define glFogfv glad_glFogfv +typedef void (APIENTRYP PFNGLFOGIPROC)(GLenum pname, GLint param); +GLAPI PFNGLFOGIPROC glad_glFogi; +#define glFogi glad_glFogi +typedef void (APIENTRYP PFNGLFOGIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLFOGIVPROC glad_glFogiv; +#define glFogiv glad_glFogiv +typedef void (APIENTRYP PFNGLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param); +GLAPI PFNGLLIGHTFPROC glad_glLightf; +#define glLightf glad_glLightf +typedef void (APIENTRYP PFNGLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat *params); +GLAPI PFNGLLIGHTFVPROC glad_glLightfv; +#define glLightfv glad_glLightfv +typedef void (APIENTRYP PFNGLLIGHTIPROC)(GLenum light, GLenum pname, GLint param); +GLAPI PFNGLLIGHTIPROC glad_glLighti; +#define glLighti glad_glLighti +typedef void (APIENTRYP PFNGLLIGHTIVPROC)(GLenum light, GLenum pname, const GLint *params); +GLAPI PFNGLLIGHTIVPROC glad_glLightiv; +#define glLightiv glad_glLightiv +typedef void (APIENTRYP PFNGLLIGHTMODELFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLLIGHTMODELFPROC glad_glLightModelf; +#define glLightModelf glad_glLightModelf +typedef void (APIENTRYP PFNGLLIGHTMODELFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLLIGHTMODELFVPROC glad_glLightModelfv; +#define glLightModelfv glad_glLightModelfv +typedef void (APIENTRYP PFNGLLIGHTMODELIPROC)(GLenum pname, GLint param); +GLAPI PFNGLLIGHTMODELIPROC glad_glLightModeli; +#define glLightModeli glad_glLightModeli +typedef void (APIENTRYP PFNGLLIGHTMODELIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLLIGHTMODELIVPROC glad_glLightModeliv; +#define glLightModeliv glad_glLightModeliv +typedef void (APIENTRYP PFNGLLINESTIPPLEPROC)(GLint factor, GLushort pattern); +GLAPI PFNGLLINESTIPPLEPROC glad_glLineStipple; +#define glLineStipple glad_glLineStipple +typedef void (APIENTRYP PFNGLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param); +GLAPI PFNGLMATERIALFPROC glad_glMaterialf; +#define glMaterialf glad_glMaterialf +typedef void (APIENTRYP PFNGLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat *params); +GLAPI PFNGLMATERIALFVPROC glad_glMaterialfv; +#define glMaterialfv glad_glMaterialfv +typedef void (APIENTRYP PFNGLMATERIALIPROC)(GLenum face, GLenum pname, GLint param); +GLAPI PFNGLMATERIALIPROC glad_glMateriali; +#define glMateriali glad_glMateriali +typedef void (APIENTRYP PFNGLMATERIALIVPROC)(GLenum face, GLenum pname, const GLint *params); +GLAPI PFNGLMATERIALIVPROC glad_glMaterialiv; +#define glMaterialiv glad_glMaterialiv +typedef void (APIENTRYP PFNGLPOLYGONSTIPPLEPROC)(const GLubyte *mask); +GLAPI PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple; +#define glPolygonStipple glad_glPolygonStipple +typedef void (APIENTRYP PFNGLSHADEMODELPROC)(GLenum mode); +GLAPI PFNGLSHADEMODELPROC glad_glShadeModel; +#define glShadeModel glad_glShadeModel +typedef void (APIENTRYP PFNGLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXENVFPROC glad_glTexEnvf; +#define glTexEnvf glad_glTexEnvf +typedef void (APIENTRYP PFNGLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXENVFVPROC glad_glTexEnvfv; +#define glTexEnvfv glad_glTexEnvfv +typedef void (APIENTRYP PFNGLTEXENVIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXENVIPROC glad_glTexEnvi; +#define glTexEnvi glad_glTexEnvi +typedef void (APIENTRYP PFNGLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXENVIVPROC glad_glTexEnviv; +#define glTexEnviv glad_glTexEnviv +typedef void (APIENTRYP PFNGLTEXGENDPROC)(GLenum coord, GLenum pname, GLdouble param); +GLAPI PFNGLTEXGENDPROC glad_glTexGend; +#define glTexGend glad_glTexGend +typedef void (APIENTRYP PFNGLTEXGENDVPROC)(GLenum coord, GLenum pname, const GLdouble *params); +GLAPI PFNGLTEXGENDVPROC glad_glTexGendv; +#define glTexGendv glad_glTexGendv +typedef void (APIENTRYP PFNGLTEXGENFPROC)(GLenum coord, GLenum pname, GLfloat param); +GLAPI PFNGLTEXGENFPROC glad_glTexGenf; +#define glTexGenf glad_glTexGenf +typedef void (APIENTRYP PFNGLTEXGENFVPROC)(GLenum coord, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXGENFVPROC glad_glTexGenfv; +#define glTexGenfv glad_glTexGenfv +typedef void (APIENTRYP PFNGLTEXGENIPROC)(GLenum coord, GLenum pname, GLint param); +GLAPI PFNGLTEXGENIPROC glad_glTexGeni; +#define glTexGeni glad_glTexGeni +typedef void (APIENTRYP PFNGLTEXGENIVPROC)(GLenum coord, GLenum pname, const GLint *params); +GLAPI PFNGLTEXGENIVPROC glad_glTexGeniv; +#define glTexGeniv glad_glTexGeniv +typedef void (APIENTRYP PFNGLFEEDBACKBUFFERPROC)(GLsizei size, GLenum type, GLfloat *buffer); +GLAPI PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer; +#define glFeedbackBuffer glad_glFeedbackBuffer +typedef void (APIENTRYP PFNGLSELECTBUFFERPROC)(GLsizei size, GLuint *buffer); +GLAPI PFNGLSELECTBUFFERPROC glad_glSelectBuffer; +#define glSelectBuffer glad_glSelectBuffer +typedef GLint (APIENTRYP PFNGLRENDERMODEPROC)(GLenum mode); +GLAPI PFNGLRENDERMODEPROC glad_glRenderMode; +#define glRenderMode glad_glRenderMode +typedef void (APIENTRYP PFNGLINITNAMESPROC)(void); +GLAPI PFNGLINITNAMESPROC glad_glInitNames; +#define glInitNames glad_glInitNames +typedef void (APIENTRYP PFNGLLOADNAMEPROC)(GLuint name); +GLAPI PFNGLLOADNAMEPROC glad_glLoadName; +#define glLoadName glad_glLoadName +typedef void (APIENTRYP PFNGLPASSTHROUGHPROC)(GLfloat token); +GLAPI PFNGLPASSTHROUGHPROC glad_glPassThrough; +#define glPassThrough glad_glPassThrough +typedef void (APIENTRYP PFNGLPOPNAMEPROC)(void); +GLAPI PFNGLPOPNAMEPROC glad_glPopName; +#define glPopName glad_glPopName +typedef void (APIENTRYP PFNGLPUSHNAMEPROC)(GLuint name); +GLAPI PFNGLPUSHNAMEPROC glad_glPushName; +#define glPushName glad_glPushName +typedef void (APIENTRYP PFNGLCLEARACCUMPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCLEARACCUMPROC glad_glClearAccum; +#define glClearAccum glad_glClearAccum +typedef void (APIENTRYP PFNGLCLEARINDEXPROC)(GLfloat c); +GLAPI PFNGLCLEARINDEXPROC glad_glClearIndex; +#define glClearIndex glad_glClearIndex +typedef void (APIENTRYP PFNGLINDEXMASKPROC)(GLuint mask); +GLAPI PFNGLINDEXMASKPROC glad_glIndexMask; +#define glIndexMask glad_glIndexMask +typedef void (APIENTRYP PFNGLACCUMPROC)(GLenum op, GLfloat value); +GLAPI PFNGLACCUMPROC glad_glAccum; +#define glAccum glad_glAccum +typedef void (APIENTRYP PFNGLPOPATTRIBPROC)(void); +GLAPI PFNGLPOPATTRIBPROC glad_glPopAttrib; +#define glPopAttrib glad_glPopAttrib +typedef void (APIENTRYP PFNGLPUSHATTRIBPROC)(GLbitfield mask); +GLAPI PFNGLPUSHATTRIBPROC glad_glPushAttrib; +#define glPushAttrib glad_glPushAttrib +typedef void (APIENTRYP PFNGLMAP1DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI PFNGLMAP1DPROC glad_glMap1d; +#define glMap1d glad_glMap1d +typedef void (APIENTRYP PFNGLMAP1FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI PFNGLMAP1FPROC glad_glMap1f; +#define glMap1f glad_glMap1f +typedef void (APIENTRYP PFNGLMAP2DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI PFNGLMAP2DPROC glad_glMap2d; +#define glMap2d glad_glMap2d +typedef void (APIENTRYP PFNGLMAP2FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI PFNGLMAP2FPROC glad_glMap2f; +#define glMap2f glad_glMap2f +typedef void (APIENTRYP PFNGLMAPGRID1DPROC)(GLint un, GLdouble u1, GLdouble u2); +GLAPI PFNGLMAPGRID1DPROC glad_glMapGrid1d; +#define glMapGrid1d glad_glMapGrid1d +typedef void (APIENTRYP PFNGLMAPGRID1FPROC)(GLint un, GLfloat u1, GLfloat u2); +GLAPI PFNGLMAPGRID1FPROC glad_glMapGrid1f; +#define glMapGrid1f glad_glMapGrid1f +typedef void (APIENTRYP PFNGLMAPGRID2DPROC)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI PFNGLMAPGRID2DPROC glad_glMapGrid2d; +#define glMapGrid2d glad_glMapGrid2d +typedef void (APIENTRYP PFNGLMAPGRID2FPROC)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI PFNGLMAPGRID2FPROC glad_glMapGrid2f; +#define glMapGrid2f glad_glMapGrid2f +typedef void (APIENTRYP PFNGLEVALCOORD1DPROC)(GLdouble u); +GLAPI PFNGLEVALCOORD1DPROC glad_glEvalCoord1d; +#define glEvalCoord1d glad_glEvalCoord1d +typedef void (APIENTRYP PFNGLEVALCOORD1DVPROC)(const GLdouble *u); +GLAPI PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv; +#define glEvalCoord1dv glad_glEvalCoord1dv +typedef void (APIENTRYP PFNGLEVALCOORD1FPROC)(GLfloat u); +GLAPI PFNGLEVALCOORD1FPROC glad_glEvalCoord1f; +#define glEvalCoord1f glad_glEvalCoord1f +typedef void (APIENTRYP PFNGLEVALCOORD1FVPROC)(const GLfloat *u); +GLAPI PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv; +#define glEvalCoord1fv glad_glEvalCoord1fv +typedef void (APIENTRYP PFNGLEVALCOORD2DPROC)(GLdouble u, GLdouble v); +GLAPI PFNGLEVALCOORD2DPROC glad_glEvalCoord2d; +#define glEvalCoord2d glad_glEvalCoord2d +typedef void (APIENTRYP PFNGLEVALCOORD2DVPROC)(const GLdouble *u); +GLAPI PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv; +#define glEvalCoord2dv glad_glEvalCoord2dv +typedef void (APIENTRYP PFNGLEVALCOORD2FPROC)(GLfloat u, GLfloat v); +GLAPI PFNGLEVALCOORD2FPROC glad_glEvalCoord2f; +#define glEvalCoord2f glad_glEvalCoord2f +typedef void (APIENTRYP PFNGLEVALCOORD2FVPROC)(const GLfloat *u); +GLAPI PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv; +#define glEvalCoord2fv glad_glEvalCoord2fv +typedef void (APIENTRYP PFNGLEVALMESH1PROC)(GLenum mode, GLint i1, GLint i2); +GLAPI PFNGLEVALMESH1PROC glad_glEvalMesh1; +#define glEvalMesh1 glad_glEvalMesh1 +typedef void (APIENTRYP PFNGLEVALPOINT1PROC)(GLint i); +GLAPI PFNGLEVALPOINT1PROC glad_glEvalPoint1; +#define glEvalPoint1 glad_glEvalPoint1 +typedef void (APIENTRYP PFNGLEVALMESH2PROC)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI PFNGLEVALMESH2PROC glad_glEvalMesh2; +#define glEvalMesh2 glad_glEvalMesh2 +typedef void (APIENTRYP PFNGLEVALPOINT2PROC)(GLint i, GLint j); +GLAPI PFNGLEVALPOINT2PROC glad_glEvalPoint2; +#define glEvalPoint2 glad_glEvalPoint2 +typedef void (APIENTRYP PFNGLALPHAFUNCPROC)(GLenum func, GLfloat ref); +GLAPI PFNGLALPHAFUNCPROC glad_glAlphaFunc; +#define glAlphaFunc glad_glAlphaFunc +typedef void (APIENTRYP PFNGLPIXELZOOMPROC)(GLfloat xfactor, GLfloat yfactor); +GLAPI PFNGLPIXELZOOMPROC glad_glPixelZoom; +#define glPixelZoom glad_glPixelZoom +typedef void (APIENTRYP PFNGLPIXELTRANSFERFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf; +#define glPixelTransferf glad_glPixelTransferf +typedef void (APIENTRYP PFNGLPIXELTRANSFERIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi; +#define glPixelTransferi glad_glPixelTransferi +typedef void (APIENTRYP PFNGLPIXELMAPFVPROC)(GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI PFNGLPIXELMAPFVPROC glad_glPixelMapfv; +#define glPixelMapfv glad_glPixelMapfv +typedef void (APIENTRYP PFNGLPIXELMAPUIVPROC)(GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv; +#define glPixelMapuiv glad_glPixelMapuiv +typedef void (APIENTRYP PFNGLPIXELMAPUSVPROC)(GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI PFNGLPIXELMAPUSVPROC glad_glPixelMapusv; +#define glPixelMapusv glad_glPixelMapusv +typedef void (APIENTRYP PFNGLCOPYPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI PFNGLCOPYPIXELSPROC glad_glCopyPixels; +#define glCopyPixels glad_glCopyPixels +typedef void (APIENTRYP PFNGLDRAWPIXELSPROC)(GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLDRAWPIXELSPROC glad_glDrawPixels; +#define glDrawPixels glad_glDrawPixels +typedef void (APIENTRYP PFNGLGETCLIPPLANEPROC)(GLenum plane, GLdouble *equation); +GLAPI PFNGLGETCLIPPLANEPROC glad_glGetClipPlane; +#define glGetClipPlane glad_glGetClipPlane +typedef void (APIENTRYP PFNGLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat *params); +GLAPI PFNGLGETLIGHTFVPROC glad_glGetLightfv; +#define glGetLightfv glad_glGetLightfv +typedef void (APIENTRYP PFNGLGETLIGHTIVPROC)(GLenum light, GLenum pname, GLint *params); +GLAPI PFNGLGETLIGHTIVPROC glad_glGetLightiv; +#define glGetLightiv glad_glGetLightiv +typedef void (APIENTRYP PFNGLGETMAPDVPROC)(GLenum target, GLenum query, GLdouble *v); +GLAPI PFNGLGETMAPDVPROC glad_glGetMapdv; +#define glGetMapdv glad_glGetMapdv +typedef void (APIENTRYP PFNGLGETMAPFVPROC)(GLenum target, GLenum query, GLfloat *v); +GLAPI PFNGLGETMAPFVPROC glad_glGetMapfv; +#define glGetMapfv glad_glGetMapfv +typedef void (APIENTRYP PFNGLGETMAPIVPROC)(GLenum target, GLenum query, GLint *v); +GLAPI PFNGLGETMAPIVPROC glad_glGetMapiv; +#define glGetMapiv glad_glGetMapiv +typedef void (APIENTRYP PFNGLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat *params); +GLAPI PFNGLGETMATERIALFVPROC glad_glGetMaterialfv; +#define glGetMaterialfv glad_glGetMaterialfv +typedef void (APIENTRYP PFNGLGETMATERIALIVPROC)(GLenum face, GLenum pname, GLint *params); +GLAPI PFNGLGETMATERIALIVPROC glad_glGetMaterialiv; +#define glGetMaterialiv glad_glGetMaterialiv +typedef void (APIENTRYP PFNGLGETPIXELMAPFVPROC)(GLenum map, GLfloat *values); +GLAPI PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv; +#define glGetPixelMapfv glad_glGetPixelMapfv +typedef void (APIENTRYP PFNGLGETPIXELMAPUIVPROC)(GLenum map, GLuint *values); +GLAPI PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv; +#define glGetPixelMapuiv glad_glGetPixelMapuiv +typedef void (APIENTRYP PFNGLGETPIXELMAPUSVPROC)(GLenum map, GLushort *values); +GLAPI PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv; +#define glGetPixelMapusv glad_glGetPixelMapusv +typedef void (APIENTRYP PFNGLGETPOLYGONSTIPPLEPROC)(GLubyte *mask); +GLAPI PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple; +#define glGetPolygonStipple glad_glGetPolygonStipple +typedef void (APIENTRYP PFNGLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv; +#define glGetTexEnvfv glad_glGetTexEnvfv +typedef void (APIENTRYP PFNGLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXENVIVPROC glad_glGetTexEnviv; +#define glGetTexEnviv glad_glGetTexEnviv +typedef void (APIENTRYP PFNGLGETTEXGENDVPROC)(GLenum coord, GLenum pname, GLdouble *params); +GLAPI PFNGLGETTEXGENDVPROC glad_glGetTexGendv; +#define glGetTexGendv glad_glGetTexGendv +typedef void (APIENTRYP PFNGLGETTEXGENFVPROC)(GLenum coord, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXGENFVPROC glad_glGetTexGenfv; +#define glGetTexGenfv glad_glGetTexGenfv +typedef void (APIENTRYP PFNGLGETTEXGENIVPROC)(GLenum coord, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXGENIVPROC glad_glGetTexGeniv; +#define glGetTexGeniv glad_glGetTexGeniv +typedef GLboolean (APIENTRYP PFNGLISLISTPROC)(GLuint list); +GLAPI PFNGLISLISTPROC glad_glIsList; +#define glIsList glad_glIsList +typedef void (APIENTRYP PFNGLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI PFNGLFRUSTUMPROC glad_glFrustum; +#define glFrustum glad_glFrustum +typedef void (APIENTRYP PFNGLLOADIDENTITYPROC)(void); +GLAPI PFNGLLOADIDENTITYPROC glad_glLoadIdentity; +#define glLoadIdentity glad_glLoadIdentity +typedef void (APIENTRYP PFNGLLOADMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLLOADMATRIXFPROC glad_glLoadMatrixf; +#define glLoadMatrixf glad_glLoadMatrixf +typedef void (APIENTRYP PFNGLLOADMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLLOADMATRIXDPROC glad_glLoadMatrixd; +#define glLoadMatrixd glad_glLoadMatrixd +typedef void (APIENTRYP PFNGLMATRIXMODEPROC)(GLenum mode); +GLAPI PFNGLMATRIXMODEPROC glad_glMatrixMode; +#define glMatrixMode glad_glMatrixMode +typedef void (APIENTRYP PFNGLMULTMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLMULTMATRIXFPROC glad_glMultMatrixf; +#define glMultMatrixf glad_glMultMatrixf +typedef void (APIENTRYP PFNGLMULTMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLMULTMATRIXDPROC glad_glMultMatrixd; +#define glMultMatrixd glad_glMultMatrixd +typedef void (APIENTRYP PFNGLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI PFNGLORTHOPROC glad_glOrtho; +#define glOrtho glad_glOrtho +typedef void (APIENTRYP PFNGLPOPMATRIXPROC)(void); +GLAPI PFNGLPOPMATRIXPROC glad_glPopMatrix; +#define glPopMatrix glad_glPopMatrix +typedef void (APIENTRYP PFNGLPUSHMATRIXPROC)(void); +GLAPI PFNGLPUSHMATRIXPROC glad_glPushMatrix; +#define glPushMatrix glad_glPushMatrix +typedef void (APIENTRYP PFNGLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLROTATEDPROC glad_glRotated; +#define glRotated glad_glRotated +typedef void (APIENTRYP PFNGLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLROTATEFPROC glad_glRotatef; +#define glRotatef glad_glRotatef +typedef void (APIENTRYP PFNGLSCALEDPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLSCALEDPROC glad_glScaled; +#define glScaled glad_glScaled +typedef void (APIENTRYP PFNGLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLSCALEFPROC glad_glScalef; +#define glScalef glad_glScalef +typedef void (APIENTRYP PFNGLTRANSLATEDPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLTRANSLATEDPROC glad_glTranslated; +#define glTranslated glad_glTranslated +typedef void (APIENTRYP PFNGLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTRANSLATEFPROC glad_glTranslatef; +#define glTranslatef glad_glTranslatef +#endif +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 +GLAPI int GLAD_GL_VERSION_1_1; +typedef void (APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); +GLAPI PFNGLDRAWARRAYSPROC glad_glDrawArrays; +#define glDrawArrays glad_glDrawArrays +typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices); +GLAPI PFNGLDRAWELEMENTSPROC glad_glDrawElements; +#define glDrawElements glad_glDrawElements +typedef void (APIENTRYP PFNGLGETPOINTERVPROC)(GLenum pname, void **params); +GLAPI PFNGLGETPOINTERVPROC glad_glGetPointerv; +#define glGetPointerv glad_glGetPointerv +typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); +GLAPI PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +#define glPolygonOffset glad_glPolygonOffset +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +#define glCopyTexImage1D glad_glCopyTexImage1D +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +#define glCopyTexImage2D glad_glCopyTexImage2D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +#define glCopyTexSubImage1D glad_glCopyTexSubImage1D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +#define glCopyTexSubImage2D glad_glCopyTexSubImage2D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +#define glTexSubImage1D glad_glTexSubImage1D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +#define glTexSubImage2D glad_glTexSubImage2D +typedef void (APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); +GLAPI PFNGLBINDTEXTUREPROC glad_glBindTexture; +#define glBindTexture glad_glBindTexture +typedef void (APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint *textures); +GLAPI PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +#define glDeleteTextures glad_glDeleteTextures +typedef void (APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei n, GLuint *textures); +GLAPI PFNGLGENTEXTURESPROC glad_glGenTextures; +#define glGenTextures glad_glGenTextures +typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC)(GLuint texture); +GLAPI PFNGLISTEXTUREPROC glad_glIsTexture; +#define glIsTexture glad_glIsTexture +typedef void (APIENTRYP PFNGLARRAYELEMENTPROC)(GLint i); +GLAPI PFNGLARRAYELEMENTPROC glad_glArrayElement; +#define glArrayElement glad_glArrayElement +typedef void (APIENTRYP PFNGLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLCOLORPOINTERPROC glad_glColorPointer; +#define glColorPointer glad_glColorPointer +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEPROC)(GLenum array); +GLAPI PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState; +#define glDisableClientState glad_glDisableClientState +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERPROC)(GLsizei stride, const void *pointer); +GLAPI PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer; +#define glEdgeFlagPointer glad_glEdgeFlagPointer +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEPROC)(GLenum array); +GLAPI PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState; +#define glEnableClientState glad_glEnableClientState +typedef void (APIENTRYP PFNGLINDEXPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLINDEXPOINTERPROC glad_glIndexPointer; +#define glIndexPointer glad_glIndexPointer +typedef void (APIENTRYP PFNGLINTERLEAVEDARRAYSPROC)(GLenum format, GLsizei stride, const void *pointer); +GLAPI PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays; +#define glInterleavedArrays glad_glInterleavedArrays +typedef void (APIENTRYP PFNGLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLNORMALPOINTERPROC glad_glNormalPointer; +#define glNormalPointer glad_glNormalPointer +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer; +#define glTexCoordPointer glad_glTexCoordPointer +typedef void (APIENTRYP PFNGLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLVERTEXPOINTERPROC glad_glVertexPointer; +#define glVertexPointer glad_glVertexPointer +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTPROC)(GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident; +#define glAreTexturesResident glad_glAreTexturesResident +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESPROC)(GLsizei n, const GLuint *textures, const GLfloat *priorities); +GLAPI PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures; +#define glPrioritizeTextures glad_glPrioritizeTextures +typedef void (APIENTRYP PFNGLINDEXUBPROC)(GLubyte c); +GLAPI PFNGLINDEXUBPROC glad_glIndexub; +#define glIndexub glad_glIndexub +typedef void (APIENTRYP PFNGLINDEXUBVPROC)(const GLubyte *c); +GLAPI PFNGLINDEXUBVPROC glad_glIndexubv; +#define glIndexubv glad_glIndexubv +typedef void (APIENTRYP PFNGLPOPCLIENTATTRIBPROC)(void); +GLAPI PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib; +#define glPopClientAttrib glad_glPopClientAttrib +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBPROC)(GLbitfield mask); +GLAPI PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib; +#define glPushClientAttrib glad_glPushClientAttrib +#endif +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +GLAPI int GLAD_GL_VERSION_1_2; +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +GLAPI PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +#define glDrawRangeElements glad_glDrawRangeElements +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +#define glTexImage3D glad_glTexImage3D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +#define glTexSubImage3D glad_glTexSubImage3D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +#define glCopyTexSubImage3D glad_glCopyTexSubImage3D +#endif +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +GLAPI int GLAD_GL_VERSION_1_3; +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +#define glActiveTexture glad_glActiveTexture +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +#define glSampleCoverage glad_glSampleCoverage +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +#define glCompressedTexImage3D glad_glCompressedTexImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +#define glCompressedTexImage2D glad_glCompressedTexImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +#define glCompressedTexImage1D glad_glCompressedTexImage1D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void *img); +GLAPI PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +#define glGetCompressedTexImage glad_glGetCompressedTexImage +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture; +#define glClientActiveTexture glad_glClientActiveTexture +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC)(GLenum target, GLdouble s); +GLAPI PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d; +#define glMultiTexCoord1d glad_glMultiTexCoord1d +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv; +#define glMultiTexCoord1dv glad_glMultiTexCoord1dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC)(GLenum target, GLfloat s); +GLAPI PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f; +#define glMultiTexCoord1f glad_glMultiTexCoord1f +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv; +#define glMultiTexCoord1fv glad_glMultiTexCoord1fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC)(GLenum target, GLint s); +GLAPI PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i; +#define glMultiTexCoord1i glad_glMultiTexCoord1i +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv; +#define glMultiTexCoord1iv glad_glMultiTexCoord1iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC)(GLenum target, GLshort s); +GLAPI PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s; +#define glMultiTexCoord1s glad_glMultiTexCoord1s +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv; +#define glMultiTexCoord1sv glad_glMultiTexCoord1sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC)(GLenum target, GLdouble s, GLdouble t); +GLAPI PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d; +#define glMultiTexCoord2d glad_glMultiTexCoord2d +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv; +#define glMultiTexCoord2dv glad_glMultiTexCoord2dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC)(GLenum target, GLfloat s, GLfloat t); +GLAPI PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f; +#define glMultiTexCoord2f glad_glMultiTexCoord2f +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv; +#define glMultiTexCoord2fv glad_glMultiTexCoord2fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC)(GLenum target, GLint s, GLint t); +GLAPI PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i; +#define glMultiTexCoord2i glad_glMultiTexCoord2i +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv; +#define glMultiTexCoord2iv glad_glMultiTexCoord2iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC)(GLenum target, GLshort s, GLshort t); +GLAPI PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s; +#define glMultiTexCoord2s glad_glMultiTexCoord2s +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv; +#define glMultiTexCoord2sv glad_glMultiTexCoord2sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d; +#define glMultiTexCoord3d glad_glMultiTexCoord3d +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv; +#define glMultiTexCoord3dv glad_glMultiTexCoord3dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f; +#define glMultiTexCoord3f glad_glMultiTexCoord3f +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv; +#define glMultiTexCoord3fv glad_glMultiTexCoord3fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC)(GLenum target, GLint s, GLint t, GLint r); +GLAPI PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i; +#define glMultiTexCoord3i glad_glMultiTexCoord3i +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv; +#define glMultiTexCoord3iv glad_glMultiTexCoord3iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC)(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s; +#define glMultiTexCoord3s glad_glMultiTexCoord3s +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv; +#define glMultiTexCoord3sv glad_glMultiTexCoord3sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d; +#define glMultiTexCoord4d glad_glMultiTexCoord4d +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv; +#define glMultiTexCoord4dv glad_glMultiTexCoord4dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f; +#define glMultiTexCoord4f glad_glMultiTexCoord4f +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv; +#define glMultiTexCoord4fv glad_glMultiTexCoord4fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i; +#define glMultiTexCoord4i glad_glMultiTexCoord4i +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv; +#define glMultiTexCoord4iv glad_glMultiTexCoord4iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s; +#define glMultiTexCoord4s glad_glMultiTexCoord4s +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv; +#define glMultiTexCoord4sv glad_glMultiTexCoord4sv +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf; +#define glLoadTransposeMatrixf glad_glLoadTransposeMatrixf +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd; +#define glLoadTransposeMatrixd glad_glLoadTransposeMatrixd +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf; +#define glMultTransposeMatrixf glad_glMultTransposeMatrixf +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd; +#define glMultTransposeMatrixd glad_glMultTransposeMatrixd +#endif +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +GLAPI int GLAD_GL_VERSION_1_4; +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +#define glBlendFuncSeparate glad_glBlendFuncSeparate +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +GLAPI PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +#define glMultiDrawArrays glad_glMultiDrawArrays +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +GLAPI PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +#define glMultiDrawElements glad_glMultiDrawElements +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +#define glPointParameterf glad_glPointParameterf +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +#define glPointParameterfv glad_glPointParameterfv +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +#define glPointParameteri glad_glPointParameteri +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +#define glPointParameteriv glad_glPointParameteriv +typedef void (APIENTRYP PFNGLFOGCOORDFPROC)(GLfloat coord); +GLAPI PFNGLFOGCOORDFPROC glad_glFogCoordf; +#define glFogCoordf glad_glFogCoordf +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC)(const GLfloat *coord); +GLAPI PFNGLFOGCOORDFVPROC glad_glFogCoordfv; +#define glFogCoordfv glad_glFogCoordfv +typedef void (APIENTRYP PFNGLFOGCOORDDPROC)(GLdouble coord); +GLAPI PFNGLFOGCOORDDPROC glad_glFogCoordd; +#define glFogCoordd glad_glFogCoordd +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC)(const GLdouble *coord); +GLAPI PFNGLFOGCOORDDVPROC glad_glFogCoorddv; +#define glFogCoorddv glad_glFogCoorddv +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer; +#define glFogCoordPointer glad_glFogCoordPointer +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); +GLAPI PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b; +#define glSecondaryColor3b glad_glSecondaryColor3b +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC)(const GLbyte *v); +GLAPI PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv; +#define glSecondaryColor3bv glad_glSecondaryColor3bv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); +GLAPI PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d; +#define glSecondaryColor3d glad_glSecondaryColor3d +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC)(const GLdouble *v); +GLAPI PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv; +#define glSecondaryColor3dv glad_glSecondaryColor3dv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); +GLAPI PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f; +#define glSecondaryColor3f glad_glSecondaryColor3f +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC)(const GLfloat *v); +GLAPI PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv; +#define glSecondaryColor3fv glad_glSecondaryColor3fv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue); +GLAPI PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i; +#define glSecondaryColor3i glad_glSecondaryColor3i +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC)(const GLint *v); +GLAPI PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv; +#define glSecondaryColor3iv glad_glSecondaryColor3iv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); +GLAPI PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s; +#define glSecondaryColor3s glad_glSecondaryColor3s +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC)(const GLshort *v); +GLAPI PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv; +#define glSecondaryColor3sv glad_glSecondaryColor3sv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); +GLAPI PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub; +#define glSecondaryColor3ub glad_glSecondaryColor3ub +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC)(const GLubyte *v); +GLAPI PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv; +#define glSecondaryColor3ubv glad_glSecondaryColor3ubv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); +GLAPI PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui; +#define glSecondaryColor3ui glad_glSecondaryColor3ui +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC)(const GLuint *v); +GLAPI PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv; +#define glSecondaryColor3uiv glad_glSecondaryColor3uiv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); +GLAPI PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us; +#define glSecondaryColor3us glad_glSecondaryColor3us +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC)(const GLushort *v); +GLAPI PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv; +#define glSecondaryColor3usv glad_glSecondaryColor3usv +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer; +#define glSecondaryColorPointer glad_glSecondaryColorPointer +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLWINDOWPOS2DPROC glad_glWindowPos2d; +#define glWindowPos2d glad_glWindowPos2d +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC)(const GLdouble *v); +GLAPI PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv; +#define glWindowPos2dv glad_glWindowPos2dv +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLWINDOWPOS2FPROC glad_glWindowPos2f; +#define glWindowPos2f glad_glWindowPos2f +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC)(const GLfloat *v); +GLAPI PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv; +#define glWindowPos2fv glad_glWindowPos2fv +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC)(GLint x, GLint y); +GLAPI PFNGLWINDOWPOS2IPROC glad_glWindowPos2i; +#define glWindowPos2i glad_glWindowPos2i +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC)(const GLint *v); +GLAPI PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv; +#define glWindowPos2iv glad_glWindowPos2iv +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLWINDOWPOS2SPROC glad_glWindowPos2s; +#define glWindowPos2s glad_glWindowPos2s +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC)(const GLshort *v); +GLAPI PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv; +#define glWindowPos2sv glad_glWindowPos2sv +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLWINDOWPOS3DPROC glad_glWindowPos3d; +#define glWindowPos3d glad_glWindowPos3d +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC)(const GLdouble *v); +GLAPI PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv; +#define glWindowPos3dv glad_glWindowPos3dv +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLWINDOWPOS3FPROC glad_glWindowPos3f; +#define glWindowPos3f glad_glWindowPos3f +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC)(const GLfloat *v); +GLAPI PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv; +#define glWindowPos3fv glad_glWindowPos3fv +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLWINDOWPOS3IPROC glad_glWindowPos3i; +#define glWindowPos3i glad_glWindowPos3i +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC)(const GLint *v); +GLAPI PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv; +#define glWindowPos3iv glad_glWindowPos3iv +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLWINDOWPOS3SPROC glad_glWindowPos3s; +#define glWindowPos3s glad_glWindowPos3s +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC)(const GLshort *v); +GLAPI PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv; +#define glWindowPos3sv glad_glWindowPos3sv +typedef void (APIENTRYP PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLBLENDCOLORPROC glad_glBlendColor; +#define glBlendColor glad_glBlendColor +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC)(GLenum mode); +GLAPI PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +#define glBlendEquation glad_glBlendEquation +#endif +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +GLAPI int GLAD_GL_VERSION_1_5; +typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint *ids); +GLAPI PFNGLGENQUERIESPROC glad_glGenQueries; +#define glGenQueries glad_glGenQueries +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint *ids); +GLAPI PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +#define glDeleteQueries glad_glDeleteQueries +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint id); +GLAPI PFNGLISQUERYPROC glad_glIsQuery; +#define glIsQuery glad_glIsQuery +typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); +GLAPI PFNGLBEGINQUERYPROC glad_glBeginQuery; +#define glBeginQuery glad_glBeginQuery +typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum target); +GLAPI PFNGLENDQUERYPROC glad_glEndQuery; +#define glEndQuery glad_glEndQuery +typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETQUERYIVPROC glad_glGetQueryiv; +#define glGetQueryiv glad_glGetQueryiv +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint *params); +GLAPI PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +#define glGetQueryObjectiv glad_glGetQueryObjectiv +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint *params); +GLAPI PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +#define glGetQueryObjectuiv glad_glGetQueryObjectuiv +typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); +GLAPI PFNGLBINDBUFFERPROC glad_glBindBuffer; +#define glBindBuffer glad_glBindBuffer +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint *buffers); +GLAPI PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +#define glDeleteBuffers glad_glDeleteBuffers +typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint *buffers); +GLAPI PFNGLGENBUFFERSPROC glad_glGenBuffers; +#define glGenBuffers glad_glGenBuffers +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); +GLAPI PFNGLISBUFFERPROC glad_glIsBuffer; +#define glIsBuffer glad_glIsBuffer +typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GLAPI PFNGLBUFFERDATAPROC glad_glBufferData; +#define glBufferData glad_glBufferData +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +#define glBufferSubData glad_glBufferSubData +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void *data); +GLAPI PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +#define glGetBufferSubData glad_glGetBufferSubData +typedef void * (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); +GLAPI PFNGLMAPBUFFERPROC glad_glMapBuffer; +#define glMapBuffer glad_glMapBuffer +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum target); +GLAPI PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +#define glUnmapBuffer glad_glUnmapBuffer +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +#define glGetBufferParameteriv glad_glGetBufferParameteriv +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void **params); +GLAPI PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +#define glGetBufferPointerv glad_glGetBufferPointerv +#endif +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +GLAPI int GLAD_GL_VERSION_2_0; +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +#define glBlendEquationSeparate glad_glBlendEquationSeparate +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum *bufs); +GLAPI PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +#define glDrawBuffers glad_glDrawBuffers +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +#define glStencilOpSeparate glad_glStencilOpSeparate +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +#define glStencilFuncSeparate glad_glStencilFuncSeparate +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask); +GLAPI PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +#define glStencilMaskSeparate glad_glStencilMaskSeparate +typedef void (APIENTRYP PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); +GLAPI PFNGLATTACHSHADERPROC glad_glAttachShader; +#define glAttachShader glad_glAttachShader +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar *name); +GLAPI PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +#define glBindAttribLocation glad_glBindAttribLocation +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint shader); +GLAPI PFNGLCOMPILESHADERPROC glad_glCompileShader; +#define glCompileShader glad_glCompileShader +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(void); +GLAPI PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +#define glCreateProgram glad_glCreateProgram +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC)(GLenum type); +GLAPI PFNGLCREATESHADERPROC glad_glCreateShader; +#define glCreateShader glad_glCreateShader +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC)(GLuint program); +GLAPI PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +#define glDeleteProgram glad_glDeleteProgram +typedef void (APIENTRYP PFNGLDELETESHADERPROC)(GLuint shader); +GLAPI PFNGLDELETESHADERPROC glad_glDeleteShader; +#define glDeleteShader glad_glDeleteShader +typedef void (APIENTRYP PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader); +GLAPI PFNGLDETACHSHADERPROC glad_glDetachShader; +#define glDetachShader glad_glDetachShader +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index); +GLAPI PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +#define glDisableVertexAttribArray glad_glDisableVertexAttribArray +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index); +GLAPI PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +#define glEnableVertexAttribArray glad_glEnableVertexAttribArray +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +#define glGetActiveAttrib glad_glGetActiveAttrib +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +#define glGetActiveUniform glad_glGetActiveUniform +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GLAPI PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +#define glGetAttachedShaders glad_glGetAttachedShaders +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar *name); +GLAPI PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +#define glGetAttribLocation glad_glGetAttribLocation +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint *params); +GLAPI PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +#define glGetProgramiv glad_glGetProgramiv +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +#define glGetProgramInfoLog glad_glGetProgramInfoLog +typedef void (APIENTRYP PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint *params); +GLAPI PFNGLGETSHADERIVPROC glad_glGetShaderiv; +#define glGetShaderiv glad_glGetShaderiv +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +#define glGetShaderInfoLog glad_glGetShaderInfoLog +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +#define glGetShaderSource glad_glGetShaderSource +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar *name); +GLAPI PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +#define glGetUniformLocation glad_glGetUniformLocation +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat *params); +GLAPI PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +#define glGetUniformfv glad_glGetUniformfv +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint *params); +GLAPI PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +#define glGetUniformiv glad_glGetUniformiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble *params); +GLAPI PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +#define glGetVertexAttribdv glad_glGetVertexAttribdv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat *params); +GLAPI PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +#define glGetVertexAttribfv glad_glGetVertexAttribfv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint *params); +GLAPI PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +#define glGetVertexAttribiv glad_glGetVertexAttribiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void **pointer); +GLAPI PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC)(GLuint program); +GLAPI PFNGLISPROGRAMPROC glad_glIsProgram; +#define glIsProgram glad_glIsProgram +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC)(GLuint shader); +GLAPI PFNGLISSHADERPROC glad_glIsShader; +#define glIsShader glad_glIsShader +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC)(GLuint program); +GLAPI PFNGLLINKPROGRAMPROC glad_glLinkProgram; +#define glLinkProgram glad_glLinkProgram +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GLAPI PFNGLSHADERSOURCEPROC glad_glShaderSource; +#define glShaderSource glad_glShaderSource +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC)(GLuint program); +GLAPI PFNGLUSEPROGRAMPROC glad_glUseProgram; +#define glUseProgram glad_glUseProgram +typedef void (APIENTRYP PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0); +GLAPI PFNGLUNIFORM1FPROC glad_glUniform1f; +#define glUniform1f glad_glUniform1f +typedef void (APIENTRYP PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1); +GLAPI PFNGLUNIFORM2FPROC glad_glUniform2f; +#define glUniform2f glad_glUniform2f +typedef void (APIENTRYP PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI PFNGLUNIFORM3FPROC glad_glUniform3f; +#define glUniform3f glad_glUniform3f +typedef void (APIENTRYP PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI PFNGLUNIFORM4FPROC glad_glUniform4f; +#define glUniform4f glad_glUniform4f +typedef void (APIENTRYP PFNGLUNIFORM1IPROC)(GLint location, GLint v0); +GLAPI PFNGLUNIFORM1IPROC glad_glUniform1i; +#define glUniform1i glad_glUniform1i +typedef void (APIENTRYP PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1); +GLAPI PFNGLUNIFORM2IPROC glad_glUniform2i; +#define glUniform2i glad_glUniform2i +typedef void (APIENTRYP PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2); +GLAPI PFNGLUNIFORM3IPROC glad_glUniform3i; +#define glUniform3i glad_glUniform3i +typedef void (APIENTRYP PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI PFNGLUNIFORM4IPROC glad_glUniform4i; +#define glUniform4i glad_glUniform4i +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM1FVPROC glad_glUniform1fv; +#define glUniform1fv glad_glUniform1fv +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM2FVPROC glad_glUniform2fv; +#define glUniform2fv glad_glUniform2fv +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM3FVPROC glad_glUniform3fv; +#define glUniform3fv glad_glUniform3fv +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM4FVPROC glad_glUniform4fv; +#define glUniform4fv glad_glUniform4fv +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM1IVPROC glad_glUniform1iv; +#define glUniform1iv glad_glUniform1iv +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM2IVPROC glad_glUniform2iv; +#define glUniform2iv glad_glUniform2iv +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM3IVPROC glad_glUniform3iv; +#define glUniform3iv glad_glUniform3iv +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM4IVPROC glad_glUniform4iv; +#define glUniform4iv glad_glUniform4iv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +#define glUniformMatrix2fv glad_glUniformMatrix2fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +#define glUniformMatrix3fv glad_glUniformMatrix3fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +#define glUniformMatrix4fv glad_glUniformMatrix4fv +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC)(GLuint program); +GLAPI PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +#define glValidateProgram glad_glValidateProgram +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +#define glVertexAttrib1d glad_glVertexAttrib1d +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +#define glVertexAttrib1dv glad_glVertexAttrib1dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x); +GLAPI PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +#define glVertexAttrib1f glad_glVertexAttrib1f +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +#define glVertexAttrib1fv glad_glVertexAttrib1fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x); +GLAPI PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +#define glVertexAttrib1s glad_glVertexAttrib1s +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +#define glVertexAttrib1sv glad_glVertexAttrib1sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +#define glVertexAttrib2d glad_glVertexAttrib2d +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +#define glVertexAttrib2dv glad_glVertexAttrib2dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y); +GLAPI PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +#define glVertexAttrib2f glad_glVertexAttrib2f +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +#define glVertexAttrib2fv glad_glVertexAttrib2fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y); +GLAPI PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +#define glVertexAttrib2s glad_glVertexAttrib2s +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +#define glVertexAttrib2sv glad_glVertexAttrib2sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +#define glVertexAttrib3d glad_glVertexAttrib3d +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +#define glVertexAttrib3dv glad_glVertexAttrib3dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +#define glVertexAttrib3f glad_glVertexAttrib3f +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +#define glVertexAttrib3fv glad_glVertexAttrib3fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +#define glVertexAttrib3s glad_glVertexAttrib3s +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +#define glVertexAttrib3sv glad_glVertexAttrib3sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte *v); +GLAPI PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +#define glVertexAttrib4Niv glad_glVertexAttrib4Niv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +#define glVertexAttrib4Nub glad_glVertexAttrib4Nub +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte *v); +GLAPI PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort *v); +GLAPI PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte *v); +GLAPI PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +#define glVertexAttrib4bv glad_glVertexAttrib4bv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +#define glVertexAttrib4d glad_glVertexAttrib4d +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +#define glVertexAttrib4dv glad_glVertexAttrib4dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +#define glVertexAttrib4f glad_glVertexAttrib4f +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +#define glVertexAttrib4fv glad_glVertexAttrib4fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +#define glVertexAttrib4iv glad_glVertexAttrib4iv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +#define glVertexAttrib4s glad_glVertexAttrib4s +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +#define glVertexAttrib4sv glad_glVertexAttrib4sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte *v); +GLAPI PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +#define glVertexAttrib4ubv glad_glVertexAttrib4ubv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +#define glVertexAttrib4uiv glad_glVertexAttrib4uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort *v); +GLAPI PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +#define glVertexAttrib4usv glad_glVertexAttrib4usv +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GLAPI PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +#define glVertexAttribPointer glad_glVertexAttribPointer +#endif +#ifndef GL_ES_VERSION_2_0 +#define GL_ES_VERSION_2_0 1 +GLAPI int GLAD_GL_ES_VERSION_2_0; +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer); +GLAPI PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; +#define glBindFramebuffer glad_glBindFramebuffer +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer); +GLAPI PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; +#define glBindRenderbuffer glad_glBindRenderbuffer +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target); +GLAPI PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; +#define glCheckFramebufferStatus glad_glCheckFramebufferStatus +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC)(GLfloat d); +GLAPI PFNGLCLEARDEPTHFPROC glad_glClearDepthf; +#define glClearDepthf glad_glClearDepthf +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint *framebuffers); +GLAPI PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; +#define glDeleteFramebuffers glad_glDeleteFramebuffers +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint *renderbuffers); +GLAPI PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; +#define glDeleteRenderbuffers glad_glDeleteRenderbuffers +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f); +GLAPI PFNGLDEPTHRANGEFPROC glad_glDepthRangef; +#define glDepthRangef glad_glDepthRangef +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; +#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; +#define glFramebufferTexture2D glad_glFramebufferTexture2D +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC)(GLenum target); +GLAPI PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; +#define glGenerateMipmap glad_glGenerateMipmap +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint *framebuffers); +GLAPI PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; +#define glGenFramebuffers glad_glGenFramebuffers +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint *renderbuffers); +GLAPI PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; +#define glGenRenderbuffers glad_glGenRenderbuffers +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; +#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; +#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GLAPI PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; +#define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer); +GLAPI PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; +#define glIsFramebuffer glad_glIsFramebuffer +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer); +GLAPI PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; +#define glIsRenderbuffer glad_glIsRenderbuffer +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC)(void); +GLAPI PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; +#define glReleaseShaderCompiler glad_glReleaseShaderCompiler +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; +#define glRenderbufferStorage glad_glRenderbufferStorage +typedef void (APIENTRYP PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GLAPI PFNGLSHADERBINARYPROC glad_glShaderBinary; +#define glShaderBinary glad_glShaderBinary +#endif +#ifndef GL_VERSION_ES_CM_1_0 +#define GL_VERSION_ES_CM_1_0 1 +GLAPI int GLAD_GL_VERSION_ES_CM_1_0; +typedef void (APIENTRYP PFNGLCLIPPLANEFPROC)(GLenum p, const GLfloat *eqn); +GLAPI PFNGLCLIPPLANEFPROC glad_glClipPlanef; +#define glClipPlanef glad_glClipPlanef +typedef void (APIENTRYP PFNGLFRUSTUMFPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI PFNGLFRUSTUMFPROC glad_glFrustumf; +#define glFrustumf glad_glFrustumf +typedef void (APIENTRYP PFNGLGETCLIPPLANEFPROC)(GLenum plane, GLfloat *equation); +GLAPI PFNGLGETCLIPPLANEFPROC glad_glGetClipPlanef; +#define glGetClipPlanef glad_glGetClipPlanef +typedef void (APIENTRYP PFNGLORTHOFPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI PFNGLORTHOFPROC glad_glOrthof; +#define glOrthof glad_glOrthof +typedef void (APIENTRYP PFNGLALPHAFUNCXPROC)(GLenum func, GLfixed ref); +GLAPI PFNGLALPHAFUNCXPROC glad_glAlphaFuncx; +#define glAlphaFuncx glad_glAlphaFuncx +typedef void (APIENTRYP PFNGLCLEARCOLORXPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI PFNGLCLEARCOLORXPROC glad_glClearColorx; +#define glClearColorx glad_glClearColorx +typedef void (APIENTRYP PFNGLCLEARDEPTHXPROC)(GLfixed depth); +GLAPI PFNGLCLEARDEPTHXPROC glad_glClearDepthx; +#define glClearDepthx glad_glClearDepthx +typedef void (APIENTRYP PFNGLCLIPPLANEXPROC)(GLenum plane, const GLfixed *equation); +GLAPI PFNGLCLIPPLANEXPROC glad_glClipPlanex; +#define glClipPlanex glad_glClipPlanex +typedef void (APIENTRYP PFNGLCOLOR4XPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI PFNGLCOLOR4XPROC glad_glColor4x; +#define glColor4x glad_glColor4x +typedef void (APIENTRYP PFNGLDEPTHRANGEXPROC)(GLfixed n, GLfixed f); +GLAPI PFNGLDEPTHRANGEXPROC glad_glDepthRangex; +#define glDepthRangex glad_glDepthRangex +typedef void (APIENTRYP PFNGLFOGXPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLFOGXPROC glad_glFogx; +#define glFogx glad_glFogx +typedef void (APIENTRYP PFNGLFOGXVPROC)(GLenum pname, const GLfixed *param); +GLAPI PFNGLFOGXVPROC glad_glFogxv; +#define glFogxv glad_glFogxv +typedef void (APIENTRYP PFNGLFRUSTUMXPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI PFNGLFRUSTUMXPROC glad_glFrustumx; +#define glFrustumx glad_glFrustumx +typedef void (APIENTRYP PFNGLGETCLIPPLANEXPROC)(GLenum plane, GLfixed *equation); +GLAPI PFNGLGETCLIPPLANEXPROC glad_glGetClipPlanex; +#define glGetClipPlanex glad_glGetClipPlanex +typedef void (APIENTRYP PFNGLGETFIXEDVPROC)(GLenum pname, GLfixed *params); +GLAPI PFNGLGETFIXEDVPROC glad_glGetFixedv; +#define glGetFixedv glad_glGetFixedv +typedef void (APIENTRYP PFNGLGETLIGHTXVPROC)(GLenum light, GLenum pname, GLfixed *params); +GLAPI PFNGLGETLIGHTXVPROC glad_glGetLightxv; +#define glGetLightxv glad_glGetLightxv +typedef void (APIENTRYP PFNGLGETMATERIALXVPROC)(GLenum face, GLenum pname, GLfixed *params); +GLAPI PFNGLGETMATERIALXVPROC glad_glGetMaterialxv; +#define glGetMaterialxv glad_glGetMaterialxv +typedef void (APIENTRYP PFNGLGETTEXENVXVPROC)(GLenum target, GLenum pname, GLfixed *params); +GLAPI PFNGLGETTEXENVXVPROC glad_glGetTexEnvxv; +#define glGetTexEnvxv glad_glGetTexEnvxv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVPROC)(GLenum target, GLenum pname, GLfixed *params); +GLAPI PFNGLGETTEXPARAMETERXVPROC glad_glGetTexParameterxv; +#define glGetTexParameterxv glad_glGetTexParameterxv +typedef void (APIENTRYP PFNGLLIGHTMODELXPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLLIGHTMODELXPROC glad_glLightModelx; +#define glLightModelx glad_glLightModelx +typedef void (APIENTRYP PFNGLLIGHTMODELXVPROC)(GLenum pname, const GLfixed *param); +GLAPI PFNGLLIGHTMODELXVPROC glad_glLightModelxv; +#define glLightModelxv glad_glLightModelxv +typedef void (APIENTRYP PFNGLLIGHTXPROC)(GLenum light, GLenum pname, GLfixed param); +GLAPI PFNGLLIGHTXPROC glad_glLightx; +#define glLightx glad_glLightx +typedef void (APIENTRYP PFNGLLIGHTXVPROC)(GLenum light, GLenum pname, const GLfixed *params); +GLAPI PFNGLLIGHTXVPROC glad_glLightxv; +#define glLightxv glad_glLightxv +typedef void (APIENTRYP PFNGLLINEWIDTHXPROC)(GLfixed width); +GLAPI PFNGLLINEWIDTHXPROC glad_glLineWidthx; +#define glLineWidthx glad_glLineWidthx +typedef void (APIENTRYP PFNGLLOADMATRIXXPROC)(const GLfixed *m); +GLAPI PFNGLLOADMATRIXXPROC glad_glLoadMatrixx; +#define glLoadMatrixx glad_glLoadMatrixx +typedef void (APIENTRYP PFNGLMATERIALXPROC)(GLenum face, GLenum pname, GLfixed param); +GLAPI PFNGLMATERIALXPROC glad_glMaterialx; +#define glMaterialx glad_glMaterialx +typedef void (APIENTRYP PFNGLMATERIALXVPROC)(GLenum face, GLenum pname, const GLfixed *param); +GLAPI PFNGLMATERIALXVPROC glad_glMaterialxv; +#define glMaterialxv glad_glMaterialxv +typedef void (APIENTRYP PFNGLMULTMATRIXXPROC)(const GLfixed *m); +GLAPI PFNGLMULTMATRIXXPROC glad_glMultMatrixx; +#define glMultMatrixx glad_glMultMatrixx +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XPROC)(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI PFNGLMULTITEXCOORD4XPROC glad_glMultiTexCoord4x; +#define glMultiTexCoord4x glad_glMultiTexCoord4x +typedef void (APIENTRYP PFNGLNORMAL3XPROC)(GLfixed nx, GLfixed ny, GLfixed nz); +GLAPI PFNGLNORMAL3XPROC glad_glNormal3x; +#define glNormal3x glad_glNormal3x +typedef void (APIENTRYP PFNGLORTHOXPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI PFNGLORTHOXPROC glad_glOrthox; +#define glOrthox glad_glOrthox +typedef void (APIENTRYP PFNGLPOINTPARAMETERXPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLPOINTPARAMETERXPROC glad_glPointParameterx; +#define glPointParameterx glad_glPointParameterx +typedef void (APIENTRYP PFNGLPOINTPARAMETERXVPROC)(GLenum pname, const GLfixed *params); +GLAPI PFNGLPOINTPARAMETERXVPROC glad_glPointParameterxv; +#define glPointParameterxv glad_glPointParameterxv +typedef void (APIENTRYP PFNGLPOINTSIZEXPROC)(GLfixed size); +GLAPI PFNGLPOINTSIZEXPROC glad_glPointSizex; +#define glPointSizex glad_glPointSizex +typedef void (APIENTRYP PFNGLPOLYGONOFFSETXPROC)(GLfixed factor, GLfixed units); +GLAPI PFNGLPOLYGONOFFSETXPROC glad_glPolygonOffsetx; +#define glPolygonOffsetx glad_glPolygonOffsetx +typedef void (APIENTRYP PFNGLROTATEXPROC)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLROTATEXPROC glad_glRotatex; +#define glRotatex glad_glRotatex +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEXPROC)(GLclampx value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEXPROC glad_glSampleCoveragex; +#define glSampleCoveragex glad_glSampleCoveragex +typedef void (APIENTRYP PFNGLSCALEXPROC)(GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLSCALEXPROC glad_glScalex; +#define glScalex glad_glScalex +typedef void (APIENTRYP PFNGLTEXENVXPROC)(GLenum target, GLenum pname, GLfixed param); +GLAPI PFNGLTEXENVXPROC glad_glTexEnvx; +#define glTexEnvx glad_glTexEnvx +typedef void (APIENTRYP PFNGLTEXENVXVPROC)(GLenum target, GLenum pname, const GLfixed *params); +GLAPI PFNGLTEXENVXVPROC glad_glTexEnvxv; +#define glTexEnvxv glad_glTexEnvxv +typedef void (APIENTRYP PFNGLTEXPARAMETERXPROC)(GLenum target, GLenum pname, GLfixed param); +GLAPI PFNGLTEXPARAMETERXPROC glad_glTexParameterx; +#define glTexParameterx glad_glTexParameterx +typedef void (APIENTRYP PFNGLTEXPARAMETERXVPROC)(GLenum target, GLenum pname, const GLfixed *params); +GLAPI PFNGLTEXPARAMETERXVPROC glad_glTexParameterxv; +#define glTexParameterxv glad_glTexParameterxv +typedef void (APIENTRYP PFNGLTRANSLATEXPROC)(GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLTRANSLATEXPROC glad_glTranslatex; +#define glTranslatex glad_glTranslatex +#endif +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x0040 +#define GL_MAP_COHERENT_BIT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 +GLAPI int GLAD_GL_ARB_buffer_storage; +typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC)(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; +#define glBufferStorage glad_glBufferStorage +#endif +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +GLAPI int GLAD_GL_ARB_debug_output; +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +#define glDebugMessageControlARB glad_glDebugMessageControlARB +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +#define glDebugMessageInsertARB glad_glDebugMessageInsertARB +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback, const void *userParam); +GLAPI PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +#define glDebugMessageCallbackARB glad_glDebugMessageCallbackARB +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB +#endif +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +GLAPI int GLAD_GL_ARB_map_buffer_range; +typedef void * (APIENTRYP PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; +#define glMapBufferRange glad_glMapBufferRange +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length); +GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; +#define glFlushMappedBufferRange glad_glFlushMappedBufferRange +#endif +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +GLAPI int GLAD_GL_ARB_texture_rectangle; +#endif +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +GLAPI int GLAD_GL_EXT_fog_coord; +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC)(GLfloat coord); +GLAPI PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; +#define glFogCoordfEXT glad_glFogCoordfEXT +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC)(const GLfloat *coord); +GLAPI PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; +#define glFogCoordfvEXT glad_glFogCoordfvEXT +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC)(GLdouble coord); +GLAPI PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; +#define glFogCoorddEXT glad_glFogCoorddEXT +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC)(const GLdouble *coord); +GLAPI PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; +#define glFogCoorddvEXT glad_glFogCoorddvEXT +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; +#define glFogCoordPointerEXT glad_glFogCoordPointerEXT +#endif +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +GLAPI int GLAD_GL_EXT_framebuffer_object; +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC)(GLuint renderbuffer); +GLAPI PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; +#define glIsRenderbufferEXT glad_glIsRenderbufferEXT +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC)(GLenum target, GLuint renderbuffer); +GLAPI PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; +#define glBindRenderbufferEXT glad_glBindRenderbufferEXT +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC)(GLsizei n, const GLuint *renderbuffers); +GLAPI PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; +#define glDeleteRenderbuffersEXT glad_glDeleteRenderbuffersEXT +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC)(GLsizei n, GLuint *renderbuffers); +GLAPI PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; +#define glGenRenderbuffersEXT glad_glGenRenderbuffersEXT +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; +#define glRenderbufferStorageEXT glad_glRenderbufferStorageEXT +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; +#define glGetRenderbufferParameterivEXT glad_glGetRenderbufferParameterivEXT +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC)(GLuint framebuffer); +GLAPI PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; +#define glIsFramebufferEXT glad_glIsFramebufferEXT +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer); +GLAPI PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; +#define glBindFramebufferEXT glad_glBindFramebufferEXT +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint *framebuffers); +GLAPI PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; +#define glDeleteFramebuffersEXT glad_glDeleteFramebuffersEXT +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint *framebuffers); +GLAPI PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; +#define glGenFramebuffersEXT glad_glGenFramebuffersEXT +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(GLenum target); +GLAPI PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; +#define glCheckFramebufferStatusEXT glad_glCheckFramebufferStatusEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; +#define glFramebufferTexture1DEXT glad_glFramebufferTexture1DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; +#define glFramebufferTexture2DEXT glad_glFramebufferTexture2DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; +#define glFramebufferTexture3DEXT glad_glFramebufferTexture3DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; +#define glFramebufferRenderbufferEXT glad_glFramebufferRenderbufferEXT +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; +#define glGetFramebufferAttachmentParameterivEXT glad_glGetFramebufferAttachmentParameterivEXT +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC)(GLenum target); +GLAPI PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; +#define glGenerateMipmapEXT glad_glGenerateMipmapEXT +#endif +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +GLAPI int GLAD_GL_EXT_texture_compression_s3tc; +#endif +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +GLAPI int GLAD_GL_EXT_texture_filter_anisotropic; +#endif +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +GLAPI int GLAD_GL_NV_fog_distance; +#endif +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +GLAPI int GLAD_GL_NV_multisample_filter_hint; +#endif +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +GLAPI int GLAD_GL_SGIS_fog_function; +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC)(GLsizei n, const GLfloat *points); +GLAPI PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; +#define glFogFuncSGIS glad_glFogFuncSGIS +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC)(GLfloat *points); +GLAPI PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; +#define glGetFogFuncSGIS glad_glGetFogFuncSGIS +#endif +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +GLAPI int GLAD_GL_SGIX_fog_offset; +#endif +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +GLAPI int GLAD_GL_EXT_texture_compression_s3tc; +#endif +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +GLAPI int GLAD_GL_EXT_texture_filter_anisotropic; +#endif +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +GLAPI int GLAD_GL_EXT_texture_filter_anisotropic; +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/source/glad/include/glad/glad_wgl.h b/source/glad/include/glad/glad_wgl.h new file mode 100644 index 000000000..88501caca --- /dev/null +++ b/source/glad/include/glad/glad_wgl.h @@ -0,0 +1,220 @@ +/* + + WGL loader generated by glad 0.1.16a0 on Sat Jan 27 08:40:53 2018. + + Language/Generator: C/C++ + Specification: wgl + APIs: wgl=1.0 + Profile: - + Extensions: + WGL_ARB_create_context, + WGL_ARB_create_context_profile, + WGL_ARB_extensions_string, + WGL_ARB_pixel_format, + WGL_EXT_extensions_string, + WGL_EXT_swap_control + Loader: True + Local files: False + Omit khrplatform: False + + Commandline: + --api="wgl=1.0" --generator="c" --spec="wgl" --extensions="WGL_ARB_create_context,WGL_ARB_create_context_profile,WGL_ARB_extensions_string,WGL_ARB_pixel_format,WGL_EXT_extensions_string,WGL_EXT_swap_control" + Online: + http://glad.dav1d.de/#language=c&specification=wgl&loader=on&api=wgl%3D1.0&extensions=WGL_ARB_create_context&extensions=WGL_ARB_create_context_profile&extensions=WGL_ARB_extensions_string&extensions=WGL_ARB_pixel_format&extensions=WGL_EXT_extensions_string&extensions=WGL_EXT_swap_control +*/ + + +#ifndef WINAPI +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef NOMINMAX +#define NOMINMAX 1 +#endif +#include +#endif + +#include + +#ifndef __glad_wglext_h_ + +#ifdef __wglext_h_ +#error WGL header already included, remove this include, glad already provides it +#endif + +#define __glad_wglext_h_ +#define __wglext_h_ + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* (* GLADloadproc)(const char *name); + +#ifndef GLAPI +# if defined(GLAD_GLAPI_EXPORT) +# if defined(_WIN32) || defined(__CYGWIN__) +# if defined(GLAD_GLAPI_EXPORT_BUILD) +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllexport)) extern +# else +# define GLAPI __declspec(dllexport) extern +# endif +# else +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllimport)) extern +# else +# define GLAPI __declspec(dllimport) extern +# endif +# endif +# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) +# define GLAPI __attribute__ ((visibility ("default"))) extern +# else +# define GLAPI extern +# endif +# else +# define GLAPI extern +# endif +#endif + +GLAPI int gladLoadWGL(HDC hdc); + +GLAPI int gladLoadWGLLoader(GLADloadproc, HDC hdc); + +struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +}; +DECLARE_HANDLE(HPBUFFERARB); +DECLARE_HANDLE(HPBUFFEREXT); +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); +DECLARE_HANDLE(HPVIDEODEV); +DECLARE_HANDLE(HPGPUNV); +DECLARE_HANDLE(HGPUNV); +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); +typedef struct _GPU_DEVICE GPU_DEVICE; +typedef struct _GPU_DEVICE *PGPU_DEVICE; +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define ERROR_INVALID_PROFILE_ARB 0x2096 +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 +GLAPI int GLAD_WGL_ARB_create_context; +typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC hDC, HGLRC hShareContext, const int *attribList); +GLAPI PFNWGLCREATECONTEXTATTRIBSARBPROC glad_wglCreateContextAttribsARB; +#define wglCreateContextAttribsARB glad_wglCreateContextAttribsARB +#endif +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 +GLAPI int GLAD_WGL_ARB_create_context_profile; +#endif +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 +GLAPI int GLAD_WGL_ARB_extensions_string; +typedef const char * (APIENTRYP PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC hdc); +GLAPI PFNWGLGETEXTENSIONSSTRINGARBPROC glad_wglGetExtensionsStringARB; +#define wglGetExtensionsStringARB glad_wglGetExtensionsStringARB +#endif +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 +GLAPI int GLAD_WGL_ARB_pixel_format; +typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +GLAPI PFNWGLGETPIXELFORMATATTRIBIVARBPROC glad_wglGetPixelFormatAttribivARB; +#define wglGetPixelFormatAttribivARB glad_wglGetPixelFormatAttribivARB +typedef BOOL (APIENTRYP PFNWGLGETPIXELFORMATATTRIBFVARBPROC)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +GLAPI PFNWGLGETPIXELFORMATATTRIBFVARBPROC glad_wglGetPixelFormatAttribfvARB; +#define wglGetPixelFormatAttribfvARB glad_wglGetPixelFormatAttribfvARB +typedef BOOL (APIENTRYP PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +GLAPI PFNWGLCHOOSEPIXELFORMATARBPROC glad_wglChoosePixelFormatARB; +#define wglChoosePixelFormatARB glad_wglChoosePixelFormatARB +#endif +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 +GLAPI int GLAD_WGL_EXT_extensions_string; +typedef const char * (APIENTRYP PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void); +GLAPI PFNWGLGETEXTENSIONSSTRINGEXTPROC glad_wglGetExtensionsStringEXT; +#define wglGetExtensionsStringEXT glad_wglGetExtensionsStringEXT +#endif +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 +GLAPI int GLAD_WGL_EXT_swap_control; +typedef BOOL (APIENTRYP PFNWGLSWAPINTERVALEXTPROC)(int interval); +GLAPI PFNWGLSWAPINTERVALEXTPROC glad_wglSwapIntervalEXT; +#define wglSwapIntervalEXT glad_wglSwapIntervalEXT +typedef int (APIENTRYP PFNWGLGETSWAPINTERVALEXTPROC)(void); +GLAPI PFNWGLGETSWAPINTERVALEXTPROC glad_wglGetSwapIntervalEXT; +#define wglGetSwapIntervalEXT glad_wglGetSwapIntervalEXT +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/source/glad/src/glad.c b/source/glad/src/glad.c new file mode 100644 index 000000000..262fb761f --- /dev/null +++ b/source/glad/src/glad.c @@ -0,0 +1,2031 @@ +/* + + OpenGL, OpenGL ES loader generated by glad 0.1.16a0 on Sat Jan 27 02:35:01 2018. + + Language/Generator: C/C++ + Specification: gl + APIs: gl=2.0, gles2=2.0, gles1=1.0 + Profile: compatibility + Extensions: + GL_ARB_buffer_storage, + GL_ARB_debug_output, + GL_ARB_map_buffer_range, + GL_ARB_texture_rectangle, + GL_EXT_fog_coord, + GL_EXT_framebuffer_object, + GL_EXT_texture_compression_s3tc, + GL_EXT_texture_filter_anisotropic, + GL_NV_fog_distance, + GL_NV_multisample_filter_hint, + GL_SGIS_fog_function, + GL_SGIX_fog_offset + Loader: True + Local files: False + Omit khrplatform: False + + Commandline: + --profile="compatibility" --api="gl=2.0,gles2=2.0,gles1=1.0" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_debug_output,GL_ARB_map_buffer_range,GL_ARB_texture_rectangle,GL_EXT_fog_coord,GL_EXT_framebuffer_object,GL_EXT_texture_compression_s3tc,GL_EXT_texture_filter_anisotropic,GL_NV_fog_distance,GL_NV_multisample_filter_hint,GL_SGIS_fog_function,GL_SGIX_fog_offset" + Online: + http://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D2.0&api=gles2%3D2.0&api=gles1%3D1.0&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_debug_output&extensions=GL_ARB_map_buffer_range&extensions=GL_ARB_texture_rectangle&extensions=GL_EXT_fog_coord&extensions=GL_EXT_framebuffer_object&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_filter_anisotropic&extensions=GL_NV_fog_distance&extensions=GL_NV_multisample_filter_hint&extensions=GL_SGIS_fog_function&extensions=GL_SGIX_fog_offset +*/ + +#include +#include +#include +#include + +static void* get_proc(const char *namez); + +#ifdef _WIN32 +#include +static HMODULE libGL; + +typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*); +static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; + +static +int open_gl(void) { + libGL = LoadLibraryW(L"opengl32.dll"); + if(libGL != NULL) { + gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress( + libGL, "wglGetProcAddress"); + return gladGetProcAddressPtr != NULL; + } + + return 0; +} + +static +void close_gl(void) { + if(libGL != NULL) { + FreeLibrary(libGL); + libGL = NULL; + } +} +#else +#include +static void* libGL; + +#ifndef __APPLE__ +typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*); +static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; +#endif + +static +int open_gl(void) { +#ifdef __APPLE__ + static const char *NAMES[] = { + "../Frameworks/OpenGL.framework/OpenGL", + "/Library/Frameworks/OpenGL.framework/OpenGL", + "/System/Library/Frameworks/OpenGL.framework/OpenGL", + "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL" + }; +#else + static const char *NAMES[] = {"libGL.so.1", "libGL.so"}; +#endif + + unsigned int index = 0; + for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) { + libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL); + + if(libGL != NULL) { +#ifdef __APPLE__ + return 1; +#else + gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL, + "glXGetProcAddressARB"); + return gladGetProcAddressPtr != NULL; +#endif + } + } + + return 0; +} + +static +void close_gl(void) { + if(libGL != NULL) { + dlclose(libGL); + libGL = NULL; + } +} +#endif + +static +void* get_proc(const char *namez) { + void* result = NULL; + if(libGL == NULL) return NULL; + +#ifndef __APPLE__ + if(gladGetProcAddressPtr != NULL) { + result = gladGetProcAddressPtr(namez); + } +#endif + if(result == NULL) { +#ifdef _WIN32 + result = (void*)GetProcAddress(libGL, namez); +#else + result = dlsym(libGL, namez); +#endif + } + + return result; +} + +int gladLoadGL(void) { + int status = 0; + + if(open_gl()) { + status = gladLoadGLLoader(&get_proc); + close_gl(); + } + + return status; +} + +struct gladGLversionStruct GLVersion; + +#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) +#define _GLAD_IS_SOME_NEW_VERSION 1 +#endif + +static int max_loaded_major; +static int max_loaded_minor; + +static const char *exts = NULL; +static int num_exts_i = 0; +static const char **exts_i = NULL; + +static int get_exts(void) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + exts = (const char *)glGetString(GL_EXTENSIONS); +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + unsigned int index; + + num_exts_i = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); + if (num_exts_i > 0) { + exts_i = (const char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i)); + } + + if (exts_i == NULL) { + return 0; + } + + for(index = 0; index < (unsigned)num_exts_i; index++) { + const char *gl_str_tmp = (const char*)glGetStringi(GL_EXTENSIONS, index); + size_t len = strlen(gl_str_tmp); + + char *local_str = (char*)malloc((len+1) * sizeof(*exts_i)); + if(local_str != NULL) { +#if _MSC_VER >= 1400 + strncpy_s(local_str, len+1, gl_str_tmp, len); +#else + strncpy(local_str, gl_str_tmp, len+1); +#endif + } + exts_i[index] = local_str; + } + } +#endif + return 1; +} + +static void free_exts(void) { + if (exts_i != NULL) { + int index; + for(index = 0; index < num_exts_i; index++) { + free((char *)exts_i[index]); + } + free((void *)exts_i); + exts_i = NULL; + } +} + +static int has_ext(const char *ext) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + const char *extensions; + const char *loc; + const char *terminator; + extensions = exts; + if(extensions == NULL || ext == NULL) { + return 0; + } + + while(1) { + loc = strstr(extensions, ext); + if(loc == NULL) { + return 0; + } + + terminator = loc + strlen(ext); + if((loc == extensions || *(loc - 1) == ' ') && + (*terminator == ' ' || *terminator == '\0')) { + return 1; + } + extensions = terminator; + } +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + if(exts_i == NULL) return 0; + for(index = 0; index < num_exts_i; index++) { + const char *e = exts_i[index]; + + if(exts_i[index] != NULL && strcmp(e, ext) == 0) { + return 1; + } + } + } +#endif + + return 0; +} +int GLAD_GL_VERSION_1_0; +int GLAD_GL_VERSION_1_1; +int GLAD_GL_VERSION_1_2; +int GLAD_GL_VERSION_1_3; +int GLAD_GL_VERSION_1_4; +int GLAD_GL_VERSION_1_5; +int GLAD_GL_VERSION_2_0; +int GLAD_GL_ES_VERSION_2_0; +int GLAD_GL_VERSION_ES_CM_1_0; +PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +PFNGLPOINTSIZEXPROC glad_glPointSizex; +PFNGLWINDOWPOS2SPROC glad_glWindowPos2s; +PFNGLWINDOWPOS2IPROC glad_glWindowPos2i; +PFNGLWINDOWPOS2FPROC glad_glWindowPos2f; +PFNGLWINDOWPOS2DPROC glad_glWindowPos2d; +PFNGLVERTEX2FVPROC glad_glVertex2fv; +PFNGLINDEXIPROC glad_glIndexi; +PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; +PFNGLRECTDVPROC glad_glRectdv; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +PFNGLEVALCOORD2DPROC glad_glEvalCoord2d; +PFNGLEVALCOORD2FPROC glad_glEvalCoord2f; +PFNGLINDEXDPROC glad_glIndexd; +PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +PFNGLINDEXFPROC glad_glIndexf; +PFNGLLINEWIDTHPROC glad_glLineWidth; +PFNGLGETMAPFVPROC glad_glGetMapfv; +PFNGLINDEXSPROC glad_glIndexs; +PFNGLCOMPILESHADERPROC glad_glCompileShader; +PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv; +PFNGLINDEXFVPROC glad_glIndexfv; +PFNGLDEPTHRANGEXPROC glad_glDepthRangex; +PFNGLFOGIVPROC glad_glFogiv; +PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv; +PFNGLLIGHTMODELIVPROC glad_glLightModeliv; +PFNGLDEPTHRANGEFPROC glad_glDepthRangef; +PFNGLCOLOR4UIPROC glad_glColor4ui; +PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv; +PFNGLFOGFVPROC glad_glFogfv; +PFNGLVERTEX4IVPROC glad_glVertex4iv; +PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv; +PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv; +PFNGLCREATESHADERPROC glad_glCreateShader; +PFNGLISBUFFERPROC glad_glIsBuffer; +PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; +PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +PFNGLVERTEX4FVPROC glad_glVertex4fv; +PFNGLBINDTEXTUREPROC glad_glBindTexture; +PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv; +PFNGLLINEWIDTHXPROC glad_glLineWidthx; +PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv; +PFNGLPOINTSIZEPROC glad_glPointSize; +PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +PFNGLCOLOR4BVPROC glad_glColor4bv; +PFNGLRASTERPOS2FPROC glad_glRasterPos2f; +PFNGLRASTERPOS2DPROC glad_glRasterPos2d; +PFNGLLOADIDENTITYPROC glad_glLoadIdentity; +PFNGLRASTERPOS2IPROC glad_glRasterPos2i; +PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; +PFNGLCOLOR3BPROC glad_glColor3b; +PFNGLEDGEFLAGPROC glad_glEdgeFlag; +PFNGLVERTEX3DPROC glad_glVertex3d; +PFNGLVERTEX3FPROC glad_glVertex3f; +PFNGLVERTEX3IPROC glad_glVertex3i; +PFNGLCOLOR3IPROC glad_glColor3i; +PFNGLGETFIXEDVPROC glad_glGetFixedv; +PFNGLUNIFORM3FPROC glad_glUniform3f; +PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +PFNGLCOLOR3SPROC glad_glColor3s; +PFNGLVERTEX3SPROC glad_glVertex3s; +PFNGLGETCLIPPLANEFPROC glad_glGetClipPlanef; +PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv; +PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +PFNGLVERTEX2IVPROC glad_glVertex2iv; +PFNGLCOLOR3SVPROC glad_glColor3sv; +PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +PFNGLNORMALPOINTERPROC glad_glNormalPointer; +PFNGLGETMATERIALXVPROC glad_glGetMaterialxv; +PFNGLFOGXPROC glad_glFogx; +PFNGLVERTEX4SVPROC glad_glVertex4sv; +PFNGLPASSTHROUGHPROC glad_glPassThrough; +PFNGLFOGIPROC glad_glFogi; +PFNGLBEGINPROC glad_glBegin; +PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv; +PFNGLCOLOR3UBVPROC glad_glColor3ubv; +PFNGLVERTEXPOINTERPROC glad_glVertexPointer; +PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv; +PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; +PFNGLDRAWARRAYSPROC glad_glDrawArrays; +PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d; +PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f; +PFNGLLIGHTFVPROC glad_glLightfv; +PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +PFNGLCLEARPROC glad_glClear; +PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i; +PFNGLTEXENVXPROC glad_glTexEnvx; +PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s; +PFNGLISENABLEDPROC glad_glIsEnabled; +PFNGLSTENCILOPPROC glad_glStencilOp; +PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; +PFNGLTRANSLATEFPROC glad_glTranslatef; +PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +PFNGLTRANSLATEDPROC glad_glTranslated; +PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv; +PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +PFNGLTEXPARAMETERXPROC glad_glTexParameterx; +PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +PFNGLTEXENVXVPROC glad_glTexEnvxv; +PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv; +PFNGLGETMATERIALFVPROC glad_glGetMaterialfv; +PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +PFNGLFOGCOORDFVPROC glad_glFogCoordfv; +PFNGLTRANSLATEXPROC glad_glTranslatex; +PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv; +PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; +PFNGLINDEXSVPROC glad_glIndexsv; +PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; +PFNGLVERTEX3IVPROC glad_glVertex3iv; +PFNGLBITMAPPROC glad_glBitmap; +PFNGLORTHOFPROC glad_glOrthof; +PFNGLMATERIALIPROC glad_glMateriali; +PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +PFNGLGETQUERYIVPROC glad_glGetQueryiv; +PFNGLTEXCOORD4FPROC glad_glTexCoord4f; +PFNGLTEXCOORD4DPROC glad_glTexCoord4d; +PFNGLFRUSTUMXPROC glad_glFrustumx; +PFNGLTEXCOORD4IPROC glad_glTexCoord4i; +PFNGLFRUSTUMFPROC glad_glFrustumf; +PFNGLMATERIALFPROC glad_glMaterialf; +PFNGLTEXCOORD4SPROC glad_glTexCoord4s; +PFNGLMATERIALXPROC glad_glMaterialx; +PFNGLISSHADERPROC glad_glIsShader; +PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s; +PFNGLVERTEX3DVPROC glad_glVertex3dv; +PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +PFNGLENABLEPROC glad_glEnable; +PFNGLCOLOR4FVPROC glad_glColor4fv; +PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv; +PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv; +PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv; +PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i; +PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv; +PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv; +PFNGLTEXGENFPROC glad_glTexGenf; +PFNGLGETPOINTERVPROC glad_glGetPointerv; +PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +PFNGLNORMAL3FVPROC glad_glNormal3fv; +PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s; +PFNGLDEPTHRANGEPROC glad_glDepthRange; +PFNGLFRUSTUMPROC glad_glFrustum; +PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv; +PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +PFNGLPUSHMATRIXPROC glad_glPushMatrix; +PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv; +PFNGLORTHOPROC glad_glOrtho; +PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv; +PFNGLCLEARINDEXPROC glad_glClearIndex; +PFNGLMAP1DPROC glad_glMap1d; +PFNGLMAP1FPROC glad_glMap1f; +PFNGLFLUSHPROC glad_glFlush; +PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; +PFNGLINDEXIVPROC glad_glIndexiv; +PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv; +PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +PFNGLPIXELZOOMPROC glad_glPixelZoom; +PFNGLLIGHTXPROC glad_glLightx; +PFNGLGETTEXPARAMETERXVPROC glad_glGetTexParameterxv; +PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; +PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +PFNGLLIGHTIPROC glad_glLighti; +PFNGLLIGHTFPROC glad_glLightf; +PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +PFNGLUNIFORM4IVPROC glad_glUniform4iv; +PFNGLCLEARSTENCILPROC glad_glClearStencil; +PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv; +PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv; +PFNGLGENTEXTURESPROC glad_glGenTextures; +PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv; +PFNGLLIGHTMODELXVPROC glad_glLightModelxv; +PFNGLMATERIALXVPROC glad_glMaterialxv; +PFNGLINDEXPOINTERPROC glad_glIndexPointer; +PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +PFNGLVERTEX2FPROC glad_glVertex2f; +PFNGLVERTEX2DPROC glad_glVertex2d; +PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; +PFNGLUNIFORM2IPROC glad_glUniform2i; +PFNGLMAPGRID2DPROC glad_glMapGrid2d; +PFNGLMAPGRID2FPROC glad_glMapGrid2f; +PFNGLVERTEX2IPROC glad_glVertex2i; +PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +PFNGLVERTEX2SPROC glad_glVertex2s; +PFNGLNORMAL3BVPROC glad_glNormal3bv; +PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv; +PFNGLCOLOR4XPROC glad_glColor4x; +PFNGLVERTEX3SVPROC glad_glVertex3sv; +PFNGLGENQUERIESPROC glad_glGenQueries; +PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv; +PFNGLTEXENVFPROC glad_glTexEnvf; +PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +PFNGLFOGCOORDDPROC glad_glFogCoordd; +PFNGLFOGCOORDFPROC glad_glFogCoordf; +PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +PFNGLTEXENVIPROC glad_glTexEnvi; +PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv; +PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv; +PFNGLUNIFORM2IVPROC glad_glUniform2iv; +PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +PFNGLMATRIXMODEPROC glad_glMatrixMode; +PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer; +PFNGLGETMAPIVPROC glad_glGetMapiv; +PFNGLGETSHADERIVPROC glad_glGetShaderiv; +PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d; +PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f; +PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures; +PFNGLCALLLISTPROC glad_glCallList; +PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv; +PFNGLGETDOUBLEVPROC glad_glGetDoublev; +PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv; +PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +PFNGLLIGHTMODELFPROC glad_glLightModelf; +PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +PFNGLVERTEX2SVPROC glad_glVertex2sv; +PFNGLLIGHTMODELIPROC glad_glLightModeli; +PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv; +PFNGLUNIFORM3FVPROC glad_glUniform3fv; +PFNGLPIXELSTOREIPROC glad_glPixelStorei; +PFNGLCALLLISTSPROC glad_glCallLists; +PFNGLLIGHTMODELXPROC glad_glLightModelx; +PFNGLMAPBUFFERPROC glad_glMapBuffer; +PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d; +PFNGLTEXCOORD3IPROC glad_glTexCoord3i; +PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv; +PFNGLRASTERPOS3IPROC glad_glRasterPos3i; +PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b; +PFNGLRASTERPOS3DPROC glad_glRasterPos3d; +PFNGLRASTERPOS3FPROC glad_glRasterPos3f; +PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +PFNGLTEXCOORD3FPROC glad_glTexCoord3f; +PFNGLTEXCOORD3DPROC glad_glTexCoord3d; +PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +PFNGLTEXCOORD3SPROC glad_glTexCoord3s; +PFNGLUNIFORM3IVPROC glad_glUniform3iv; +PFNGLRASTERPOS3SPROC glad_glRasterPos3s; +PFNGLPOLYGONMODEPROC glad_glPolygonMode; +PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident; +PFNGLISLISTPROC glad_glIsList; +PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv; +PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv; +PFNGLCOLOR4SPROC glad_glColor4s; +PFNGLUSEPROGRAMPROC glad_glUseProgram; +PFNGLLINESTIPPLEPROC glad_glLineStipple; +PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv; +PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv; +PFNGLCOLOR4BPROC glad_glColor4b; +PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f; +PFNGLCOLOR4FPROC glad_glColor4f; +PFNGLCOLOR4DPROC glad_glColor4d; +PFNGLCOLOR4IPROC glad_glColor4i; +PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv; +PFNGLVERTEX2DVPROC glad_glVertex2dv; +PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +PFNGLFINISHPROC glad_glFinish; +PFNGLLIGHTXVPROC glad_glLightxv; +PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +PFNGLDELETESHADERPROC glad_glDeleteShader; +PFNGLDRAWELEMENTSPROC glad_glDrawElements; +PFNGLRASTERPOS2SPROC glad_glRasterPos2s; +PFNGLGETMAPDVPROC glad_glGetMapdv; +PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +PFNGLMATERIALFVPROC glad_glMaterialfv; +PFNGLVIEWPORTPROC glad_glViewport; +PFNGLINDEXDVPROC glad_glIndexdv; +PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv; +PFNGLCLEARDEPTHPROC glad_glClearDepth; +PFNGLPOLYGONOFFSETXPROC glad_glPolygonOffsetx; +PFNGLPOINTPARAMETERXVPROC glad_glPointParameterxv; +PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +PFNGLPOPNAMEPROC glad_glPopName; +PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +PFNGLPIXELSTOREFPROC glad_glPixelStoref; +PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv; +PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv; +PFNGLRECTIPROC glad_glRecti; +PFNGLCOLOR4UBPROC glad_glColor4ub; +PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf; +PFNGLRECTFPROC glad_glRectf; +PFNGLRECTDPROC glad_glRectd; +PFNGLNORMAL3SVPROC glad_glNormal3sv; +PFNGLNEWLISTPROC glad_glNewList; +PFNGLCOLOR4USPROC glad_glColor4us; +PFNGLLINKPROGRAMPROC glad_glLinkProgram; +PFNGLHINTPROC glad_glHint; +PFNGLRECTSPROC glad_glRects; +PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv; +PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv; +PFNGLGETSTRINGPROC glad_glGetString; +PFNGLEDGEFLAGVPROC glad_glEdgeFlagv; +PFNGLDETACHSHADERPROC glad_glDetachShader; +PFNGLSCALEFPROC glad_glScalef; +PFNGLENDQUERYPROC glad_glEndQuery; +PFNGLSCALEDPROC glad_glScaled; +PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer; +PFNGLSCALEXPROC glad_glScalex; +PFNGLCOPYPIXELSPROC glad_glCopyPixels; +PFNGLPOPATTRIBPROC glad_glPopAttrib; +PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +PFNGLALPHAFUNCXPROC glad_glAlphaFuncx; +PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +PFNGLINITNAMESPROC glad_glInitNames; +PFNGLCOLOR3DVPROC glad_glColor3dv; +PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +PFNGLCOLORMATERIALPROC glad_glColorMaterial; +PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +PFNGLUNIFORM1FPROC glad_glUniform1f; +PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +PFNGLRENDERMODEPROC glad_glRenderMode; +PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv; +PFNGLUNIFORM1IPROC glad_glUniform1i; +PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +PFNGLUNIFORM3IPROC glad_glUniform3i; +PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi; +PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +PFNGLDISABLEPROC glad_glDisable; +PFNGLLOGICOPPROC glad_glLogicOp; +PFNGLEVALPOINT2PROC glad_glEvalPoint2; +PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf; +PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i; +PFNGLCOLOR3FPROC glad_glColor3f; +PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; +PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv; +PFNGLRECTFVPROC glad_glRectfv; +PFNGLCULLFACEPROC glad_glCullFace; +PFNGLGETLIGHTFVPROC glad_glGetLightfv; +PFNGLCOLOR3DPROC glad_glColor3d; +PFNGLTEXGENDPROC glad_glTexGend; +PFNGLTEXGENIPROC glad_glTexGeni; +PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s; +PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i; +PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f; +PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d; +PFNGLATTACHSHADERPROC glad_glAttachShader; +PFNGLFOGCOORDDVPROC glad_glFogCoorddv; +PFNGLGETTEXGENFVPROC glad_glGetTexGenfv; +PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer; +PFNGLSHADERBINARYPROC glad_glShaderBinary; +PFNGLTEXGENIVPROC glad_glTexGeniv; +PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv; +PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv; +PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture; +PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us; +PFNGLTEXENVFVPROC glad_glTexEnvfv; +PFNGLREADBUFFERPROC glad_glReadBuffer; +PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; +PFNGLSAMPLECOVERAGEXPROC glad_glSampleCoveragex; +PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv; +PFNGLLIGHTMODELFVPROC glad_glLightModelfv; +PFNGLDELETELISTSPROC glad_glDeleteLists; +PFNGLGETCLIPPLANEPROC glad_glGetClipPlane; +PFNGLVERTEX4DVPROC glad_glVertex4dv; +PFNGLTEXCOORD2DPROC glad_glTexCoord2d; +PFNGLPOPMATRIXPROC glad_glPopMatrix; +PFNGLTEXCOORD2FPROC glad_glTexCoord2f; +PFNGLCOLOR4IVPROC glad_glColor4iv; +PFNGLINDEXUBVPROC glad_glIndexubv; +PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +PFNGLTEXCOORD2IPROC glad_glTexCoord2i; +PFNGLRASTERPOS4DPROC glad_glRasterPos4d; +PFNGLRASTERPOS4FPROC glad_glRasterPos4f; +PFNGLPOINTPARAMETERXPROC glad_glPointParameterx; +PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +PFNGLTEXCOORD2SPROC glad_glTexCoord2s; +PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; +PFNGLVERTEX3FVPROC glad_glVertex3fv; +PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv; +PFNGLMATERIALIVPROC glad_glMaterialiv; +PFNGLORTHOXPROC glad_glOrthox; +PFNGLISPROGRAMPROC glad_glIsProgram; +PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +PFNGLVERTEX4SPROC glad_glVertex4s; +PFNGLROTATEXPROC glad_glRotatex; +PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +PFNGLNORMAL3DVPROC glad_glNormal3dv; +PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; +PFNGLUNIFORM4IPROC glad_glUniform4i; +PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +PFNGLROTATEDPROC glad_glRotated; +PFNGLROTATEFPROC glad_glRotatef; +PFNGLVERTEX4IPROC glad_glVertex4i; +PFNGLREADPIXELSPROC glad_glReadPixels; +PFNGLLOADNAMEPROC glad_glLoadName; +PFNGLUNIFORM4FPROC glad_glUniform4f; +PFNGLGETTEXENVXVPROC glad_glGetTexEnvxv; +PFNGLSHADEMODELPROC glad_glShadeModel; +PFNGLMAPGRID1DPROC glad_glMapGrid1d; +PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +PFNGLMAPGRID1FPROC glad_glMapGrid1f; +PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState; +PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv; +PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer; +PFNGLALPHAFUNCPROC glad_glAlphaFunc; +PFNGLUNIFORM1IVPROC glad_glUniform1iv; +PFNGLGETCLIPPLANEXPROC glad_glGetClipPlanex; +PFNGLMULTMATRIXXPROC glad_glMultMatrixx; +PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv; +PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +PFNGLSTENCILFUNCPROC glad_glStencilFunc; +PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv; +PFNGLCOLOR4UIVPROC glad_glColor4uiv; +PFNGLRECTIVPROC glad_glRectiv; +PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv; +PFNGLEVALMESH2PROC glad_glEvalMesh2; +PFNGLEVALMESH1PROC glad_glEvalMesh1; +PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer; +PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv; +PFNGLCOLOR4UBVPROC glad_glColor4ubv; +PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd; +PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf; +PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv; +PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +PFNGLTEXENVIVPROC glad_glTexEnviv; +PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +PFNGLGENBUFFERSPROC glad_glGenBuffers; +PFNGLSELECTBUFFERPROC glad_glSelectBuffer; +PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +PFNGLPUSHATTRIBPROC glad_glPushAttrib; +PFNGLBLENDFUNCPROC glad_glBlendFunc; +PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; +PFNGLLIGHTIVPROC glad_glLightiv; +PFNGLTEXGENFVPROC glad_glTexGenfv; +PFNGLNORMAL3XPROC glad_glNormal3x; +PFNGLENDPROC glad_glEnd; +PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +PFNGLSCISSORPROC glad_glScissor; +PFNGLCLIPPLANEPROC glad_glClipPlane; +PFNGLPUSHNAMEPROC glad_glPushName; +PFNGLTEXGENDVPROC glad_glTexGendv; +PFNGLINDEXUBPROC glad_glIndexub; +PFNGLGETLIGHTXVPROC glad_glGetLightxv; +PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv; +PFNGLRASTERPOS4IPROC glad_glRasterPos4i; +PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd; +PFNGLCLEARCOLORPROC glad_glClearColor; +PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +PFNGLNORMAL3SPROC glad_glNormal3s; +PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +PFNGLBLENDCOLORPROC glad_glBlendColor; +PFNGLWINDOWPOS3DPROC glad_glWindowPos3d; +PFNGLCOLOR4DVPROC glad_glColor4dv; +PFNGLCLEARCOLORXPROC glad_glClearColorx; +PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +PFNGLUNIFORM2FVPROC glad_glUniform2fv; +PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub; +PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui; +PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv; +PFNGLFOGXVPROC glad_glFogxv; +PFNGLNORMAL3IVPROC glad_glNormal3iv; +PFNGLCLEARDEPTHXPROC glad_glClearDepthx; +PFNGLWINDOWPOS3SPROC glad_glWindowPos3s; +PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +PFNGLCLEARDEPTHFPROC glad_glClearDepthf; +PFNGLWINDOWPOS3IPROC glad_glWindowPos3i; +PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s; +PFNGLWINDOWPOS3FPROC glad_glWindowPos3f; +PFNGLCOLOR3USPROC glad_glColor3us; +PFNGLCOLOR3UIVPROC glad_glColor3uiv; +PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +PFNGLGETLIGHTIVPROC glad_glGetLightiv; +PFNGLDEPTHFUNCPROC glad_glDepthFunc; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +PFNGLLISTBASEPROC glad_glListBase; +PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f; +PFNGLCOLOR3UBPROC glad_glColor3ub; +PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d; +PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +PFNGLCOLOR3UIPROC glad_glColor3ui; +PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i; +PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple; +PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv; +PFNGLCOLORMASKPROC glad_glColorMask; +PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +PFNGLMULTITEXCOORD4XPROC glad_glMultiTexCoord4x; +PFNGLRASTERPOS4SPROC glad_glRasterPos4s; +PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv; +PFNGLCOLOR4SVPROC glad_glColor4sv; +PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib; +PFNGLFOGFPROC glad_glFogf; +PFNGLCOLOR3IVPROC glad_glColor3iv; +PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +PFNGLTEXCOORD1IPROC glad_glTexCoord1i; +PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; +PFNGLTEXCOORD1DPROC glad_glTexCoord1d; +PFNGLTEXCOORD1FPROC glad_glTexCoord1f; +PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState; +PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv; +PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +PFNGLTEXCOORD1SPROC glad_glTexCoord1s; +PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +PFNGLGENLISTSPROC glad_glGenLists; +PFNGLCOLOR3BVPROC glad_glColor3bv; +PFNGLGETTEXGENDVPROC glad_glGetTexGendv; +PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +PFNGLENDLISTPROC glad_glEndList; +PFNGLCOLOR3USVPROC glad_glColor3usv; +PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv; +PFNGLCLIPPLANEFPROC glad_glClipPlanef; +PFNGLINDEXMASKPROC glad_glIndexMask; +PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib; +PFNGLSHADERSOURCEPROC glad_glShaderSource; +PFNGLCLEARACCUMPROC glad_glClearAccum; +PFNGLUNIFORM2FPROC glad_glUniform2f; +PFNGLBEGINQUERYPROC glad_glBeginQuery; +PFNGLBINDBUFFERPROC glad_glBindBuffer; +PFNGLMAP2DPROC glad_glMap2d; +PFNGLMAP2FPROC glad_glMap2f; +PFNGLVERTEX4DPROC glad_glVertex4d; +PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv; +PFNGLBUFFERDATAPROC glad_glBufferData; +PFNGLEVALPOINT1PROC glad_glEvalPoint1; +PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv; +PFNGLGETERRORPROC glad_glGetError; +PFNGLGETTEXENVIVPROC glad_glGetTexEnviv; +PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +PFNGLGETFLOATVPROC glad_glGetFloatv; +PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv; +PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +PFNGLEVALCOORD1DPROC glad_glEvalCoord1d; +PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +PFNGLEVALCOORD1FPROC glad_glEvalCoord1f; +PFNGLPIXELMAPFVPROC glad_glPixelMapfv; +PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv; +PFNGLGETINTEGERVPROC glad_glGetIntegerv; +PFNGLACCUMPROC glad_glAccum; +PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv; +PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv; +PFNGLISQUERYPROC glad_glIsQuery; +PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv; +PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +PFNGLSTENCILMASKPROC glad_glStencilMask; +PFNGLLOADMATRIXXPROC glad_glLoadMatrixx; +PFNGLDRAWPIXELSPROC glad_glDrawPixels; +PFNGLMULTMATRIXDPROC glad_glMultMatrixd; +PFNGLMULTMATRIXFPROC glad_glMultMatrixf; +PFNGLISTEXTUREPROC glad_glIsTexture; +PFNGLGETMATERIALIVPROC glad_glGetMaterialiv; +PFNGLUNIFORM1FVPROC glad_glUniform1fv; +PFNGLLOADMATRIXFPROC glad_glLoadMatrixf; +PFNGLLOADMATRIXDPROC glad_glLoadMatrixd; +PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +PFNGLVERTEX4FPROC glad_glVertex4f; +PFNGLRECTSVPROC glad_glRectsv; +PFNGLCOLOR4USVPROC glad_glColor4usv; +PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple; +PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays; +PFNGLNORMAL3IPROC glad_glNormal3i; +PFNGLNORMAL3FPROC glad_glNormal3f; +PFNGLNORMAL3DPROC glad_glNormal3d; +PFNGLNORMAL3BPROC glad_glNormal3b; +PFNGLPIXELMAPUSVPROC glad_glPixelMapusv; +PFNGLTEXPARAMETERXVPROC glad_glTexParameterxv; +PFNGLGETTEXGENIVPROC glad_glGetTexGeniv; +PFNGLARRAYELEMENTPROC glad_glArrayElement; +PFNGLCLIPPLANEXPROC glad_glClipPlanex; +PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +PFNGLDEPTHMASKPROC glad_glDepthMask; +PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +PFNGLCOLOR3FVPROC glad_glColor3fv; +PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +PFNGLUNIFORM4FVPROC glad_glUniform4fv; +PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +PFNGLCOLORPOINTERPROC glad_glColorPointer; +PFNGLFRONTFACEPROC glad_glFrontFace; +int GLAD_GL_EXT_framebuffer_object; +int GLAD_GL_ARB_texture_rectangle; +int GLAD_GL_SGIS_fog_function; +int GLAD_GL_EXT_fog_coord; +int GLAD_GL_SGIX_fog_offset; +int GLAD_GL_EXT_texture_filter_anisotropic; +int GLAD_GL_NV_multisample_filter_hint; +int GLAD_GL_ARB_buffer_storage; +int GLAD_GL_ARB_map_buffer_range; +int GLAD_GL_NV_fog_distance; +int GLAD_GL_EXT_texture_compression_s3tc; +int GLAD_GL_ARB_debug_output; +PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; +PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; +PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; +PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; +PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; +PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; +PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; +PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; +PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; +PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; +PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; +PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; +PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; +PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; +PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; +PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; +PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; +PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; +PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; +static void load_GL_VERSION_1_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_0) return; + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); + glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); + glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); + glad_glNewList = (PFNGLNEWLISTPROC)load("glNewList"); + glad_glEndList = (PFNGLENDLISTPROC)load("glEndList"); + glad_glCallList = (PFNGLCALLLISTPROC)load("glCallList"); + glad_glCallLists = (PFNGLCALLLISTSPROC)load("glCallLists"); + glad_glDeleteLists = (PFNGLDELETELISTSPROC)load("glDeleteLists"); + glad_glGenLists = (PFNGLGENLISTSPROC)load("glGenLists"); + glad_glListBase = (PFNGLLISTBASEPROC)load("glListBase"); + glad_glBegin = (PFNGLBEGINPROC)load("glBegin"); + glad_glBitmap = (PFNGLBITMAPPROC)load("glBitmap"); + glad_glColor3b = (PFNGLCOLOR3BPROC)load("glColor3b"); + glad_glColor3bv = (PFNGLCOLOR3BVPROC)load("glColor3bv"); + glad_glColor3d = (PFNGLCOLOR3DPROC)load("glColor3d"); + glad_glColor3dv = (PFNGLCOLOR3DVPROC)load("glColor3dv"); + glad_glColor3f = (PFNGLCOLOR3FPROC)load("glColor3f"); + glad_glColor3fv = (PFNGLCOLOR3FVPROC)load("glColor3fv"); + glad_glColor3i = (PFNGLCOLOR3IPROC)load("glColor3i"); + glad_glColor3iv = (PFNGLCOLOR3IVPROC)load("glColor3iv"); + glad_glColor3s = (PFNGLCOLOR3SPROC)load("glColor3s"); + glad_glColor3sv = (PFNGLCOLOR3SVPROC)load("glColor3sv"); + glad_glColor3ub = (PFNGLCOLOR3UBPROC)load("glColor3ub"); + glad_glColor3ubv = (PFNGLCOLOR3UBVPROC)load("glColor3ubv"); + glad_glColor3ui = (PFNGLCOLOR3UIPROC)load("glColor3ui"); + glad_glColor3uiv = (PFNGLCOLOR3UIVPROC)load("glColor3uiv"); + glad_glColor3us = (PFNGLCOLOR3USPROC)load("glColor3us"); + glad_glColor3usv = (PFNGLCOLOR3USVPROC)load("glColor3usv"); + glad_glColor4b = (PFNGLCOLOR4BPROC)load("glColor4b"); + glad_glColor4bv = (PFNGLCOLOR4BVPROC)load("glColor4bv"); + glad_glColor4d = (PFNGLCOLOR4DPROC)load("glColor4d"); + glad_glColor4dv = (PFNGLCOLOR4DVPROC)load("glColor4dv"); + glad_glColor4f = (PFNGLCOLOR4FPROC)load("glColor4f"); + glad_glColor4fv = (PFNGLCOLOR4FVPROC)load("glColor4fv"); + glad_glColor4i = (PFNGLCOLOR4IPROC)load("glColor4i"); + glad_glColor4iv = (PFNGLCOLOR4IVPROC)load("glColor4iv"); + glad_glColor4s = (PFNGLCOLOR4SPROC)load("glColor4s"); + glad_glColor4sv = (PFNGLCOLOR4SVPROC)load("glColor4sv"); + glad_glColor4ub = (PFNGLCOLOR4UBPROC)load("glColor4ub"); + glad_glColor4ubv = (PFNGLCOLOR4UBVPROC)load("glColor4ubv"); + glad_glColor4ui = (PFNGLCOLOR4UIPROC)load("glColor4ui"); + glad_glColor4uiv = (PFNGLCOLOR4UIVPROC)load("glColor4uiv"); + glad_glColor4us = (PFNGLCOLOR4USPROC)load("glColor4us"); + glad_glColor4usv = (PFNGLCOLOR4USVPROC)load("glColor4usv"); + glad_glEdgeFlag = (PFNGLEDGEFLAGPROC)load("glEdgeFlag"); + glad_glEdgeFlagv = (PFNGLEDGEFLAGVPROC)load("glEdgeFlagv"); + glad_glEnd = (PFNGLENDPROC)load("glEnd"); + glad_glIndexd = (PFNGLINDEXDPROC)load("glIndexd"); + glad_glIndexdv = (PFNGLINDEXDVPROC)load("glIndexdv"); + glad_glIndexf = (PFNGLINDEXFPROC)load("glIndexf"); + glad_glIndexfv = (PFNGLINDEXFVPROC)load("glIndexfv"); + glad_glIndexi = (PFNGLINDEXIPROC)load("glIndexi"); + glad_glIndexiv = (PFNGLINDEXIVPROC)load("glIndexiv"); + glad_glIndexs = (PFNGLINDEXSPROC)load("glIndexs"); + glad_glIndexsv = (PFNGLINDEXSVPROC)load("glIndexsv"); + glad_glNormal3b = (PFNGLNORMAL3BPROC)load("glNormal3b"); + glad_glNormal3bv = (PFNGLNORMAL3BVPROC)load("glNormal3bv"); + glad_glNormal3d = (PFNGLNORMAL3DPROC)load("glNormal3d"); + glad_glNormal3dv = (PFNGLNORMAL3DVPROC)load("glNormal3dv"); + glad_glNormal3f = (PFNGLNORMAL3FPROC)load("glNormal3f"); + glad_glNormal3fv = (PFNGLNORMAL3FVPROC)load("glNormal3fv"); + glad_glNormal3i = (PFNGLNORMAL3IPROC)load("glNormal3i"); + glad_glNormal3iv = (PFNGLNORMAL3IVPROC)load("glNormal3iv"); + glad_glNormal3s = (PFNGLNORMAL3SPROC)load("glNormal3s"); + glad_glNormal3sv = (PFNGLNORMAL3SVPROC)load("glNormal3sv"); + glad_glRasterPos2d = (PFNGLRASTERPOS2DPROC)load("glRasterPos2d"); + glad_glRasterPos2dv = (PFNGLRASTERPOS2DVPROC)load("glRasterPos2dv"); + glad_glRasterPos2f = (PFNGLRASTERPOS2FPROC)load("glRasterPos2f"); + glad_glRasterPos2fv = (PFNGLRASTERPOS2FVPROC)load("glRasterPos2fv"); + glad_glRasterPos2i = (PFNGLRASTERPOS2IPROC)load("glRasterPos2i"); + glad_glRasterPos2iv = (PFNGLRASTERPOS2IVPROC)load("glRasterPos2iv"); + glad_glRasterPos2s = (PFNGLRASTERPOS2SPROC)load("glRasterPos2s"); + glad_glRasterPos2sv = (PFNGLRASTERPOS2SVPROC)load("glRasterPos2sv"); + glad_glRasterPos3d = (PFNGLRASTERPOS3DPROC)load("glRasterPos3d"); + glad_glRasterPos3dv = (PFNGLRASTERPOS3DVPROC)load("glRasterPos3dv"); + glad_glRasterPos3f = (PFNGLRASTERPOS3FPROC)load("glRasterPos3f"); + glad_glRasterPos3fv = (PFNGLRASTERPOS3FVPROC)load("glRasterPos3fv"); + glad_glRasterPos3i = (PFNGLRASTERPOS3IPROC)load("glRasterPos3i"); + glad_glRasterPos3iv = (PFNGLRASTERPOS3IVPROC)load("glRasterPos3iv"); + glad_glRasterPos3s = (PFNGLRASTERPOS3SPROC)load("glRasterPos3s"); + glad_glRasterPos3sv = (PFNGLRASTERPOS3SVPROC)load("glRasterPos3sv"); + glad_glRasterPos4d = (PFNGLRASTERPOS4DPROC)load("glRasterPos4d"); + glad_glRasterPos4dv = (PFNGLRASTERPOS4DVPROC)load("glRasterPos4dv"); + glad_glRasterPos4f = (PFNGLRASTERPOS4FPROC)load("glRasterPos4f"); + glad_glRasterPos4fv = (PFNGLRASTERPOS4FVPROC)load("glRasterPos4fv"); + glad_glRasterPos4i = (PFNGLRASTERPOS4IPROC)load("glRasterPos4i"); + glad_glRasterPos4iv = (PFNGLRASTERPOS4IVPROC)load("glRasterPos4iv"); + glad_glRasterPos4s = (PFNGLRASTERPOS4SPROC)load("glRasterPos4s"); + glad_glRasterPos4sv = (PFNGLRASTERPOS4SVPROC)load("glRasterPos4sv"); + glad_glRectd = (PFNGLRECTDPROC)load("glRectd"); + glad_glRectdv = (PFNGLRECTDVPROC)load("glRectdv"); + glad_glRectf = (PFNGLRECTFPROC)load("glRectf"); + glad_glRectfv = (PFNGLRECTFVPROC)load("glRectfv"); + glad_glRecti = (PFNGLRECTIPROC)load("glRecti"); + glad_glRectiv = (PFNGLRECTIVPROC)load("glRectiv"); + glad_glRects = (PFNGLRECTSPROC)load("glRects"); + glad_glRectsv = (PFNGLRECTSVPROC)load("glRectsv"); + glad_glTexCoord1d = (PFNGLTEXCOORD1DPROC)load("glTexCoord1d"); + glad_glTexCoord1dv = (PFNGLTEXCOORD1DVPROC)load("glTexCoord1dv"); + glad_glTexCoord1f = (PFNGLTEXCOORD1FPROC)load("glTexCoord1f"); + glad_glTexCoord1fv = (PFNGLTEXCOORD1FVPROC)load("glTexCoord1fv"); + glad_glTexCoord1i = (PFNGLTEXCOORD1IPROC)load("glTexCoord1i"); + glad_glTexCoord1iv = (PFNGLTEXCOORD1IVPROC)load("glTexCoord1iv"); + glad_glTexCoord1s = (PFNGLTEXCOORD1SPROC)load("glTexCoord1s"); + glad_glTexCoord1sv = (PFNGLTEXCOORD1SVPROC)load("glTexCoord1sv"); + glad_glTexCoord2d = (PFNGLTEXCOORD2DPROC)load("glTexCoord2d"); + glad_glTexCoord2dv = (PFNGLTEXCOORD2DVPROC)load("glTexCoord2dv"); + glad_glTexCoord2f = (PFNGLTEXCOORD2FPROC)load("glTexCoord2f"); + glad_glTexCoord2fv = (PFNGLTEXCOORD2FVPROC)load("glTexCoord2fv"); + glad_glTexCoord2i = (PFNGLTEXCOORD2IPROC)load("glTexCoord2i"); + glad_glTexCoord2iv = (PFNGLTEXCOORD2IVPROC)load("glTexCoord2iv"); + glad_glTexCoord2s = (PFNGLTEXCOORD2SPROC)load("glTexCoord2s"); + glad_glTexCoord2sv = (PFNGLTEXCOORD2SVPROC)load("glTexCoord2sv"); + glad_glTexCoord3d = (PFNGLTEXCOORD3DPROC)load("glTexCoord3d"); + glad_glTexCoord3dv = (PFNGLTEXCOORD3DVPROC)load("glTexCoord3dv"); + glad_glTexCoord3f = (PFNGLTEXCOORD3FPROC)load("glTexCoord3f"); + glad_glTexCoord3fv = (PFNGLTEXCOORD3FVPROC)load("glTexCoord3fv"); + glad_glTexCoord3i = (PFNGLTEXCOORD3IPROC)load("glTexCoord3i"); + glad_glTexCoord3iv = (PFNGLTEXCOORD3IVPROC)load("glTexCoord3iv"); + glad_glTexCoord3s = (PFNGLTEXCOORD3SPROC)load("glTexCoord3s"); + glad_glTexCoord3sv = (PFNGLTEXCOORD3SVPROC)load("glTexCoord3sv"); + glad_glTexCoord4d = (PFNGLTEXCOORD4DPROC)load("glTexCoord4d"); + glad_glTexCoord4dv = (PFNGLTEXCOORD4DVPROC)load("glTexCoord4dv"); + glad_glTexCoord4f = (PFNGLTEXCOORD4FPROC)load("glTexCoord4f"); + glad_glTexCoord4fv = (PFNGLTEXCOORD4FVPROC)load("glTexCoord4fv"); + glad_glTexCoord4i = (PFNGLTEXCOORD4IPROC)load("glTexCoord4i"); + glad_glTexCoord4iv = (PFNGLTEXCOORD4IVPROC)load("glTexCoord4iv"); + glad_glTexCoord4s = (PFNGLTEXCOORD4SPROC)load("glTexCoord4s"); + glad_glTexCoord4sv = (PFNGLTEXCOORD4SVPROC)load("glTexCoord4sv"); + glad_glVertex2d = (PFNGLVERTEX2DPROC)load("glVertex2d"); + glad_glVertex2dv = (PFNGLVERTEX2DVPROC)load("glVertex2dv"); + glad_glVertex2f = (PFNGLVERTEX2FPROC)load("glVertex2f"); + glad_glVertex2fv = (PFNGLVERTEX2FVPROC)load("glVertex2fv"); + glad_glVertex2i = (PFNGLVERTEX2IPROC)load("glVertex2i"); + glad_glVertex2iv = (PFNGLVERTEX2IVPROC)load("glVertex2iv"); + glad_glVertex2s = (PFNGLVERTEX2SPROC)load("glVertex2s"); + glad_glVertex2sv = (PFNGLVERTEX2SVPROC)load("glVertex2sv"); + glad_glVertex3d = (PFNGLVERTEX3DPROC)load("glVertex3d"); + glad_glVertex3dv = (PFNGLVERTEX3DVPROC)load("glVertex3dv"); + glad_glVertex3f = (PFNGLVERTEX3FPROC)load("glVertex3f"); + glad_glVertex3fv = (PFNGLVERTEX3FVPROC)load("glVertex3fv"); + glad_glVertex3i = (PFNGLVERTEX3IPROC)load("glVertex3i"); + glad_glVertex3iv = (PFNGLVERTEX3IVPROC)load("glVertex3iv"); + glad_glVertex3s = (PFNGLVERTEX3SPROC)load("glVertex3s"); + glad_glVertex3sv = (PFNGLVERTEX3SVPROC)load("glVertex3sv"); + glad_glVertex4d = (PFNGLVERTEX4DPROC)load("glVertex4d"); + glad_glVertex4dv = (PFNGLVERTEX4DVPROC)load("glVertex4dv"); + glad_glVertex4f = (PFNGLVERTEX4FPROC)load("glVertex4f"); + glad_glVertex4fv = (PFNGLVERTEX4FVPROC)load("glVertex4fv"); + glad_glVertex4i = (PFNGLVERTEX4IPROC)load("glVertex4i"); + glad_glVertex4iv = (PFNGLVERTEX4IVPROC)load("glVertex4iv"); + glad_glVertex4s = (PFNGLVERTEX4SPROC)load("glVertex4s"); + glad_glVertex4sv = (PFNGLVERTEX4SVPROC)load("glVertex4sv"); + glad_glClipPlane = (PFNGLCLIPPLANEPROC)load("glClipPlane"); + glad_glColorMaterial = (PFNGLCOLORMATERIALPROC)load("glColorMaterial"); + glad_glFogf = (PFNGLFOGFPROC)load("glFogf"); + glad_glFogfv = (PFNGLFOGFVPROC)load("glFogfv"); + glad_glFogi = (PFNGLFOGIPROC)load("glFogi"); + glad_glFogiv = (PFNGLFOGIVPROC)load("glFogiv"); + glad_glLightf = (PFNGLLIGHTFPROC)load("glLightf"); + glad_glLightfv = (PFNGLLIGHTFVPROC)load("glLightfv"); + glad_glLighti = (PFNGLLIGHTIPROC)load("glLighti"); + glad_glLightiv = (PFNGLLIGHTIVPROC)load("glLightiv"); + glad_glLightModelf = (PFNGLLIGHTMODELFPROC)load("glLightModelf"); + glad_glLightModelfv = (PFNGLLIGHTMODELFVPROC)load("glLightModelfv"); + glad_glLightModeli = (PFNGLLIGHTMODELIPROC)load("glLightModeli"); + glad_glLightModeliv = (PFNGLLIGHTMODELIVPROC)load("glLightModeliv"); + glad_glLineStipple = (PFNGLLINESTIPPLEPROC)load("glLineStipple"); + glad_glMaterialf = (PFNGLMATERIALFPROC)load("glMaterialf"); + glad_glMaterialfv = (PFNGLMATERIALFVPROC)load("glMaterialfv"); + glad_glMateriali = (PFNGLMATERIALIPROC)load("glMateriali"); + glad_glMaterialiv = (PFNGLMATERIALIVPROC)load("glMaterialiv"); + glad_glPolygonStipple = (PFNGLPOLYGONSTIPPLEPROC)load("glPolygonStipple"); + glad_glShadeModel = (PFNGLSHADEMODELPROC)load("glShadeModel"); + glad_glTexEnvf = (PFNGLTEXENVFPROC)load("glTexEnvf"); + glad_glTexEnvfv = (PFNGLTEXENVFVPROC)load("glTexEnvfv"); + glad_glTexEnvi = (PFNGLTEXENVIPROC)load("glTexEnvi"); + glad_glTexEnviv = (PFNGLTEXENVIVPROC)load("glTexEnviv"); + glad_glTexGend = (PFNGLTEXGENDPROC)load("glTexGend"); + glad_glTexGendv = (PFNGLTEXGENDVPROC)load("glTexGendv"); + glad_glTexGenf = (PFNGLTEXGENFPROC)load("glTexGenf"); + glad_glTexGenfv = (PFNGLTEXGENFVPROC)load("glTexGenfv"); + glad_glTexGeni = (PFNGLTEXGENIPROC)load("glTexGeni"); + glad_glTexGeniv = (PFNGLTEXGENIVPROC)load("glTexGeniv"); + glad_glFeedbackBuffer = (PFNGLFEEDBACKBUFFERPROC)load("glFeedbackBuffer"); + glad_glSelectBuffer = (PFNGLSELECTBUFFERPROC)load("glSelectBuffer"); + glad_glRenderMode = (PFNGLRENDERMODEPROC)load("glRenderMode"); + glad_glInitNames = (PFNGLINITNAMESPROC)load("glInitNames"); + glad_glLoadName = (PFNGLLOADNAMEPROC)load("glLoadName"); + glad_glPassThrough = (PFNGLPASSTHROUGHPROC)load("glPassThrough"); + glad_glPopName = (PFNGLPOPNAMEPROC)load("glPopName"); + glad_glPushName = (PFNGLPUSHNAMEPROC)load("glPushName"); + glad_glClearAccum = (PFNGLCLEARACCUMPROC)load("glClearAccum"); + glad_glClearIndex = (PFNGLCLEARINDEXPROC)load("glClearIndex"); + glad_glIndexMask = (PFNGLINDEXMASKPROC)load("glIndexMask"); + glad_glAccum = (PFNGLACCUMPROC)load("glAccum"); + glad_glPopAttrib = (PFNGLPOPATTRIBPROC)load("glPopAttrib"); + glad_glPushAttrib = (PFNGLPUSHATTRIBPROC)load("glPushAttrib"); + glad_glMap1d = (PFNGLMAP1DPROC)load("glMap1d"); + glad_glMap1f = (PFNGLMAP1FPROC)load("glMap1f"); + glad_glMap2d = (PFNGLMAP2DPROC)load("glMap2d"); + glad_glMap2f = (PFNGLMAP2FPROC)load("glMap2f"); + glad_glMapGrid1d = (PFNGLMAPGRID1DPROC)load("glMapGrid1d"); + glad_glMapGrid1f = (PFNGLMAPGRID1FPROC)load("glMapGrid1f"); + glad_glMapGrid2d = (PFNGLMAPGRID2DPROC)load("glMapGrid2d"); + glad_glMapGrid2f = (PFNGLMAPGRID2FPROC)load("glMapGrid2f"); + glad_glEvalCoord1d = (PFNGLEVALCOORD1DPROC)load("glEvalCoord1d"); + glad_glEvalCoord1dv = (PFNGLEVALCOORD1DVPROC)load("glEvalCoord1dv"); + glad_glEvalCoord1f = (PFNGLEVALCOORD1FPROC)load("glEvalCoord1f"); + glad_glEvalCoord1fv = (PFNGLEVALCOORD1FVPROC)load("glEvalCoord1fv"); + glad_glEvalCoord2d = (PFNGLEVALCOORD2DPROC)load("glEvalCoord2d"); + glad_glEvalCoord2dv = (PFNGLEVALCOORD2DVPROC)load("glEvalCoord2dv"); + glad_glEvalCoord2f = (PFNGLEVALCOORD2FPROC)load("glEvalCoord2f"); + glad_glEvalCoord2fv = (PFNGLEVALCOORD2FVPROC)load("glEvalCoord2fv"); + glad_glEvalMesh1 = (PFNGLEVALMESH1PROC)load("glEvalMesh1"); + glad_glEvalPoint1 = (PFNGLEVALPOINT1PROC)load("glEvalPoint1"); + glad_glEvalMesh2 = (PFNGLEVALMESH2PROC)load("glEvalMesh2"); + glad_glEvalPoint2 = (PFNGLEVALPOINT2PROC)load("glEvalPoint2"); + glad_glAlphaFunc = (PFNGLALPHAFUNCPROC)load("glAlphaFunc"); + glad_glPixelZoom = (PFNGLPIXELZOOMPROC)load("glPixelZoom"); + glad_glPixelTransferf = (PFNGLPIXELTRANSFERFPROC)load("glPixelTransferf"); + glad_glPixelTransferi = (PFNGLPIXELTRANSFERIPROC)load("glPixelTransferi"); + glad_glPixelMapfv = (PFNGLPIXELMAPFVPROC)load("glPixelMapfv"); + glad_glPixelMapuiv = (PFNGLPIXELMAPUIVPROC)load("glPixelMapuiv"); + glad_glPixelMapusv = (PFNGLPIXELMAPUSVPROC)load("glPixelMapusv"); + glad_glCopyPixels = (PFNGLCOPYPIXELSPROC)load("glCopyPixels"); + glad_glDrawPixels = (PFNGLDRAWPIXELSPROC)load("glDrawPixels"); + glad_glGetClipPlane = (PFNGLGETCLIPPLANEPROC)load("glGetClipPlane"); + glad_glGetLightfv = (PFNGLGETLIGHTFVPROC)load("glGetLightfv"); + glad_glGetLightiv = (PFNGLGETLIGHTIVPROC)load("glGetLightiv"); + glad_glGetMapdv = (PFNGLGETMAPDVPROC)load("glGetMapdv"); + glad_glGetMapfv = (PFNGLGETMAPFVPROC)load("glGetMapfv"); + glad_glGetMapiv = (PFNGLGETMAPIVPROC)load("glGetMapiv"); + glad_glGetMaterialfv = (PFNGLGETMATERIALFVPROC)load("glGetMaterialfv"); + glad_glGetMaterialiv = (PFNGLGETMATERIALIVPROC)load("glGetMaterialiv"); + glad_glGetPixelMapfv = (PFNGLGETPIXELMAPFVPROC)load("glGetPixelMapfv"); + glad_glGetPixelMapuiv = (PFNGLGETPIXELMAPUIVPROC)load("glGetPixelMapuiv"); + glad_glGetPixelMapusv = (PFNGLGETPIXELMAPUSVPROC)load("glGetPixelMapusv"); + glad_glGetPolygonStipple = (PFNGLGETPOLYGONSTIPPLEPROC)load("glGetPolygonStipple"); + glad_glGetTexEnvfv = (PFNGLGETTEXENVFVPROC)load("glGetTexEnvfv"); + glad_glGetTexEnviv = (PFNGLGETTEXENVIVPROC)load("glGetTexEnviv"); + glad_glGetTexGendv = (PFNGLGETTEXGENDVPROC)load("glGetTexGendv"); + glad_glGetTexGenfv = (PFNGLGETTEXGENFVPROC)load("glGetTexGenfv"); + glad_glGetTexGeniv = (PFNGLGETTEXGENIVPROC)load("glGetTexGeniv"); + glad_glIsList = (PFNGLISLISTPROC)load("glIsList"); + glad_glFrustum = (PFNGLFRUSTUMPROC)load("glFrustum"); + glad_glLoadIdentity = (PFNGLLOADIDENTITYPROC)load("glLoadIdentity"); + glad_glLoadMatrixf = (PFNGLLOADMATRIXFPROC)load("glLoadMatrixf"); + glad_glLoadMatrixd = (PFNGLLOADMATRIXDPROC)load("glLoadMatrixd"); + glad_glMatrixMode = (PFNGLMATRIXMODEPROC)load("glMatrixMode"); + glad_glMultMatrixf = (PFNGLMULTMATRIXFPROC)load("glMultMatrixf"); + glad_glMultMatrixd = (PFNGLMULTMATRIXDPROC)load("glMultMatrixd"); + glad_glOrtho = (PFNGLORTHOPROC)load("glOrtho"); + glad_glPopMatrix = (PFNGLPOPMATRIXPROC)load("glPopMatrix"); + glad_glPushMatrix = (PFNGLPUSHMATRIXPROC)load("glPushMatrix"); + glad_glRotated = (PFNGLROTATEDPROC)load("glRotated"); + glad_glRotatef = (PFNGLROTATEFPROC)load("glRotatef"); + glad_glScaled = (PFNGLSCALEDPROC)load("glScaled"); + glad_glScalef = (PFNGLSCALEFPROC)load("glScalef"); + glad_glTranslated = (PFNGLTRANSLATEDPROC)load("glTranslated"); + glad_glTranslatef = (PFNGLTRANSLATEFPROC)load("glTranslatef"); +} +static void load_GL_VERSION_1_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_1) return; + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); + glad_glArrayElement = (PFNGLARRAYELEMENTPROC)load("glArrayElement"); + glad_glColorPointer = (PFNGLCOLORPOINTERPROC)load("glColorPointer"); + glad_glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC)load("glDisableClientState"); + glad_glEdgeFlagPointer = (PFNGLEDGEFLAGPOINTERPROC)load("glEdgeFlagPointer"); + glad_glEnableClientState = (PFNGLENABLECLIENTSTATEPROC)load("glEnableClientState"); + glad_glIndexPointer = (PFNGLINDEXPOINTERPROC)load("glIndexPointer"); + glad_glInterleavedArrays = (PFNGLINTERLEAVEDARRAYSPROC)load("glInterleavedArrays"); + glad_glNormalPointer = (PFNGLNORMALPOINTERPROC)load("glNormalPointer"); + glad_glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC)load("glTexCoordPointer"); + glad_glVertexPointer = (PFNGLVERTEXPOINTERPROC)load("glVertexPointer"); + glad_glAreTexturesResident = (PFNGLARETEXTURESRESIDENTPROC)load("glAreTexturesResident"); + glad_glPrioritizeTextures = (PFNGLPRIORITIZETEXTURESPROC)load("glPrioritizeTextures"); + glad_glIndexub = (PFNGLINDEXUBPROC)load("glIndexub"); + glad_glIndexubv = (PFNGLINDEXUBVPROC)load("glIndexubv"); + glad_glPopClientAttrib = (PFNGLPOPCLIENTATTRIBPROC)load("glPopClientAttrib"); + glad_glPushClientAttrib = (PFNGLPUSHCLIENTATTRIBPROC)load("glPushClientAttrib"); +} +static void load_GL_VERSION_1_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_2) return; + glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); + glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); + glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); + glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); +} +static void load_GL_VERSION_1_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_3) return; + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); + glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); + glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); + glad_glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)load("glClientActiveTexture"); + glad_glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)load("glMultiTexCoord1d"); + glad_glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)load("glMultiTexCoord1dv"); + glad_glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)load("glMultiTexCoord1f"); + glad_glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)load("glMultiTexCoord1fv"); + glad_glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)load("glMultiTexCoord1i"); + glad_glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)load("glMultiTexCoord1iv"); + glad_glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)load("glMultiTexCoord1s"); + glad_glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)load("glMultiTexCoord1sv"); + glad_glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)load("glMultiTexCoord2d"); + glad_glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)load("glMultiTexCoord2dv"); + glad_glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)load("glMultiTexCoord2f"); + glad_glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)load("glMultiTexCoord2fv"); + glad_glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)load("glMultiTexCoord2i"); + glad_glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)load("glMultiTexCoord2iv"); + glad_glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)load("glMultiTexCoord2s"); + glad_glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)load("glMultiTexCoord2sv"); + glad_glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)load("glMultiTexCoord3d"); + glad_glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)load("glMultiTexCoord3dv"); + glad_glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)load("glMultiTexCoord3f"); + glad_glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)load("glMultiTexCoord3fv"); + glad_glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)load("glMultiTexCoord3i"); + glad_glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)load("glMultiTexCoord3iv"); + glad_glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)load("glMultiTexCoord3s"); + glad_glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)load("glMultiTexCoord3sv"); + glad_glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)load("glMultiTexCoord4d"); + glad_glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)load("glMultiTexCoord4dv"); + glad_glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)load("glMultiTexCoord4f"); + glad_glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)load("glMultiTexCoord4fv"); + glad_glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)load("glMultiTexCoord4i"); + glad_glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)load("glMultiTexCoord4iv"); + glad_glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)load("glMultiTexCoord4s"); + glad_glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)load("glMultiTexCoord4sv"); + glad_glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)load("glLoadTransposeMatrixf"); + glad_glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)load("glLoadTransposeMatrixd"); + glad_glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)load("glMultTransposeMatrixf"); + glad_glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)load("glMultTransposeMatrixd"); +} +static void load_GL_VERSION_1_4(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_4) return; + glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); + glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); + glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); + glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); + glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); + glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); + glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); + glad_glFogCoordf = (PFNGLFOGCOORDFPROC)load("glFogCoordf"); + glad_glFogCoordfv = (PFNGLFOGCOORDFVPROC)load("glFogCoordfv"); + glad_glFogCoordd = (PFNGLFOGCOORDDPROC)load("glFogCoordd"); + glad_glFogCoorddv = (PFNGLFOGCOORDDVPROC)load("glFogCoorddv"); + glad_glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)load("glFogCoordPointer"); + glad_glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)load("glSecondaryColor3b"); + glad_glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)load("glSecondaryColor3bv"); + glad_glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)load("glSecondaryColor3d"); + glad_glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)load("glSecondaryColor3dv"); + glad_glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)load("glSecondaryColor3f"); + glad_glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)load("glSecondaryColor3fv"); + glad_glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)load("glSecondaryColor3i"); + glad_glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)load("glSecondaryColor3iv"); + glad_glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)load("glSecondaryColor3s"); + glad_glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)load("glSecondaryColor3sv"); + glad_glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)load("glSecondaryColor3ub"); + glad_glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)load("glSecondaryColor3ubv"); + glad_glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)load("glSecondaryColor3ui"); + glad_glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)load("glSecondaryColor3uiv"); + glad_glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)load("glSecondaryColor3us"); + glad_glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)load("glSecondaryColor3usv"); + glad_glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)load("glSecondaryColorPointer"); + glad_glWindowPos2d = (PFNGLWINDOWPOS2DPROC)load("glWindowPos2d"); + glad_glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)load("glWindowPos2dv"); + glad_glWindowPos2f = (PFNGLWINDOWPOS2FPROC)load("glWindowPos2f"); + glad_glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)load("glWindowPos2fv"); + glad_glWindowPos2i = (PFNGLWINDOWPOS2IPROC)load("glWindowPos2i"); + glad_glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)load("glWindowPos2iv"); + glad_glWindowPos2s = (PFNGLWINDOWPOS2SPROC)load("glWindowPos2s"); + glad_glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)load("glWindowPos2sv"); + glad_glWindowPos3d = (PFNGLWINDOWPOS3DPROC)load("glWindowPos3d"); + glad_glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)load("glWindowPos3dv"); + glad_glWindowPos3f = (PFNGLWINDOWPOS3FPROC)load("glWindowPos3f"); + glad_glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)load("glWindowPos3fv"); + glad_glWindowPos3i = (PFNGLWINDOWPOS3IPROC)load("glWindowPos3i"); + glad_glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)load("glWindowPos3iv"); + glad_glWindowPos3s = (PFNGLWINDOWPOS3SPROC)load("glWindowPos3s"); + glad_glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)load("glWindowPos3sv"); + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); +} +static void load_GL_VERSION_1_5(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_5) return; + glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); + glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); + glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); + glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); + glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); + glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); + glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); + glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); + glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); + glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); +} +static void load_GL_VERSION_2_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_0) return; + glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); + glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); + glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); + glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); + glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); + glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); + glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); + glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); + glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); + glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); + glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); + glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); + glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); + glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); + glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); + glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); + glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); + glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); + glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); + glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); + glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); + glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); + glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); + glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); + glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); + glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); + glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); + glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); + glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); + glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); + glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); + glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); + glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); + glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); + glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); + glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); + glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); + glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); + glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); + glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); + glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); + glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); + glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); + glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); + glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); + glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); + glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); + glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); + glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); + glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); + glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); + glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); + glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); + glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); + glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); + glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); + glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); + glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); + glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); + glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); + glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); + glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); + glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); + glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); + glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); + glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); + glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); + glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); + glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); + glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); + glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); + glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); + glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); + glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); + glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); + glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); + glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); + glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); + glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); + glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); + glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); + glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); + glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); + glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); + glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); + glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); + glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); + glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); + glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); + glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); + glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); + glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); + glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); +} +static void load_GL_ARB_buffer_storage(GLADloadproc load) { + if(!GLAD_GL_ARB_buffer_storage) return; + glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); +} +static void load_GL_ARB_debug_output(GLADloadproc load) { + if(!GLAD_GL_ARB_debug_output) return; + glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB"); + glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB"); + glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB"); + glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB"); +} +static void load_GL_ARB_map_buffer_range(GLADloadproc load) { + if(!GLAD_GL_ARB_map_buffer_range) return; + glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); + glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); +} +static void load_GL_EXT_fog_coord(GLADloadproc load) { + if(!GLAD_GL_EXT_fog_coord) return; + glad_glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)load("glFogCoordfEXT"); + glad_glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)load("glFogCoordfvEXT"); + glad_glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)load("glFogCoorddEXT"); + glad_glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)load("glFogCoorddvEXT"); + glad_glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)load("glFogCoordPointerEXT"); +} +static void load_GL_EXT_framebuffer_object(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_object) return; + glad_glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)load("glIsRenderbufferEXT"); + glad_glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)load("glBindRenderbufferEXT"); + glad_glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)load("glDeleteRenderbuffersEXT"); + glad_glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)load("glGenRenderbuffersEXT"); + glad_glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)load("glRenderbufferStorageEXT"); + glad_glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)load("glGetRenderbufferParameterivEXT"); + glad_glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)load("glIsFramebufferEXT"); + glad_glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)load("glBindFramebufferEXT"); + glad_glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)load("glDeleteFramebuffersEXT"); + glad_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)load("glGenFramebuffersEXT"); + glad_glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)load("glCheckFramebufferStatusEXT"); + glad_glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)load("glFramebufferTexture1DEXT"); + glad_glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)load("glFramebufferTexture2DEXT"); + glad_glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)load("glFramebufferTexture3DEXT"); + glad_glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)load("glFramebufferRenderbufferEXT"); + glad_glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetFramebufferAttachmentParameterivEXT"); + glad_glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)load("glGenerateMipmapEXT"); +} +static void load_GL_SGIS_fog_function(GLADloadproc load) { + if(!GLAD_GL_SGIS_fog_function) return; + glad_glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)load("glFogFuncSGIS"); + glad_glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)load("glGetFogFuncSGIS"); +} +static int find_extensionsGL(void) { + if (!get_exts()) return 0; + GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage"); + GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); + GLAD_GL_ARB_map_buffer_range = has_ext("GL_ARB_map_buffer_range"); + GLAD_GL_ARB_texture_rectangle = has_ext("GL_ARB_texture_rectangle"); + GLAD_GL_EXT_fog_coord = has_ext("GL_EXT_fog_coord"); + GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object"); + GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); + GLAD_GL_EXT_texture_filter_anisotropic = has_ext("GL_EXT_texture_filter_anisotropic"); + GLAD_GL_NV_fog_distance = has_ext("GL_NV_fog_distance"); + GLAD_GL_NV_multisample_filter_hint = has_ext("GL_NV_multisample_filter_hint"); + GLAD_GL_SGIS_fog_function = has_ext("GL_SGIS_fog_function"); + GLAD_GL_SGIX_fog_offset = has_ext("GL_SGIX_fog_offset"); + free_exts(); + return 1; +} + +static void find_coreGL(void) { + + /* Thank you @elmindreda + * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 + * https://github.com/glfw/glfw/blob/master/src/context.c#L36 + */ + int i, major, minor; + + const char* version; + const char* prefixes[] = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + NULL + }; + + version = (const char*) glGetString(GL_VERSION); + if (!version) return; + + for (i = 0; prefixes[i]; i++) { + const size_t length = strlen(prefixes[i]); + if (strncmp(version, prefixes[i], length) == 0) { + version += length; + break; + } + } + +/* PR #18 */ +#ifdef _MSC_VER + sscanf_s(version, "%d.%d", &major, &minor); +#else + sscanf(version, "%d.%d", &major, &minor); +#endif + + GLVersion.major = major; GLVersion.minor = minor; + max_loaded_major = major; max_loaded_minor = minor; + GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; + GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; + GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; + GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; + GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; + GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; + GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; + if (GLVersion.major > 2 || (GLVersion.major >= 2 && GLVersion.minor >= 0)) { + max_loaded_major = 2; + max_loaded_minor = 0; + } +} + +int gladLoadGLLoader(GLADloadproc load) { + GLVersion.major = 0; GLVersion.minor = 0; + glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + if(glGetString == NULL) return 0; + if(glGetString(GL_VERSION) == NULL) return 0; + find_coreGL(); + load_GL_VERSION_1_0(load); + load_GL_VERSION_1_1(load); + load_GL_VERSION_1_2(load); + load_GL_VERSION_1_3(load); + load_GL_VERSION_1_4(load); + load_GL_VERSION_1_5(load); + load_GL_VERSION_2_0(load); + + if (!find_extensionsGL()) return 0; + load_GL_ARB_buffer_storage(load); + load_GL_ARB_debug_output(load); + load_GL_ARB_map_buffer_range(load); + load_GL_EXT_fog_coord(load); + load_GL_EXT_framebuffer_object(load); + load_GL_SGIS_fog_function(load); + return GLVersion.major != 0 || GLVersion.minor != 0; +} + +static void load_GL_ES_VERSION_2_0(GLADloadproc load) { + if(!GLAD_GL_ES_VERSION_2_0) return; + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); + glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); + glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); + glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); + glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); + glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); + glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); + glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); + glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); + glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); + glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); + glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); + glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); + glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); + glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); + glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); + glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); + glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); + glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); + glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); + glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); + glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); + glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); + glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); + glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); + glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); + glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); + glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); + glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); + glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); + glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); + glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); + glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); + glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); + glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); + glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); + glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); + glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); + glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); + glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); + glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); + glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); + glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); + glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); + glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); + glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); + glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); + glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); + glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); + glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); + glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); + glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); + glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); + glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); + glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); + glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); + glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); + glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); + glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); + glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); +} +static int find_extensionsGLES2(void) { + if (!get_exts()) return 0; + GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); + GLAD_GL_EXT_texture_filter_anisotropic = has_ext("GL_EXT_texture_filter_anisotropic"); + free_exts(); + return 1; +} + +static void find_coreGLES2(void) { + + /* Thank you @elmindreda + * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 + * https://github.com/glfw/glfw/blob/master/src/context.c#L36 + */ + int i, major, minor; + + const char* version; + const char* prefixes[] = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + NULL + }; + + version = (const char*) glGetString(GL_VERSION); + if (!version) return; + + for (i = 0; prefixes[i]; i++) { + const size_t length = strlen(prefixes[i]); + if (strncmp(version, prefixes[i], length) == 0) { + version += length; + break; + } + } + +/* PR #18 */ +#ifdef _MSC_VER + sscanf_s(version, "%d.%d", &major, &minor); +#else + sscanf(version, "%d.%d", &major, &minor); +#endif + + GLVersion.major = major; GLVersion.minor = minor; + max_loaded_major = major; max_loaded_minor = minor; + GLAD_GL_ES_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; + if (GLVersion.major > 2 || (GLVersion.major >= 2 && GLVersion.minor >= 0)) { + max_loaded_major = 2; + max_loaded_minor = 0; + } +} + +int gladLoadGLES2Loader(GLADloadproc load) { + GLVersion.major = 0; GLVersion.minor = 0; + glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + if(glGetString == NULL) return 0; + if(glGetString(GL_VERSION) == NULL) return 0; + find_coreGLES2(); + load_GL_ES_VERSION_2_0(load); + + if (!find_extensionsGLES2()) return 0; + return GLVersion.major != 0 || GLVersion.minor != 0; +} + +static void load_GL_VERSION_ES_CM_1_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_ES_CM_1_0) return; + glad_glAlphaFunc = (PFNGLALPHAFUNCPROC)load("glAlphaFunc"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); + glad_glClipPlanef = (PFNGLCLIPPLANEFPROC)load("glClipPlanef"); + glad_glColor4f = (PFNGLCOLOR4FPROC)load("glColor4f"); + glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); + glad_glFogf = (PFNGLFOGFPROC)load("glFogf"); + glad_glFogfv = (PFNGLFOGFVPROC)load("glFogfv"); + glad_glFrustumf = (PFNGLFRUSTUMFPROC)load("glFrustumf"); + glad_glGetClipPlanef = (PFNGLGETCLIPPLANEFPROC)load("glGetClipPlanef"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetLightfv = (PFNGLGETLIGHTFVPROC)load("glGetLightfv"); + glad_glGetMaterialfv = (PFNGLGETMATERIALFVPROC)load("glGetMaterialfv"); + glad_glGetTexEnvfv = (PFNGLGETTEXENVFVPROC)load("glGetTexEnvfv"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glLightModelf = (PFNGLLIGHTMODELFPROC)load("glLightModelf"); + glad_glLightModelfv = (PFNGLLIGHTMODELFVPROC)load("glLightModelfv"); + glad_glLightf = (PFNGLLIGHTFPROC)load("glLightf"); + glad_glLightfv = (PFNGLLIGHTFVPROC)load("glLightfv"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glLoadMatrixf = (PFNGLLOADMATRIXFPROC)load("glLoadMatrixf"); + glad_glMaterialf = (PFNGLMATERIALFPROC)load("glMaterialf"); + glad_glMaterialfv = (PFNGLMATERIALFVPROC)load("glMaterialfv"); + glad_glMultMatrixf = (PFNGLMULTMATRIXFPROC)load("glMultMatrixf"); + glad_glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)load("glMultiTexCoord4f"); + glad_glNormal3f = (PFNGLNORMAL3FPROC)load("glNormal3f"); + glad_glOrthof = (PFNGLORTHOFPROC)load("glOrthof"); + glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); + glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); + glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glRotatef = (PFNGLROTATEFPROC)load("glRotatef"); + glad_glScalef = (PFNGLSCALEFPROC)load("glScalef"); + glad_glTexEnvf = (PFNGLTEXENVFPROC)load("glTexEnvf"); + glad_glTexEnvfv = (PFNGLTEXENVFVPROC)load("glTexEnvfv"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTranslatef = (PFNGLTRANSLATEFPROC)load("glTranslatef"); + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glAlphaFuncx = (PFNGLALPHAFUNCXPROC)load("glAlphaFuncx"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColorx = (PFNGLCLEARCOLORXPROC)load("glClearColorx"); + glad_glClearDepthx = (PFNGLCLEARDEPTHXPROC)load("glClearDepthx"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)load("glClientActiveTexture"); + glad_glClipPlanex = (PFNGLCLIPPLANEXPROC)load("glClipPlanex"); + glad_glColor4ub = (PFNGLCOLOR4UBPROC)load("glColor4ub"); + glad_glColor4x = (PFNGLCOLOR4XPROC)load("glColor4x"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glColorPointer = (PFNGLCOLORPOINTERPROC)load("glColorPointer"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDepthRangex = (PFNGLDEPTHRANGEXPROC)load("glDepthRangex"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC)load("glDisableClientState"); + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glEnableClientState = (PFNGLENABLECLIENTSTATEPROC)load("glEnableClientState"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glFogx = (PFNGLFOGXPROC)load("glFogx"); + glad_glFogxv = (PFNGLFOGXVPROC)load("glFogxv"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glFrustumx = (PFNGLFRUSTUMXPROC)load("glFrustumx"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetClipPlanex = (PFNGLGETCLIPPLANEXPROC)load("glGetClipPlanex"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFixedv = (PFNGLGETFIXEDVPROC)load("glGetFixedv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetLightxv = (PFNGLGETLIGHTXVPROC)load("glGetLightxv"); + glad_glGetMaterialxv = (PFNGLGETMATERIALXVPROC)load("glGetMaterialxv"); + glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexEnviv = (PFNGLGETTEXENVIVPROC)load("glGetTexEnviv"); + glad_glGetTexEnvxv = (PFNGLGETTEXENVXVPROC)load("glGetTexEnvxv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetTexParameterxv = (PFNGLGETTEXPARAMETERXVPROC)load("glGetTexParameterxv"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); + glad_glLightModelx = (PFNGLLIGHTMODELXPROC)load("glLightModelx"); + glad_glLightModelxv = (PFNGLLIGHTMODELXVPROC)load("glLightModelxv"); + glad_glLightx = (PFNGLLIGHTXPROC)load("glLightx"); + glad_glLightxv = (PFNGLLIGHTXVPROC)load("glLightxv"); + glad_glLineWidthx = (PFNGLLINEWIDTHXPROC)load("glLineWidthx"); + glad_glLoadIdentity = (PFNGLLOADIDENTITYPROC)load("glLoadIdentity"); + glad_glLoadMatrixx = (PFNGLLOADMATRIXXPROC)load("glLoadMatrixx"); + glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); + glad_glMaterialx = (PFNGLMATERIALXPROC)load("glMaterialx"); + glad_glMaterialxv = (PFNGLMATERIALXVPROC)load("glMaterialxv"); + glad_glMatrixMode = (PFNGLMATRIXMODEPROC)load("glMatrixMode"); + glad_glMultMatrixx = (PFNGLMULTMATRIXXPROC)load("glMultMatrixx"); + glad_glMultiTexCoord4x = (PFNGLMULTITEXCOORD4XPROC)load("glMultiTexCoord4x"); + glad_glNormal3x = (PFNGLNORMAL3XPROC)load("glNormal3x"); + glad_glNormalPointer = (PFNGLNORMALPOINTERPROC)load("glNormalPointer"); + glad_glOrthox = (PFNGLORTHOXPROC)load("glOrthox"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glPointParameterx = (PFNGLPOINTPARAMETERXPROC)load("glPointParameterx"); + glad_glPointParameterxv = (PFNGLPOINTPARAMETERXVPROC)load("glPointParameterxv"); + glad_glPointSizex = (PFNGLPOINTSIZEXPROC)load("glPointSizex"); + glad_glPolygonOffsetx = (PFNGLPOLYGONOFFSETXPROC)load("glPolygonOffsetx"); + glad_glPopMatrix = (PFNGLPOPMATRIXPROC)load("glPopMatrix"); + glad_glPushMatrix = (PFNGLPUSHMATRIXPROC)load("glPushMatrix"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glRotatex = (PFNGLROTATEXPROC)load("glRotatex"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glSampleCoveragex = (PFNGLSAMPLECOVERAGEXPROC)load("glSampleCoveragex"); + glad_glScalex = (PFNGLSCALEXPROC)load("glScalex"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glShadeModel = (PFNGLSHADEMODELPROC)load("glShadeModel"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC)load("glTexCoordPointer"); + glad_glTexEnvi = (PFNGLTEXENVIPROC)load("glTexEnvi"); + glad_glTexEnvx = (PFNGLTEXENVXPROC)load("glTexEnvx"); + glad_glTexEnviv = (PFNGLTEXENVIVPROC)load("glTexEnviv"); + glad_glTexEnvxv = (PFNGLTEXENVXVPROC)load("glTexEnvxv"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameterx = (PFNGLTEXPARAMETERXPROC)load("glTexParameterx"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexParameterxv = (PFNGLTEXPARAMETERXVPROC)load("glTexParameterxv"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glTranslatex = (PFNGLTRANSLATEXPROC)load("glTranslatex"); + glad_glVertexPointer = (PFNGLVERTEXPOINTERPROC)load("glVertexPointer"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); +} +static int find_extensionsGLES1(void) { + if (!get_exts()) return 0; + GLAD_GL_EXT_texture_filter_anisotropic = has_ext("GL_EXT_texture_filter_anisotropic"); + free_exts(); + return 1; +} + +static void find_coreGLES1(void) { + + /* Thank you @elmindreda + * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 + * https://github.com/glfw/glfw/blob/master/src/context.c#L36 + */ + int i, major, minor; + + const char* version; + const char* prefixes[] = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + NULL + }; + + version = (const char*) glGetString(GL_VERSION); + if (!version) return; + + for (i = 0; prefixes[i]; i++) { + const size_t length = strlen(prefixes[i]); + if (strncmp(version, prefixes[i], length) == 0) { + version += length; + break; + } + } + +/* PR #18 */ +#ifdef _MSC_VER + sscanf_s(version, "%d.%d", &major, &minor); +#else + sscanf(version, "%d.%d", &major, &minor); +#endif + + GLVersion.major = major; GLVersion.minor = minor; + max_loaded_major = major; max_loaded_minor = minor; + GLAD_GL_VERSION_ES_CM_1_0 = (major == 1 && minor >= 0) || major > 1; + if (GLVersion.major > 1 || (GLVersion.major >= 1 && GLVersion.minor >= 0)) { + max_loaded_major = 1; + max_loaded_minor = 0; + } +} + +int gladLoadGLES1Loader(GLADloadproc load) { + GLVersion.major = 0; GLVersion.minor = 0; + glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + if(glGetString == NULL) return 0; + if(glGetString(GL_VERSION) == NULL) return 0; + find_coreGLES1(); + load_GL_VERSION_ES_CM_1_0(load); + + if (!find_extensionsGLES1()) return 0; + return GLVersion.major != 0 || GLVersion.minor != 0; +} + diff --git a/source/glad/src/glad_wgl.c b/source/glad/src/glad_wgl.c new file mode 100644 index 000000000..4ea2ea276 --- /dev/null +++ b/source/glad/src/glad_wgl.c @@ -0,0 +1,250 @@ +/* + + WGL loader generated by glad 0.1.16a0 on Sat Jan 27 08:40:53 2018. + + Language/Generator: C/C++ + Specification: wgl + APIs: wgl=1.0 + Profile: - + Extensions: + WGL_ARB_create_context, + WGL_ARB_create_context_profile, + WGL_ARB_extensions_string, + WGL_ARB_pixel_format, + WGL_EXT_extensions_string, + WGL_EXT_swap_control + Loader: True + Local files: False + Omit khrplatform: False + + Commandline: + --api="wgl=1.0" --generator="c" --spec="wgl" --extensions="WGL_ARB_create_context,WGL_ARB_create_context_profile,WGL_ARB_extensions_string,WGL_ARB_pixel_format,WGL_EXT_extensions_string,WGL_EXT_swap_control" + Online: + http://glad.dav1d.de/#language=c&specification=wgl&loader=on&api=wgl%3D1.0&extensions=WGL_ARB_create_context&extensions=WGL_ARB_create_context_profile&extensions=WGL_ARB_extensions_string&extensions=WGL_ARB_pixel_format&extensions=WGL_EXT_extensions_string&extensions=WGL_EXT_swap_control +*/ + +#include +#include +#include +#include + +static void* get_proc(const char *namez); + +#ifdef _WIN32 +#include +static HMODULE libGL; + +typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*); +static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; + +static +int open_gl(void) { + libGL = LoadLibraryW(L"opengl32.dll"); + if(libGL != NULL) { + gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress( + libGL, "wglGetProcAddress"); + return gladGetProcAddressPtr != NULL; + } + + return 0; +} + +static +void close_gl(void) { + if(libGL != NULL) { + FreeLibrary(libGL); + libGL = NULL; + } +} +#else +#include +static void* libGL; + +#ifndef __APPLE__ +typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*); +static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; +#endif + +static +int open_gl(void) { +#ifdef __APPLE__ + static const char *NAMES[] = { + "../Frameworks/OpenGL.framework/OpenGL", + "/Library/Frameworks/OpenGL.framework/OpenGL", + "/System/Library/Frameworks/OpenGL.framework/OpenGL", + "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL" + }; +#else + static const char *NAMES[] = {"libGL.so.1", "libGL.so"}; +#endif + + unsigned int index = 0; + for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) { + libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL); + + if(libGL != NULL) { +#ifdef __APPLE__ + return 1; +#else + gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL, + "glXGetProcAddressARB"); + return gladGetProcAddressPtr != NULL; +#endif + } + } + + return 0; +} + +static +void close_gl(void) { + if(libGL != NULL) { + dlclose(libGL); + libGL = NULL; + } +} +#endif + +static +void* get_proc(const char *namez) { + void* result = NULL; + if(libGL == NULL) return NULL; + +#ifndef __APPLE__ + if(gladGetProcAddressPtr != NULL) { + result = gladGetProcAddressPtr(namez); + } +#endif + if(result == NULL) { +#ifdef _WIN32 + result = (void*)GetProcAddress(libGL, namez); +#else + result = dlsym(libGL, namez); +#endif + } + + return result; +} + +int gladLoadWGL(HDC hdc) { + int status = 0; + + if(open_gl()) { + status = gladLoadWGLLoader((GLADloadproc)get_proc, hdc); + close_gl(); + } + + return status; +} + +static HDC GLADWGLhdc = (HDC)INVALID_HANDLE_VALUE; + +static int get_exts(void) { + return 1; +} + +static void free_exts(void) { + return; +} + +static int has_ext(const char *ext) { + const char *terminator; + const char *loc; + const char *extensions; + + if(wglGetExtensionsStringEXT == NULL && wglGetExtensionsStringARB == NULL) + return 0; + + if(wglGetExtensionsStringARB == NULL || GLADWGLhdc == INVALID_HANDLE_VALUE) + extensions = wglGetExtensionsStringEXT(); + else + extensions = wglGetExtensionsStringARB(GLADWGLhdc); + + if(extensions == NULL || ext == NULL) + return 0; + + while(1) { + loc = strstr(extensions, ext); + if(loc == NULL) + break; + + terminator = loc + strlen(ext); + if((loc == extensions || *(loc - 1) == ' ') && + (*terminator == ' ' || *terminator == '\0')) + { + return 1; + } + extensions = terminator; + } + + return 0; +} +int GLAD_WGL_VERSION_1_0; +int GLAD_WGL_EXT_swap_control; +int GLAD_WGL_ARB_pixel_format; +int GLAD_WGL_ARB_create_context_profile; +int GLAD_WGL_ARB_create_context; +int GLAD_WGL_ARB_extensions_string; +int GLAD_WGL_EXT_extensions_string; +PFNWGLCREATECONTEXTATTRIBSARBPROC glad_wglCreateContextAttribsARB; +PFNWGLGETEXTENSIONSSTRINGARBPROC glad_wglGetExtensionsStringARB; +PFNWGLGETPIXELFORMATATTRIBIVARBPROC glad_wglGetPixelFormatAttribivARB; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC glad_wglGetPixelFormatAttribfvARB; +PFNWGLCHOOSEPIXELFORMATARBPROC glad_wglChoosePixelFormatARB; +PFNWGLGETEXTENSIONSSTRINGEXTPROC glad_wglGetExtensionsStringEXT; +PFNWGLSWAPINTERVALEXTPROC glad_wglSwapIntervalEXT; +PFNWGLGETSWAPINTERVALEXTPROC glad_wglGetSwapIntervalEXT; +static void load_WGL_ARB_create_context(GLADloadproc load) { + if(!GLAD_WGL_ARB_create_context) return; + glad_wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)load("wglCreateContextAttribsARB"); +} +static void load_WGL_ARB_extensions_string(GLADloadproc load) { + if(!GLAD_WGL_ARB_extensions_string) return; + glad_wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)load("wglGetExtensionsStringARB"); +} +static void load_WGL_ARB_pixel_format(GLADloadproc load) { + if(!GLAD_WGL_ARB_pixel_format) return; + glad_wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)load("wglGetPixelFormatAttribivARB"); + glad_wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)load("wglGetPixelFormatAttribfvARB"); + glad_wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)load("wglChoosePixelFormatARB"); +} +static void load_WGL_EXT_extensions_string(GLADloadproc load) { + if(!GLAD_WGL_EXT_extensions_string) return; + glad_wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)load("wglGetExtensionsStringEXT"); +} +static void load_WGL_EXT_swap_control(GLADloadproc load) { + if(!GLAD_WGL_EXT_swap_control) return; + glad_wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)load("wglSwapIntervalEXT"); + glad_wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)load("wglGetSwapIntervalEXT"); +} +static int find_extensionsWGL(void) { + if (!get_exts()) return 0; + GLAD_WGL_ARB_create_context = has_ext("WGL_ARB_create_context"); + GLAD_WGL_ARB_create_context_profile = has_ext("WGL_ARB_create_context_profile"); + GLAD_WGL_ARB_extensions_string = has_ext("WGL_ARB_extensions_string"); + GLAD_WGL_ARB_pixel_format = has_ext("WGL_ARB_pixel_format"); + GLAD_WGL_EXT_extensions_string = has_ext("WGL_EXT_extensions_string"); + GLAD_WGL_EXT_swap_control = has_ext("WGL_EXT_swap_control"); + free_exts(); + return 1; +} + +static void find_coreWGL(HDC hdc) { + GLADWGLhdc = hdc; +} + +int gladLoadWGLLoader(GLADloadproc load, HDC hdc) { + wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)load("wglGetExtensionsStringARB"); + wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)load("wglGetExtensionsStringEXT"); + if(wglGetExtensionsStringARB == NULL && wglGetExtensionsStringEXT == NULL) return 0; + find_coreWGL(hdc); + + if (!find_extensionsWGL()) return 0; + load_WGL_ARB_create_context(load); + load_WGL_ARB_extensions_string(load); + load_WGL_ARB_pixel_format(load); + load_WGL_EXT_extensions_string(load); + load_WGL_EXT_swap_control(load); + return 1; +} + diff --git a/source/tools/src/md2tool.cpp b/source/tools/src/md2tool.cpp index ad962d9c7..47fbe32a4 100644 --- a/source/tools/src/md2tool.cpp +++ b/source/tools/src/md2tool.cpp @@ -1,7 +1,7 @@ #include "compat.h" #include "build.h" -#include "glbuild.h" +#include "glad/glad.h" #include "mdsprite.h"