#include <../arch/arch.h>

#ifdef	ARCH_WINDOWING_SUPPORTED

#define	LGLTRACE(name) \
	if(flag) \
		conlPrintf(LOG_TRACE,"\tExtension %s loaded.\n",#name); \
	else \
		conlPrintf(LOG_TRACE,"\tExtension %s NOT loaded.\n",#name);

#define	EXTTRACE(name) \
	if(HAVE_EXT(name)) \
		conlPrintf(LOG_TRACE,"\tExtension %s present.\n",#name); \
	else \
		conlPrintf(LOG_TRACE,"\tExtension %s NOT present.\n",#name);
			
#define HAVE_EXT(name) \
	strstr((const char*)glGetString(GL_EXTENSIONS),#name)

#ifdef	DLL_TARGET_DCC

/* mangle pointers */
#define	GLPTR(name) GLPROC_##name

/* pointers have to be local */
#define	GLPTR_LNK static

#define	LGLP(name) \
	(flag = flag && (*vgl_load_proc)(#name,(void**)(&GLPROC_##name),terminate))

#define	RGLP(name) \
	if(GLPROC_##name != NULL) \
		*terminate = true; \
	GLPROC_##name = NULL

#else	/* !DLL_TARGET_DCC */

#define	GLPTR(name) name

#define	LGLP(name) \
	(flag = flag && vgl_load_proc(#name,(void**)(&name),terminate))

#define	RGLP(name) \
	if(name != NULL) \
		*terminate = true; \
	name = NULL

/* pointers have to be global */
#define	GLPTR_LNK

#endif	/* !BUILD_LIBV_DLL */

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * OpenGL 1.1.
 */

#ifdef	BASEGL11_DYNAMIC

#ifdef	DLL_TARGET_DCC

#define	LBGLP(name) \
	(flag = flag && (*vgl_load_base_proc)(#name,(void**)(&GLPROC_##name),terminate))

#define	RGLP(name) \
	if(GLPROC_##name != NULL) \
		*terminate = true; \
	GLPROC_##name = NULL

#else	/* !DLL_TARGET_DCC */

#define	LGLP(name) \
	(flag = flag && vgl_load_base_proc(#name,(void**)(&name),terminate))

#define	RGLP(name) \
	if(name != NULL) \
		*terminate = true; \
	name = NULL

#endif	/* !BUILD_LIBV_DLL */

/*
 * TODO:
 */

GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(procname)) (GLenum);

#ifdef	DLL_TARGET_DCC

/* GL_ARB_multitexture */
VGLEXTAPI void VGLEXTAPIENTRY procname (GLenum arg)
{
	(*GLPTR(procname))(arg);
}

#endif	/* DLL_TARGET_DCC */

#endif	/* BASEGL11_DYNAMIC */

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * ARB extensions.
 */

/* GL_ARB_multitexture */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glActiveTextureARB)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glClientActiveTextureARB)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1dARB)) (GLenum, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1dvARB)) (GLenum, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1fARB)) (GLenum, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1fvARB)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1iARB)) (GLenum, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1ivARB)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1sARB)) (GLenum, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1svARB)) (GLenum, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2dARB)) (GLenum, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2dvARB)) (GLenum, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2fARB)) (GLenum, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2fvARB)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2iARB)) (GLenum, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2ivARB)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2sARB)) (GLenum, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2svARB)) (GLenum, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3dARB)) (GLenum, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3dvARB)) (GLenum, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3fARB)) (GLenum, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3fvARB)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3iARB)) (GLenum, GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3ivARB)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3sARB)) (GLenum, GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3svARB)) (GLenum, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4dARB)) (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4dvARB)) (GLenum, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4fARB)) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4fvARB)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4iARB)) (GLenum, GLint, GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4ivARB)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4sARB)) (GLenum, GLshort, GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4svARB)) (GLenum, const GLshort *);
/* ARB_texture_compression */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexImage3DARB)) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexImage2DARB)) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexImage1DARB)) (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexSubImage3DARB)) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexSubImage2DARB)) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexSubImage1DARB)) (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetCompressedTexImageARB)) (GLenum, GLint, GLvoid *);
/* ARB_multisample */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSampleCoverageARB)) (GLclampf, GLboolean);
/* ARB_transpose_matrix */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glLoadTransposeMatrixfARB)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glLoadTransposeMatrixdARB)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultTransposeMatrixfARB)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultTransposeMatrixdARB)) (const GLdouble *);
/* ARB_point_parameters */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glPointParameterfARB)) (GLenum, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glPointParameterfvARB)) (GLenum, const GLfloat *);
/* ARB_window_pos */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2dARB)) (GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2dvARB)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2fARB)) (GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2fvARB)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2iARB)) (GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2ivARB)) (const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2sARB)) (GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2svARB)) (const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3dARB)) (GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3dvARB)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3fARB)) (GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3fvARB)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3iARB)) (GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3ivARB)) (const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3sARB)) (GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3svARB)) (const GLshort *);
/* ARB_shader_objects */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDeleteObjectARB)) (GLhandleARB);
GLPTR_LNK GLhandleARB (VGLEXTAPIENTRY *GLPTR(glGetHandleARB)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDetachObjectARB)) (GLhandleARB, GLhandleARB);
GLPTR_LNK GLhandleARB (VGLEXTAPIENTRY *GLPTR(glCreateShaderObjectARB)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glShaderSourceARB)) (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompileShaderARB)) (GLhandleARB);
GLPTR_LNK GLhandleARB (VGLEXTAPIENTRY *GLPTR(glCreateProgramObjectARB)) (void);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glAttachObjectARB)) (GLhandleARB, GLhandleARB);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glLinkProgramARB)) (GLhandleARB);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUseProgramObjectARB)) (GLhandleARB);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glValidateProgramARB)) (GLhandleARB);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform1fARB)) (GLint, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform2fARB)) (GLint, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform3fARB)) (GLint, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform4fARB)) (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform1iARB)) (GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform2iARB)) (GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform3iARB)) (GLint, GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform4iARB)) (GLint, GLint, GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform1fvARB)) (GLint, GLsizei, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform2fvARB)) (GLint, GLsizei, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform3fvARB)) (GLint, GLsizei, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform4fvARB)) (GLint, GLsizei, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform1ivARB)) (GLint, GLsizei, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform2ivARB)) (GLint, GLsizei, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform3ivARB)) (GLint, GLsizei, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform4ivARB)) (GLint, GLsizei, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniformMatrix2fvARB)) (GLint, GLsizei, GLboolean, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniformMatrix3fvARB)) (GLint, GLsizei, GLboolean, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniformMatrix4fvARB)) (GLint, GLsizei, GLboolean, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetObjectParameterfvARB)) (GLhandleARB, GLenum, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetObjectParameterivARB)) (GLhandleARB, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetInfoLogARB)) (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetAttachedObjectsARB)) (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
GLPTR_LNK GLint (VGLEXTAPIENTRY *GLPTR(glGetUniformLocationARB)) (GLhandleARB, const GLcharARB *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetActiveUniformARB)) (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetUniformfvARB)) (GLhandleARB, GLint, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetUniformivARB)) (GLhandleARB, GLint, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetShaderSourceARB)) (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
/* ARB_vertex_shader */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBindAttribLocationARB)) (GLhandleARB, GLuint, const GLcharARB *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetActiveAttribARB)) (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
GLPTR_LNK GLint (VGLEXTAPIENTRY *GLPTR(glGetAttribLocationARB)) (GLhandleARB, const GLcharARB *);
/* ARB_vertex_program */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1dARB)) (GLuint, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1dvARB)) (GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1fARB)) (GLuint, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1fvARB)) (GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1sARB)) (GLuint, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1svARB)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2dARB)) (GLuint, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2dvARB)) (GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2fARB)) (GLuint, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2fvARB)) (GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2sARB)) (GLuint, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2svARB)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3dARB)) (GLuint, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3dvARB)) (GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3fARB)) (GLuint, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3fvARB)) (GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3sARB)) (GLuint, GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3svARB)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4NbvARB)) (GLuint, const GLbyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4NivARB)) (GLuint, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4NsvARB)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4NubARB)) (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4NubvARB)) (GLuint, const GLubyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4NuivARB)) (GLuint, const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4NusvARB)) (GLuint, const GLushort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4bvARB)) (GLuint, const GLbyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4dARB)) (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4dvARB)) (GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4fARB)) (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4fvARB)) (GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4ivARB)) (GLuint, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4sARB)) (GLuint, GLshort, GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4svARB)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4ubvARB)) (GLuint, const GLubyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4uivARB)) (GLuint, const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4usvARB)) (GLuint, const GLushort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttribPointerARB)) (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glEnableVertexAttribArrayARB)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDisableVertexAttribArrayARB)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramStringARB)) (GLenum, GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBindProgramARB)) (GLenum, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDeleteProgramsARB)) (GLsizei, const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGenProgramsARB)) (GLsizei, GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramEnvParameter4dARB)) (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramEnvParameter4dvARB)) (GLenum, GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramEnvParameter4fARB)) (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramEnvParameter4fvARB)) (GLenum, GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramLocalParameter4dARB)) (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramLocalParameter4dvARB)) (GLenum, GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramLocalParameter4fARB)) (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glProgramLocalParameter4fvARB)) (GLenum, GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetProgramEnvParameterdvARB)) (GLenum, GLuint, GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetProgramEnvParameterfvARB)) (GLenum, GLuint, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetProgramLocalParameterdvARB)) (GLenum, GLuint, GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetProgramLocalParameterfvARB)) (GLenum, GLuint, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetProgramivARB)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetProgramStringARB)) (GLenum, GLenum, GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetVertexAttribdvARB)) (GLuint, GLenum, GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetVertexAttribfvARB)) (GLuint, GLenum, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetVertexAttribivARB)) (GLuint, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetVertexAttribPointervARB)) (GLuint, GLenum, GLvoid* *);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glIsProgramARB)) (GLuint);
/* ARB_vertex_buffer_object */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBindBufferARB)) (GLenum, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDeleteBuffersARB)) (GLsizei, const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGenBuffersARB)) (GLsizei, GLuint *);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glIsBufferARB)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBufferDataARB)) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBufferSubDataARB)) (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetBufferSubDataARB)) (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
GLPTR_LNK GLvoid* (VGLEXTAPIENTRY *GLPTR(glMapBufferARB)) (GLenum, GLenum);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glUnmapBufferARB)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetBufferParameterivARB)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetBufferPointervARB)) (GLenum, GLenum, GLvoid* *);
/* ARB_occlusion_query */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGenQueriesARB)) (GLsizei, GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDeleteQueriesARB)) (GLsizei, const GLuint *);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glIsQueryARB)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBeginQueryARB)) (GLenum, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glEndQueryARB)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetQueryivARB)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetQueryObjectivARB)) (GLuint, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetQueryObjectuivARB)) (GLuint, GLenum, GLuint *);
/* ARB_draw_buffers */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDrawBuffersARB)) (GLsizei, const GLenum *);

#ifdef	DLL_TARGET_DCC

/* GL_ARB_multitexture */
VGLEXTAPI void VGLEXTAPIENTRY glActiveTextureARB (GLenum texture)
{
	(*GLPTR(glActiveTextureARB))(texture);
}

VGLEXTAPI void VGLEXTAPIENTRY glClientActiveTextureARB (GLenum texture)
{
	(*GLPTR(glClientActiveTextureARB))(texture);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1dARB (GLenum texture, GLdouble s)
{
	(*GLPTR(glMultiTexCoord1dARB))(texture, s);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1dvARB (GLenum texture, const GLdouble *v)
{
	(*GLPTR(glMultiTexCoord1dvARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1fARB (GLenum texture, GLfloat s)
{
	(*GLPTR(glMultiTexCoord1fARB))(texture, s);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1fvARB (GLenum texture, const GLfloat *v)
{
	(*GLPTR(glMultiTexCoord1fvARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1iARB (GLenum texture, GLint s)
{
	(*GLPTR(glMultiTexCoord1iARB))(texture, s);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1ivARB (GLenum texture, const GLint *v)
{
	(*GLPTR(glMultiTexCoord1ivARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1sARB (GLenum texture, GLshort s)
{
	(*GLPTR(glMultiTexCoord1sARB))(texture, s);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1svARB (GLenum texture, const GLshort *v)
{
	(*GLPTR(glMultiTexCoord1svARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2dARB (GLenum texture, GLdouble s, GLdouble t)
{
	(*GLPTR(glMultiTexCoord2dARB))(texture, s, t);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2dvARB (GLenum texture, const GLdouble *v)
{
	(*GLPTR(glMultiTexCoord2dvARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2fARB(GLenum texture, GLfloat s, GLfloat t)
{
	(*GLPTR(glMultiTexCoord2fARB))(texture, s, t);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2fvARB (GLenum texture, const GLfloat *v)
{
	(*GLPTR(glMultiTexCoord2fvARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2iARB (GLenum texture, GLint s, GLint t)
{
	(*GLPTR(glMultiTexCoord2iARB))(texture, s, t);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2ivARB (GLenum texture, const GLint *v)
{
	(*GLPTR(glMultiTexCoord2ivARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2sARB (GLenum texture, GLshort s, GLshort t)
{
	(*GLPTR(glMultiTexCoord2sARB))(texture, s, t);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2svARB (GLenum texture, const GLshort *v)
{
	(*GLPTR(glMultiTexCoord2svARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3dARB (GLenum texture, GLdouble s, GLdouble t, GLdouble p)
{
	(*GLPTR(glMultiTexCoord3dARB))(texture, s, t, p);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3dvARB (GLenum texture, const GLdouble *v)
{
	(*GLPTR(glMultiTexCoord3dvARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3fARB (GLenum texture, GLfloat s, GLfloat t, GLfloat p)
{
	(*GLPTR(glMultiTexCoord3fARB))(texture, s, t, p);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3fvARB (GLenum texture, const GLfloat *v)
{
	(*GLPTR(glMultiTexCoord3fvARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3iARB (GLenum texture, GLint s, GLint t, GLint p)
{
	(*GLPTR(glMultiTexCoord3iARB))(texture, s, t, p);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3ivARB (GLenum texture, const GLint *v)
{
	(*GLPTR(glMultiTexCoord3ivARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3sARB (GLenum texture, GLshort s, GLshort t, GLshort p)
{
	(*GLPTR(glMultiTexCoord3sARB))(texture, s, t, p);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3svARB (GLenum texture, const GLshort *v)
{
	(*GLPTR(glMultiTexCoord3svARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4dARB (GLenum texture, GLdouble s, GLdouble t, GLdouble p, GLdouble q)
{
	(*GLPTR(glMultiTexCoord4dARB))(texture, s, t, p, q);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4dvARB (GLenum texture, const GLdouble *v)
{
	(*GLPTR(glMultiTexCoord4dvARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4fARB (GLenum texture, GLfloat s, GLfloat t, GLfloat p, GLfloat q)
{
	(*GLPTR(glMultiTexCoord4fARB))(texture, s, t, p, q);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4fvARB (GLenum texture, const GLfloat *v)
{
	(*GLPTR(glMultiTexCoord4fvARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4iARB (GLenum texture, GLint s, GLint t, GLint p, GLint q)
{
	(*GLPTR(glMultiTexCoord4iARB))(texture, s, t, p, q);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4ivARB (GLenum texture, const GLint *v)
{
	(*GLPTR(glMultiTexCoord4ivARB))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4sARB (GLenum texture, GLshort s, GLshort t, GLshort p, GLshort q)
{
	(*GLPTR(glMultiTexCoord4sARB))(texture, s, t, p, q);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4svARB (GLenum texture, const GLshort *v)
{
	(*GLPTR(glMultiTexCoord4svARB))(texture, v);
}

/* ARB_texture_compression */

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexImage3DARB(GLenum target, GLint level,
	GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth,
	GLint border, GLsizei imageSize,
	const GLvoid *data)
{
	(*GLPTR(glCompressedTexImage3DARB))(target, level, internalformat, width, height,
		depth, border, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexImage2DARB(GLenum target, GLint level,
	GLenum internalformat, GLsizei width, GLsizei height,
	GLint border, GLsizei imageSize,
	const GLvoid *data)
{
	(*GLPTR(glCompressedTexImage2DARB))(target, level, internalformat, width, height,
		border, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexImage1DARB (GLenum target, GLint level,
	GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
{
	(*GLPTR(glCompressedTexImage1DARB))(target, level, internalformat, width, border, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level,
	GLint xoffset, GLint yoffset, GLint zoffset,
	GLsizei width, GLsizei height, GLsizei depth,
	GLenum format, GLsizei imageSize, const GLvoid *data)
{
	(*GLPTR(glCompressedTexSubImage3DARB))(target, level, xoffset, yoffset, zoffset,
		width, height, depth, format, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level,
	GLint xoffset, GLint yoffset,
	GLsizei width, GLsizei height,
	GLenum format, GLsizei imageSize, const GLvoid *data)
{
	(*GLPTR(glCompressedTexSubImage2DARB))(target, level, xoffset, yoffset,
		width, height, format, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level,
	GLint xoffset, GLsizei width,
	GLenum format, GLsizei imageSize, const GLvoid *data)
{
	(*GLPTR(glCompressedTexSubImage1DARB))(target, level, xoffset, width, format, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetCompressedTexImageARB (GLenum target, GLint lod, GLvoid *img)
{
	(*GLPTR(glGetCompressedTexImageARB))(target, lod, img);
}

/* ARB_multisample */
VGLEXTAPI void VGLEXTAPIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert)
{
	(*GLPTR(glSampleCoverageARB))(value, invert);
}

/* ARB_transpose_matrix */
VGLEXTAPI void VGLEXTAPIENTRY glLoadTransposeMatrixfARB (const GLfloat *m)
{
	(*GLPTR(glLoadTransposeMatrixfARB))(m);
}

VGLEXTAPI void VGLEXTAPIENTRY glLoadTransposeMatrixdARB (const GLdouble *m)
{
	(*GLPTR(glLoadTransposeMatrixdARB))(m);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultTransposeMatrixfARB (const GLfloat *m)
{
	(*GLPTR(glMultTransposeMatrixfARB))(m);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultTransposeMatrixdARB (const GLdouble *m)
{
	(*GLPTR(glMultTransposeMatrixdARB))(m);
}

/* ARB_point_parameters */
VGLEXTAPI void VGLEXTAPIENTRY glPointParameterfARB (GLenum pname, GLfloat param)
{
	(*GLPTR(glPointParameterfARB))(pname, param);
}

VGLEXTAPI void VGLEXTAPIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params)
{
	(*GLPTR(glPointParameterfvARB))(pname, params);
}

/* ARB_window_pos */
VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2dARB (GLdouble x, GLdouble y)
{
	(*GLPTR(glWindowPos2dARB))(x, y);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2dvARB (const GLdouble *v)
{
	(*GLPTR(glWindowPos2dvARB))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2fARB (GLfloat x, GLfloat y)
{
	(*GLPTR(glWindowPos2fARB))(x, y);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2fvARB (const GLfloat *v)
{
	(*GLPTR(glWindowPos2fvARB))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2iARB (GLint x, GLint y)
{
	(*GLPTR(glWindowPos2iARB))(x, y);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2ivARB (const GLint *v)
{
	(*GLPTR(glWindowPos2ivARB))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2sARB (GLshort x, GLshort y)
{
	(*GLPTR(glWindowPos2sARB))(x, y);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2svARB (const GLshort *v)
{
	(*GLPTR(glWindowPos2svARB))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z)
{
	(*GLPTR(glWindowPos3dARB))(x, y, z);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3dvARB (const GLdouble *v)
{
	(*GLPTR(glWindowPos3dvARB))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z)
{
	(*GLPTR(glWindowPos3fARB))(x, y, z);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3fvARB (const GLfloat *v)
{
	(*GLPTR(glWindowPos3fvARB))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z)
{
	(*GLPTR(glWindowPos3iARB))(x, y, z);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3ivARB (const GLint *v)
{
	(*GLPTR(glWindowPos3ivARB))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z)
{
	(*GLPTR(glWindowPos3sARB))(x, y, z);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3svARB (const GLshort *v)
{
	(*GLPTR(glWindowPos3svARB))(v);
}

/* ARB_shader_objects */
VGLEXTAPI void VGLEXTAPIENTRY glDeleteObjectARB (GLhandleARB obj)
{
	(*GLPTR(glDeleteObjectARB))(obj);
}

VGLEXTAPI GLhandleARB VGLEXTAPIENTRY glGetHandleARB (GLenum pname)
{
	return (*GLPTR(glGetHandleARB))(pname);
}

VGLEXTAPI void VGLEXTAPIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj)
{
	(*GLPTR(glDetachObjectARB))(containerObj, attachedObj);
}

VGLEXTAPI GLhandleARB VGLEXTAPIENTRY glCreateShaderObjectARB (GLenum shaderType)
{
	return (*GLPTR(glCreateShaderObjectARB))(shaderType);
}

VGLEXTAPI void VGLEXTAPIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count,
	const GLcharARB **src_strings, const GLint *src_lens)
{
	(*GLPTR(glShaderSourceARB))(shaderObj, count, src_strings, src_lens);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompileShaderARB (GLhandleARB obj)
{
	(*GLPTR(glCompileShaderARB))(obj);
}

VGLEXTAPI GLhandleARB VGLEXTAPIENTRY glCreateProgramObjectARB (void)
{
	return (*GLPTR(glCreateProgramObjectARB))();
}

VGLEXTAPI void VGLEXTAPIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj)
{
	(*GLPTR(glAttachObjectARB))(containerObj, obj);
}

VGLEXTAPI void VGLEXTAPIENTRY glLinkProgramARB (GLhandleARB programObj)
{
	(*GLPTR(glLinkProgramARB))(programObj);
}

VGLEXTAPI void VGLEXTAPIENTRY glUseProgramObjectARB (GLhandleARB programObj)
{
	(*GLPTR(glUseProgramObjectARB))(programObj);
}

VGLEXTAPI void VGLEXTAPIENTRY glValidateProgramARB (GLhandleARB programObj)
{
	(*GLPTR(glValidateProgramARB))(programObj);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform1fARB (GLint location, GLfloat v0)
{
	(*GLPTR(glUniform1fARB))(location, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1)
{
	(*GLPTR(glUniform2fARB))(location, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
	(*GLPTR(glUniform3fARB))(location, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
	(*GLPTR(glUniform4fARB))(location, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform1iARB (GLint location, GLint v0)
{
	(*GLPTR(glUniform1iARB))(location, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1)
{
	(*GLPTR(glUniform2iARB))(location, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2)
{
	(*GLPTR(glUniform3iARB))(location, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
	(*GLPTR(glUniform4iARB))(location, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value)
{
	(*GLPTR(glUniform1fvARB))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value)
{
	(*GLPTR(glUniform2fvARB))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value)
{
	(*GLPTR(glUniform3fvARB))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value)
{
	(*GLPTR(glUniform4fvARB))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value)
{
	(*GLPTR(glUniform1ivARB))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value)
{
	(*GLPTR(glUniform2ivARB))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value)
{
	(*GLPTR(glUniform3ivARB))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value)
{
	(*GLPTR(glUniform4ivARB))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
	(*GLPTR(glUniformMatrix2fvARB))(location, count, transpose, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
	(*GLPTR(glUniformMatrix3fvARB))(location, count, transpose, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
	(*GLPTR(glUniformMatrix4fvARB))(location, count, transpose, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params)
{
	(*GLPTR(glGetObjectParameterfvARB))(obj, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params)
{
	(*GLPTR(glGetObjectParameterivARB))(obj, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)
{
	(*GLPTR(glGetInfoLogARB))(obj, maxLength, length, infoLog);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj)
{
	(*GLPTR(glGetAttachedObjectsARB))(containerObj, maxCount, count, obj);
}

VGLEXTAPI GLint VGLEXTAPIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name)
{
	return (*GLPTR(glGetUniformLocationARB))(programObj, name);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
{
	(*GLPTR(glGetActiveUniformARB))(programObj, index, maxLength, length, size, type, name);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params)
{
	(*GLPTR(glGetUniformfvARB))(programObj, location, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params)
{
	(*GLPTR(glGetUniformivARB))(programObj, location, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source)
{
	(*GLPTR(glGetShaderSourceARB))(obj, maxLength, length, source);
}

/* ARB_vertex_shader */
VGLEXTAPI void VGLEXTAPIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name)
{
	(*GLPTR(glBindAttribLocationARB))(programObj, index, name);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
{
	(*GLPTR(glGetActiveAttribARB))(programObj, index, maxLength, length, size, type, name);
}

VGLEXTAPI GLint VGLEXTAPIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name)
{
	return (*GLPTR(glGetAttribLocationARB))(programObj, name);
}

/* ARB_vertex_program */
VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1dARB (GLuint index, GLdouble v0)
{
	(*GLPTR(glVertexAttrib1dARB))(index, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v)
{
	(*GLPTR(glVertexAttrib1dvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1fARB (GLuint index, GLfloat v0)
{
	(*GLPTR(glVertexAttrib1fARB))(index, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v)
{
	(*GLPTR(glVertexAttrib1fvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1sARB (GLuint index, GLshort v0)
{
	(*GLPTR(glVertexAttrib1sARB))(index, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib1svARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2dARB (GLuint index, GLdouble v0, GLdouble v1)
{
	(*GLPTR(glVertexAttrib2dARB))(index, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v)
{
	(*GLPTR(glVertexAttrib2dvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2fARB (GLuint index, GLfloat v0, GLfloat v1)
{
	(*GLPTR(glVertexAttrib2fARB))(index, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v)
{
	(*GLPTR(glVertexAttrib2fvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2sARB (GLuint index, GLshort v0, GLshort v1)
{
	(*GLPTR(glVertexAttrib2sARB))(index, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib2svARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3dARB (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2)
{
	(*GLPTR(glVertexAttrib3dARB))(index, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v)
{
	(*GLPTR(glVertexAttrib3dvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3fARB (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2)
{
	(*GLPTR(glVertexAttrib3fARB))(index, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v)
{
	(*GLPTR(glVertexAttrib3fvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3sARB (GLuint index, GLshort v0, GLshort v1, GLshort v2)
{
	(*GLPTR(glVertexAttrib3sARB))(index, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib3svARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v)
{
	(*GLPTR(glVertexAttrib4NbvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v)
{
	(*GLPTR(glVertexAttrib4NivARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib4NsvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
{
	(*GLPTR(glVertexAttrib4NubARB))(index, x, y, z, w);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v)
{
	(*GLPTR(glVertexAttrib4NubvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v)
{
	(*GLPTR(glVertexAttrib4NuivARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v)
{
	(*GLPTR(glVertexAttrib4NusvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v)
{
	(*GLPTR(glVertexAttrib4bvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4dARB (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3)
{
	(*GLPTR(glVertexAttrib4dARB))(index, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v)
{
	(*GLPTR(glVertexAttrib4dvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4fARB (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
	(*GLPTR(glVertexAttrib4fARB))(index, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v)
{
	(*GLPTR(glVertexAttrib4fvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v)
{
	(*GLPTR(glVertexAttrib4ivARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4sARB (GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3)
{
	(*GLPTR(glVertexAttrib4sARB))(index, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib4svARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v)
{
	(*GLPTR(glVertexAttrib4ubvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v)
{
	(*GLPTR(glVertexAttrib4uivARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v)
{
	(*GLPTR(glVertexAttrib4usvARB))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
{
	(*GLPTR(glVertexAttribPointerARB))(index, size, type, normalized, stride, pointer);
}

VGLEXTAPI void VGLEXTAPIENTRY glEnableVertexAttribArrayARB (GLuint index)
{
	(*GLPTR(glEnableVertexAttribArrayARB))(index);
}

VGLEXTAPI void VGLEXTAPIENTRY glDisableVertexAttribArrayARB (GLuint index)
{
	(*GLPTR(glDisableVertexAttribArrayARB))(index);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string)
{
	(*GLPTR(glProgramStringARB))(target, format, len, string);
}

VGLEXTAPI void VGLEXTAPIENTRY glBindProgramARB (GLenum target, GLuint program)
{
	(*GLPTR(glBindProgramARB))(target, program);
}

VGLEXTAPI void VGLEXTAPIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs)
{
	(*GLPTR(glDeleteProgramsARB))(n, programs);
}

VGLEXTAPI void VGLEXTAPIENTRY glGenProgramsARB (GLsizei n, GLuint *programs)
{
	(*GLPTR(glGenProgramsARB))(n, programs);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
	(*GLPTR(glProgramEnvParameter4dARB))(target, index, x, y, z, w);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *v)
{
	(*GLPTR(glProgramEnvParameter4dvARB))(target, index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
	(*GLPTR(glProgramEnvParameter4fARB))(target, index, x, y, z, w);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *v)
{
	(*GLPTR(glProgramEnvParameter4fvARB))(target, index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
	(*GLPTR(glProgramLocalParameter4dARB))(target, index, x, y, z, w);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *v)
{
	(*GLPTR(glProgramLocalParameter4dvARB))(target, index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
	(*GLPTR(glProgramLocalParameter4fARB))(target, index, x, y, z, w);
}

VGLEXTAPI void VGLEXTAPIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *v)
{
	(*GLPTR(glProgramLocalParameter4fvARB))(target, index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params)
{
	(*GLPTR(glGetProgramEnvParameterdvARB))(target, index, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params)
{
	(*GLPTR(glGetProgramEnvParameterfvARB))(target, index, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params)
{
	(*GLPTR(glGetProgramLocalParameterdvARB))(target, index, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params)
{
	(*GLPTR(glGetProgramLocalParameterfvARB))(target, index, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetProgramivARB))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string)
{
	(*GLPTR(glGetProgramStringARB))(target, pname, string);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params)
{
	(*GLPTR(glGetVertexAttribdvARB))(index, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params)
{
	(*GLPTR(glGetVertexAttribfvARB))(index, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params)
{
	(*GLPTR(glGetVertexAttribivARB))(index, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid **pointer)
{
	(*GLPTR(glGetVertexAttribPointervARB))(index, pname, pointer);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glIsProgramARB (GLuint program)
{
	return (*GLPTR(glIsProgramARB))(program);
}

/* ARB_vertex_buffer_object */
VGLEXTAPI void VGLEXTAPIENTRY glBindBufferARB (GLenum target, GLuint buffer)
{
	(*GLPTR(glBindBufferARB))(target, buffer);
}

VGLEXTAPI void VGLEXTAPIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers)
{
	(*GLPTR(glDeleteBuffersARB))(n, buffers);
}

VGLEXTAPI void VGLEXTAPIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers)
{
	(*GLPTR(glGenBuffersARB))(n, buffers);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glIsBufferARB (GLuint buffer)
{
	return (*GLPTR(glIsBufferARB))(buffer);
}

VGLEXTAPI void VGLEXTAPIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage)
{
	(*GLPTR(glBufferDataARB))(target, size, data, usage);
}

VGLEXTAPI void VGLEXTAPIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data)
{
	(*GLPTR(glBufferSubDataARB))(target, offset, size, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data)
{
	(*GLPTR(glGetBufferSubDataARB))(target, offset, size, data);
}

VGLEXTAPI GLvoid* VGLEXTAPIENTRY glMapBufferARB (GLenum target, GLenum access)
{
	return (*GLPTR(glMapBufferARB))(target, access);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glUnmapBufferARB (GLenum target)
{
	return (*GLPTR(glUnmapBufferARB))(target);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetBufferParameterivARB))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid **params)
{
	(*GLPTR(glGetBufferPointervARB))(target, pname, params);
}

/* ARB_occlusion_query */
VGLEXTAPI void VGLEXTAPIENTRY glGenQueriesARB (GLsizei n, GLuint *ids)
{
	(*GLPTR(glGenQueriesARB))(n, ids);
}

VGLEXTAPI void VGLEXTAPIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids)
{
	(*GLPTR(glDeleteQueriesARB))(n, ids);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glIsQueryARB (GLuint id)
{
	return (*GLPTR(glIsQueryARB))(id);
}

VGLEXTAPI void VGLEXTAPIENTRY glBeginQueryARB (GLenum target, GLuint id)
{
	(*GLPTR(glBeginQueryARB))(target, id);
}

VGLEXTAPI void VGLEXTAPIENTRY glEndQueryARB (GLenum target)
{
	(*GLPTR(glEndQueryARB))(target);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetQueryivARB))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params)
{
	(*GLPTR(glGetQueryObjectivARB))(id, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params)
{
	(*GLPTR(glGetQueryObjectuivARB))(id, pname, params);
}

/* ARB_draw_buffers */
VGLEXTAPI void VGLEXTAPIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs)
{
	(*GLPTR(glDrawBuffersARB))(n, bufs);
}

#endif	/* !DLL_TARGET_DCC */

V_LOCAL void
vgl_load_arb_extensions(vboolean *terminate)
{
	vboolean flag;
	if(HAVE_EXT(GL_ARB_multitexture))
	{
		flag = true;
		LGLP(glActiveTextureARB);
		LGLP(glClientActiveTextureARB);
		LGLP(glMultiTexCoord1dARB);
		LGLP(glMultiTexCoord1dvARB);
		LGLP(glMultiTexCoord1fARB);
		LGLP(glMultiTexCoord1fvARB);
		LGLP(glMultiTexCoord1iARB);
		LGLP(glMultiTexCoord1ivARB);
		LGLP(glMultiTexCoord1sARB);
		LGLP(glMultiTexCoord1svARB);
		LGLP(glMultiTexCoord2dARB);
		LGLP(glMultiTexCoord2dvARB);
		LGLP(glMultiTexCoord2fARB);
		LGLP(glMultiTexCoord2fvARB);
		LGLP(glMultiTexCoord2iARB);
		LGLP(glMultiTexCoord2ivARB);
		LGLP(glMultiTexCoord2sARB);
		LGLP(glMultiTexCoord2svARB);
		LGLP(glMultiTexCoord3dARB);
		LGLP(glMultiTexCoord3dvARB);
		LGLP(glMultiTexCoord3fARB);
		LGLP(glMultiTexCoord3fvARB);
		LGLP(glMultiTexCoord3iARB);
		LGLP(glMultiTexCoord3ivARB);
		LGLP(glMultiTexCoord3sARB);
		LGLP(glMultiTexCoord3svARB);
		LGLP(glMultiTexCoord4dARB);
		LGLP(glMultiTexCoord4dvARB);
		LGLP(glMultiTexCoord4fARB);
		LGLP(glMultiTexCoord4fvARB);
		LGLP(glMultiTexCoord4iARB);
		LGLP(glMultiTexCoord4ivARB);
		LGLP(glMultiTexCoord4sARB);
		LGLP(glMultiTexCoord4svARB);
		LGLTRACE(GL_ARB_multitexture);
	}
	else
	{
		RGLP(glActiveTextureARB);
		RGLP(glClientActiveTextureARB);
		RGLP(glMultiTexCoord1dARB);
		RGLP(glMultiTexCoord1dvARB);
		RGLP(glMultiTexCoord1fARB);
		RGLP(glMultiTexCoord1fvARB);
		RGLP(glMultiTexCoord1iARB);
		RGLP(glMultiTexCoord1ivARB);
		RGLP(glMultiTexCoord1sARB);
		RGLP(glMultiTexCoord1svARB);
		RGLP(glMultiTexCoord2dARB);
		RGLP(glMultiTexCoord2dvARB);
		RGLP(glMultiTexCoord2fARB);
		RGLP(glMultiTexCoord2fvARB);
		RGLP(glMultiTexCoord2iARB);
		RGLP(glMultiTexCoord2ivARB);
		RGLP(glMultiTexCoord2sARB);
		RGLP(glMultiTexCoord2svARB);
		RGLP(glMultiTexCoord3dARB);
		RGLP(glMultiTexCoord3dvARB);
		RGLP(glMultiTexCoord3fARB);
		RGLP(glMultiTexCoord3fvARB);
		RGLP(glMultiTexCoord3iARB);
		RGLP(glMultiTexCoord3ivARB);
		RGLP(glMultiTexCoord3sARB);
		RGLP(glMultiTexCoord3svARB);
		RGLP(glMultiTexCoord4dARB);
		RGLP(glMultiTexCoord4dvARB);
		RGLP(glMultiTexCoord4fARB);
		RGLP(glMultiTexCoord4fvARB);
		RGLP(glMultiTexCoord4iARB);
		RGLP(glMultiTexCoord4ivARB);
		RGLP(glMultiTexCoord4sARB);
		RGLP(glMultiTexCoord4svARB);
	}
	if(HAVE_EXT(GL_ARB_texture_compression))
	{
		flag = true;
		LGLP(glCompressedTexImage3DARB);
		LGLP(glCompressedTexImage2DARB);
		LGLP(glCompressedTexImage1DARB);
		LGLP(glCompressedTexSubImage3DARB);
		LGLP(glCompressedTexSubImage2DARB);
		LGLP(glCompressedTexSubImage1DARB);
		LGLP(glGetCompressedTexImageARB);
		LGLTRACE(GL_ARB_texture_compression);
	}
	else
	{
		RGLP(glCompressedTexImage3DARB);
		RGLP(glCompressedTexImage2DARB);
		RGLP(glCompressedTexImage1DARB);
		RGLP(glCompressedTexSubImage3DARB);
		RGLP(glCompressedTexSubImage2DARB);
		RGLP(glCompressedTexSubImage1DARB);
		RGLP(glGetCompressedTexImageARB);
	}
	EXTTRACE(GL_ARB_texture_cube_map);
	if(HAVE_EXT(GL_ARB_multisample))
	{
		flag = true;
		LGLP(glSampleCoverageARB);
		LGLTRACE(GL_ARB_multisample);
	}
	else
		RGLP(glSampleCoverageARB);
	EXTTRACE(GL_ARB_texture_env_add);
	EXTTRACE(GL_ARB_texture_env_combine);
	EXTTRACE(GL_ARB_texture_env_dot3);
	EXTTRACE(GL_ARB_texture_border_clamp);
	if(HAVE_EXT(GL_ARB_transpose_matrix))
	{
		flag = true;
		LGLP(glLoadTransposeMatrixfARB);
		LGLP(glLoadTransposeMatrixdARB);
		LGLP(glMultTransposeMatrixfARB);
		LGLP(glMultTransposeMatrixdARB);
		LGLTRACE(GL_ARB_transpose_matrix);
	}
	else
	{
		RGLP(glLoadTransposeMatrixfARB);
		RGLP(glLoadTransposeMatrixdARB);
		RGLP(glMultTransposeMatrixfARB);
		RGLP(glMultTransposeMatrixdARB);
	}
	EXTTRACE(GL_ARB_depth_texture);
	EXTTRACE(GL_ARB_shadow);
	EXTTRACE(GL_ARB_shadow_ambient);
	if(HAVE_EXT(GL_ARB_point_parameters))
	{
		flag = true;
		LGLP(glPointParameterfARB);
		LGLP(glPointParameterfvARB);
		LGLTRACE(GL_ARB_point_parameters);
	}
	else
	{
		RGLP(glPointParameterfARB);
		RGLP(glPointParameterfvARB);
	}
	EXTTRACE(GL_ARB_texture_env_crossbar);
	EXTTRACE(GL_ARB_texture_mirrored_repeat);
	if(HAVE_EXT(GL_ARB_window_pos))
	{
		flag = true;
		LGLP(glWindowPos2dARB);
		LGLP(glWindowPos2dvARB);
		LGLP(glWindowPos2fARB);
		LGLP(glWindowPos2fvARB);
		LGLP(glWindowPos2iARB);
		LGLP(glWindowPos2ivARB);
		LGLP(glWindowPos2sARB);
		LGLP(glWindowPos2svARB);
		LGLP(glWindowPos3dARB);
		LGLP(glWindowPos3dvARB);
		LGLP(glWindowPos3fARB);
		LGLP(glWindowPos3fvARB);
		LGLP(glWindowPos3iARB);
		LGLP(glWindowPos3ivARB);
		LGLP(glWindowPos3sARB);
		LGLP(glWindowPos3svARB);
		LGLTRACE(GL_ARB_window_pos);
	}
	else
	{
		RGLP(glWindowPos2dARB);
		RGLP(glWindowPos2dvARB);
		RGLP(glWindowPos2fARB);
		RGLP(glWindowPos2fvARB);
		RGLP(glWindowPos2iARB);
		RGLP(glWindowPos2ivARB);
		RGLP(glWindowPos2sARB);
		RGLP(glWindowPos2svARB);
		RGLP(glWindowPos3dARB);
		RGLP(glWindowPos3dvARB);
		RGLP(glWindowPos3fARB);
		RGLP(glWindowPos3fvARB);
		RGLP(glWindowPos3iARB);
		RGLP(glWindowPos3ivARB);
		RGLP(glWindowPos3sARB);
		RGLP(glWindowPos3svARB);
	}
	if(HAVE_EXT(GL_ARB_shader_objects))
	{
		flag = true;
		LGLP(glDeleteObjectARB);
		LGLP(glGetHandleARB);
		LGLP(glDetachObjectARB);
		LGLP(glCreateShaderObjectARB);
		LGLP(glShaderSourceARB);
		LGLP(glCompileShaderARB);
		LGLP(glCreateProgramObjectARB);
		LGLP(glAttachObjectARB);
		LGLP(glLinkProgramARB);
		LGLP(glUseProgramObjectARB);
		LGLP(glValidateProgramARB);
		LGLP(glUniform1fARB);
		LGLP(glUniform2fARB);
		LGLP(glUniform3fARB);
		LGLP(glUniform4fARB);
		LGLP(glUniform1iARB);
		LGLP(glUniform2iARB);
		LGLP(glUniform3iARB);
		LGLP(glUniform4iARB);
		LGLP(glUniform1fvARB);
		LGLP(glUniform2fvARB);
		LGLP(glUniform3fvARB);
		LGLP(glUniform4fvARB);
		LGLP(glUniform1ivARB);
		LGLP(glUniform2ivARB);
		LGLP(glUniform3ivARB);
		LGLP(glUniform4ivARB);
		LGLP(glUniformMatrix2fvARB);
		LGLP(glUniformMatrix3fvARB);
		LGLP(glUniformMatrix4fvARB);
		LGLP(glGetObjectParameterfvARB);
		LGLP(glGetObjectParameterivARB);
		LGLP(glGetInfoLogARB);
		LGLP(glGetAttachedObjectsARB);
		LGLP(glGetUniformLocationARB);
		LGLP(glGetActiveUniformARB);
		LGLP(glGetUniformfvARB);
		LGLP(glGetUniformivARB);
		LGLP(glGetShaderSourceARB);
		LGLTRACE(GL_ARB_shader_objects);
	}
	else
	{
		RGLP(glDeleteObjectARB);
		RGLP(glGetHandleARB);
		RGLP(glDetachObjectARB);
		RGLP(glCreateShaderObjectARB);
		RGLP(glShaderSourceARB);
		RGLP(glCompileShaderARB);
		RGLP(glCreateProgramObjectARB);
		RGLP(glAttachObjectARB);
		RGLP(glLinkProgramARB);
		RGLP(glUseProgramObjectARB);
		RGLP(glValidateProgramARB);
		RGLP(glUniform1fARB);
		RGLP(glUniform2fARB);
		RGLP(glUniform3fARB);
		RGLP(glUniform4fARB);
		RGLP(glUniform1iARB);
		RGLP(glUniform2iARB);
		RGLP(glUniform3iARB);
		RGLP(glUniform4iARB);
		RGLP(glUniform1fvARB);
		RGLP(glUniform2fvARB);
		RGLP(glUniform3fvARB);
		RGLP(glUniform4fvARB);
		RGLP(glUniform1ivARB);
		RGLP(glUniform2ivARB);
		RGLP(glUniform3ivARB);
		RGLP(glUniform4ivARB);
		RGLP(glUniformMatrix2fvARB);
		RGLP(glUniformMatrix3fvARB);
		RGLP(glUniformMatrix4fvARB);
		RGLP(glGetObjectParameterfvARB);
		RGLP(glGetObjectParameterivARB);
		RGLP(glGetInfoLogARB);
		RGLP(glGetAttachedObjectsARB);
		RGLP(glGetUniformLocationARB);
		RGLP(glGetActiveUniformARB);
		RGLP(glGetUniformfvARB);
		RGLP(glGetUniformivARB);
		RGLP(glGetShaderSourceARB);
	}
	if(HAVE_EXT(GL_ARB_vertex_shader))
	{
		flag = true;
		LGLP(glBindAttribLocationARB);
		LGLP(glGetActiveAttribARB);
		LGLP(glGetAttribLocationARB);
		LGLTRACE(GL_ARB_vertex_shader);
	}
	else
	{
		RGLP(glBindAttribLocationARB);
		RGLP(glGetActiveAttribARB);
		RGLP(glGetAttribLocationARB);
	}
	EXTTRACE(GL_ARB_fragment_shader);
	EXTTRACE(GL_ARB_shading_language_100);
	if(HAVE_EXT(GL_ARB_shading_language_100))
	{
		char *glsl_ver = (char *)glGetString(GL_SHADING_LANGUAGE_VERSION_ARB);
		conlPrintf(LOG_TRACE,"\tShading language version: \"%s\"\n",
			glsl_ver ? glsl_ver : "[unknown]");
	}
	if(HAVE_EXT(GL_ARB_vertex_program))
	{
		flag = true;
		LGLP(glVertexAttrib1dARB);
		LGLP(glVertexAttrib1dvARB);
		LGLP(glVertexAttrib1fARB);
		LGLP(glVertexAttrib1fvARB);
		LGLP(glVertexAttrib1sARB);
		LGLP(glVertexAttrib1svARB);
		LGLP(glVertexAttrib2dARB);
		LGLP(glVertexAttrib2dvARB);
		LGLP(glVertexAttrib2fARB);
		LGLP(glVertexAttrib2fvARB);
		LGLP(glVertexAttrib2sARB);
		LGLP(glVertexAttrib2svARB);
		LGLP(glVertexAttrib3dARB);
		LGLP(glVertexAttrib3dvARB);
		LGLP(glVertexAttrib3fARB);
		LGLP(glVertexAttrib3fvARB);
		LGLP(glVertexAttrib3sARB);
		LGLP(glVertexAttrib3svARB);
		LGLP(glVertexAttrib4NbvARB);
		LGLP(glVertexAttrib4NivARB);
		LGLP(glVertexAttrib4NsvARB);
		LGLP(glVertexAttrib4NubARB);
		LGLP(glVertexAttrib4NubvARB);
		LGLP(glVertexAttrib4NuivARB);
		LGLP(glVertexAttrib4NusvARB);
		LGLP(glVertexAttrib4bvARB);
		LGLP(glVertexAttrib4dARB);
		LGLP(glVertexAttrib4dvARB);
		LGLP(glVertexAttrib4fARB);
		LGLP(glVertexAttrib4fvARB);
		LGLP(glVertexAttrib4ivARB);
		LGLP(glVertexAttrib4sARB);
		LGLP(glVertexAttrib4svARB);
		LGLP(glVertexAttrib4ubvARB);
		LGLP(glVertexAttrib4uivARB);
		LGLP(glVertexAttrib4usvARB);
		LGLP(glVertexAttribPointerARB);
		LGLP(glEnableVertexAttribArrayARB);
		LGLP(glDisableVertexAttribArrayARB);
		LGLP(glProgramStringARB);
		LGLP(glBindProgramARB);
		LGLP(glDeleteProgramsARB);
		LGLP(glGenProgramsARB);
		LGLP(glProgramEnvParameter4dARB);
		LGLP(glProgramEnvParameter4dvARB);
		LGLP(glProgramEnvParameter4fARB);
		LGLP(glProgramEnvParameter4fvARB);
		LGLP(glProgramLocalParameter4dARB);
		LGLP(glProgramLocalParameter4dvARB);
		LGLP(glProgramLocalParameter4fARB);
		LGLP(glProgramLocalParameter4fvARB);
		LGLP(glGetProgramEnvParameterdvARB);
		LGLP(glGetProgramEnvParameterfvARB);
		LGLP(glGetProgramLocalParameterdvARB);
		LGLP(glGetProgramLocalParameterfvARB);
		LGLP(glGetProgramivARB);
		LGLP(glGetProgramStringARB);
		LGLP(glGetVertexAttribdvARB);
		LGLP(glGetVertexAttribfvARB);
		LGLP(glGetVertexAttribivARB);
		LGLP(glGetVertexAttribPointervARB);
		LGLP(glIsProgramARB);
		LGLTRACE(GL_ARB_vertex_program);
	}
	else
	{
		RGLP(glVertexAttrib1dARB);
		RGLP(glVertexAttrib1dvARB);
		RGLP(glVertexAttrib1fARB);
		RGLP(glVertexAttrib1fvARB);
		RGLP(glVertexAttrib1sARB);
		RGLP(glVertexAttrib1svARB);
		RGLP(glVertexAttrib2dARB);
		RGLP(glVertexAttrib2dvARB);
		RGLP(glVertexAttrib2fARB);
		RGLP(glVertexAttrib2fvARB);
		RGLP(glVertexAttrib2sARB);
		RGLP(glVertexAttrib2svARB);
		RGLP(glVertexAttrib3dARB);
		RGLP(glVertexAttrib3dvARB);
		RGLP(glVertexAttrib3fARB);
		RGLP(glVertexAttrib3fvARB);
		RGLP(glVertexAttrib3sARB);
		RGLP(glVertexAttrib3svARB);
		RGLP(glVertexAttrib4NbvARB);
		RGLP(glVertexAttrib4NivARB);
		RGLP(glVertexAttrib4NsvARB);
		RGLP(glVertexAttrib4NubARB);
		RGLP(glVertexAttrib4NubvARB);
		RGLP(glVertexAttrib4NuivARB);
		RGLP(glVertexAttrib4NusvARB);
		RGLP(glVertexAttrib4bvARB);
		RGLP(glVertexAttrib4dARB);
		RGLP(glVertexAttrib4dvARB);
		RGLP(glVertexAttrib4fARB);
		RGLP(glVertexAttrib4fvARB);
		RGLP(glVertexAttrib4ivARB);
		RGLP(glVertexAttrib4sARB);
		RGLP(glVertexAttrib4svARB);
		RGLP(glVertexAttrib4ubvARB);
		RGLP(glVertexAttrib4uivARB);
		RGLP(glVertexAttrib4usvARB);
		RGLP(glVertexAttribPointerARB);
		RGLP(glEnableVertexAttribArrayARB);
		RGLP(glDisableVertexAttribArrayARB);
		RGLP(glProgramStringARB);
		RGLP(glBindProgramARB);
		RGLP(glDeleteProgramsARB);
		RGLP(glGenProgramsARB);
		RGLP(glProgramEnvParameter4dARB);
		RGLP(glProgramEnvParameter4dvARB);
		RGLP(glProgramEnvParameter4fARB);
		RGLP(glProgramEnvParameter4fvARB);
		RGLP(glProgramLocalParameter4dARB);
		RGLP(glProgramLocalParameter4dvARB);
		RGLP(glProgramLocalParameter4fARB);
		RGLP(glProgramLocalParameter4fvARB);
		RGLP(glGetProgramEnvParameterdvARB);
		RGLP(glGetProgramEnvParameterfvARB);
		RGLP(glGetProgramLocalParameterdvARB);
		RGLP(glGetProgramLocalParameterfvARB);
		RGLP(glGetProgramivARB);
		RGLP(glGetProgramStringARB);
		RGLP(glGetVertexAttribdvARB);
		RGLP(glGetVertexAttribfvARB);
		RGLP(glGetVertexAttribivARB);
		RGLP(glGetVertexAttribPointervARB);
		RGLP(glIsProgramARB);
	}
	EXTTRACE(GL_ARB_fragment_program);
	EXTTRACE(GL_ARB_fragment_program_shadow);
	if(HAVE_EXT(GL_ARB_vertex_buffer_object))
	{
		flag = true;
		LGLP(glBindBufferARB);
		LGLP(glDeleteBuffersARB);
		LGLP(glGenBuffersARB);
		LGLP(glIsBufferARB);
		LGLP(glBufferDataARB);
		LGLP(glBufferSubDataARB);
		LGLP(glGetBufferSubDataARB);
		LGLP(glMapBufferARB);
		LGLP(glUnmapBufferARB);
		LGLP(glGetBufferParameterivARB);
		LGLP(glGetBufferPointervARB);
		LGLTRACE(GL_ARB_vertex_buffer_object);
	}
	else
	{
		RGLP(glBindBufferARB);
		RGLP(glDeleteBuffersARB);
		RGLP(glGenBuffersARB);
		RGLP(glIsBufferARB);
		RGLP(glBufferDataARB);
		RGLP(glBufferSubDataARB);
		RGLP(glGetBufferSubDataARB);
		RGLP(glMapBufferARB);
		RGLP(glUnmapBufferARB);
		RGLP(glGetBufferParameterivARB);
		RGLP(glGetBufferPointervARB);
	}
	if(HAVE_EXT(GL_ARB_occlusion_query))
	{
		flag = true;
		LGLP(glGenQueriesARB);
		LGLP(glDeleteQueriesARB);
		LGLP(glIsQueryARB);
		LGLP(glBeginQueryARB);
		LGLP(glEndQueryARB);
		LGLP(glGetQueryivARB);
		LGLP(glGetQueryObjectivARB);
		LGLP(glGetQueryObjectuivARB);
		LGLTRACE(GL_ARB_occlusion_query);
	}
	else
	{
		RGLP(glGenQueriesARB);
		RGLP(glDeleteQueriesARB);
		RGLP(glIsQueryARB);
		RGLP(glBeginQueryARB);
		RGLP(glEndQueryARB);
		RGLP(glGetQueryivARB);
		RGLP(glGetQueryObjectivARB);
		RGLP(glGetQueryObjectuivARB);
	}
	if(HAVE_EXT(GL_ARB_draw_buffers))
	{
		flag = true;
		LGLP(glDrawBuffersARB);
		LGLTRACE(GL_ARB_draw_buffers);
	}
	else
		RGLP(glDrawBuffersARB);
	EXTTRACE(GL_ARB_texture_non_power_of_two);
	EXTTRACE(GL_ARB_point_sprite);
	EXTTRACE(GL_ARB_texture_rectangle);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Miscellaneous extensions.
 */

/* EXT_texture3D */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glTexImage3DEXT)) (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glTexSubImage3DEXT)) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
/* EXT_draw_range_elements */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDrawRangeElementsEXT)) (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
/* EXT_blend_color */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBlendColorEXT)) (GLclampf, GLclampf, GLclampf, GLclampf);
/* EXT_blend_minmax */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBlendEquationEXT)) (GLenum);
/* EXT_fog_coord */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoordfEXT)) (GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoordfvEXT)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoorddEXT)) (GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoorddvEXT)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoordPointerEXT)) (GLenum, GLsizei, const GLvoid *);
/* EXT_multi_draw_arrays */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiDrawArraysEXT)) (GLenum, GLint *, GLsizei *, GLsizei);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiDrawElementsEXT)) (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
/* EXT_secondary_color */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3bEXT)) (GLbyte, GLbyte, GLbyte);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3bvEXT)) (const GLbyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3dEXT)) (GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3dvEXT)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3fEXT)) (GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3fvEXT)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3iEXT)) (GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3ivEXT)) (const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3sEXT)) (GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3svEXT)) (const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3ubEXT)) (GLubyte, GLubyte, GLubyte);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3ubvEXT)) (const GLubyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3uiEXT)) (GLuint, GLuint, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3uivEXT)) (const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3usEXT)) (GLushort, GLushort, GLushort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3usvEXT)) (const GLushort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColorPointerEXT)) (GLint, GLenum, GLsizei, const GLvoid *);
/* EXT_blend_func_separate */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBlendFuncSeparateEXT)) (GLenum, GLenum, GLenum, GLenum);
/* EXT_stencil_two_side */
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glActiveStencilFaceEXT)) (GLenum);

#ifdef	DLL_TARGET_DCC

/* EXT_texture3D */
VGLEXTAPI void VGLEXTAPIENTRY glTexImage3DEXT (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
	(*GLPTR(glTexImage3DEXT))(target, level, internalformat, width, height, depth, border, format, type, pixels);
}

VGLEXTAPI void VGLEXTAPIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
{
	(*GLPTR(glTexSubImage3DEXT))(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
}

/* EXT_draw_range_elements */
VGLEXTAPI void VGLEXTAPIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
{
	(*GLPTR(glDrawRangeElementsEXT))(mode, start, end, count, type, indices);
}

/* EXT_blend_color */
VGLEXTAPI void VGLEXTAPIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
	(*GLPTR(glBlendColorEXT))(red, green, blue, alpha);
}

/* EXT_blend_minmax */
VGLEXTAPI void VGLEXTAPIENTRY glBlendEquationEXT (GLenum mode)
{
	(*GLPTR(glBlendEquationEXT))(mode);
}

/* EXT_fog_coord */
VGLEXTAPI void VGLEXTAPIENTRY glFogCoordfEXT (GLfloat v)
{
	(*GLPTR(glFogCoordfEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoordfvEXT (const GLfloat *v)
{
	(*GLPTR(glFogCoordfvEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoorddEXT (GLdouble v)
{
	(*GLPTR(glFogCoorddEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoorddvEXT (const GLdouble *v)
{
	(*GLPTR(glFogCoorddvEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer)
{
	(*GLPTR(glFogCoordPointerEXT))(type, stride, pointer);
}

/* EXT_multi_draw_arrays */
VGLEXTAPI void VGLEXTAPIENTRY glMultiDrawArraysEXT (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount)
{
	(*GLPTR(glMultiDrawArraysEXT))(mode, first, count, primcount);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)
{
	(*GLPTR(glMultiDrawElementsEXT))(mode, count, type, indices, primcount);
}

/* EXT_secondary_color */
VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3bEXT (GLbyte r, GLbyte g, GLbyte b)
{
	(*GLPTR(glSecondaryColor3bEXT))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3bvEXT (const GLbyte *v)
{
	(*GLPTR(glSecondaryColor3bvEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3dEXT (GLdouble r, GLdouble g, GLdouble b)
{
	(*GLPTR(glSecondaryColor3dEXT))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3dvEXT (const GLdouble *v)
{
	(*GLPTR(glSecondaryColor3dvEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3fEXT (GLfloat r, GLfloat g, GLfloat b)
{
	(*GLPTR(glSecondaryColor3fEXT))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3fvEXT (const GLfloat *v)
{
	(*GLPTR(glSecondaryColor3fvEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3iEXT (GLint r, GLint g, GLint b)
{
	(*GLPTR(glSecondaryColor3iEXT))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3ivEXT (const GLint *v)
{
	(*GLPTR(glSecondaryColor3ivEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3sEXT (GLshort r, GLshort g, GLshort b)
{
	(*GLPTR(glSecondaryColor3sEXT))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3svEXT (const GLshort *v)
{
	(*GLPTR(glSecondaryColor3svEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3ubEXT (GLubyte r, GLubyte g, GLubyte b)
{
	(*GLPTR(glSecondaryColor3ubEXT))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3ubvEXT (const GLubyte *v)
{
	(*GLPTR(glSecondaryColor3ubvEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3uiEXT (GLuint r, GLuint g, GLuint b)
{
	(*GLPTR(glSecondaryColor3uiEXT))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3uivEXT (const GLuint *v)
{
	(*GLPTR(glSecondaryColor3uivEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3usEXT (GLushort r, GLushort g, GLushort b)
{
	(*GLPTR(glSecondaryColor3usEXT))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3usvEXT (const GLushort *v)
{
	(*GLPTR(glSecondaryColor3usvEXT))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
{
	(*GLPTR(glSecondaryColorPointerEXT))(size, type, stride, pointer);
}

/* EXT_blend_func_separate */
VGLEXTAPI void VGLEXTAPIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
	(*GLPTR(glBlendFuncSeparateEXT))(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
}

/* EXT_stencil_two_side */
VGLEXTAPI void VGLEXTAPIENTRY glActiveStencilFaceEXT (GLenum face)
{
	(*GLPTR(glActiveStencilFaceEXT))(face);
}

#endif	/* !DLL_TARGET_DCC */

V_LOCAL void
vgl_load_misc_extensions(vboolean *terminate)
{
	vboolean flag;
	if(HAVE_EXT(GL_EXT_texture3D))
	{
		flag = true;
		LGLP(glTexImage3DEXT);
		LGLP(glTexSubImage3DEXT);
		LGLTRACE(GL_EXT_texture3D);
	}
	else
	{
		RGLP(glTexImage3DEXT);
		RGLP(glTexSubImage3DEXT);
	}
	EXTTRACE(GL_EXT_bgra);
	EXTTRACE(GL_EXT_abgr);
	EXTTRACE(GL_EXT_packed_pixels);
	EXTTRACE(GL_EXT_rescale_normal);
	EXTTRACE(GL_EXT_separate_specular_color);
	if(HAVE_EXT(GL_EXT_draw_range_elements))
	{
		flag = true;
		LGLP(glDrawRangeElementsEXT);
		LGLTRACE(GL_EXT_draw_range_elements);
	}
	else
		RGLP(glDrawRangeElementsEXT);
	EXTTRACE(GL_SGIS_texture_lod);
	if(HAVE_EXT(GL_EXT_blend_color))
	{
		flag = true;
		LGLP(glBlendColorEXT);
		LGLTRACE(GL_EXT_blend_color);
	}
	else
		RGLP(glBlendColorEXT);
	if(HAVE_EXT(GL_EXT_blend_minmax))
	{
		flag = true;
		LGLP(glBlendEquationEXT);
		LGLTRACE(GL_EXT_blend_minmax);
	}
	else
		RGLP(glBlendEquationEXT);
	EXTTRACE(GL_EXT_blend_subtract);
	EXTTRACE(GL_SGIS_generate_mipmap);
	EXTTRACE(GL_NV_blend_square);
	if(HAVE_EXT(GL_EXT_fog_coord))
	{
		flag = true;
		LGLP(glFogCoordfEXT);
		LGLP(glFogCoordfvEXT);
		LGLP(glFogCoorddEXT);
		LGLP(glFogCoorddvEXT);
		LGLP(glFogCoordPointerEXT);
		LGLTRACE(GL_EXT_fog_coord);
	}
	else
	{
		RGLP(glFogCoordfEXT);
		RGLP(glFogCoordfvEXT);
		RGLP(glFogCoorddEXT);
		RGLP(glFogCoorddvEXT);
		RGLP(glFogCoordPointerEXT);
	}
	if(HAVE_EXT(GL_EXT_multi_draw_arrays))
	{
		flag = true;
		LGLP(glMultiDrawArraysEXT);
		LGLP(glMultiDrawElementsEXT);
		LGLTRACE(GL_EXT_multi_draw_arrays);
	}
	else
	{
		RGLP(glMultiDrawArraysEXT);
		RGLP(glMultiDrawElementsEXT);
	}
	if(HAVE_EXT(GL_EXT_secondary_color))
	{
		flag = true;
		LGLP(glSecondaryColor3bEXT);
		LGLP(glSecondaryColor3bvEXT);
		LGLP(glSecondaryColor3dEXT);
		LGLP(glSecondaryColor3dvEXT);
		LGLP(glSecondaryColor3fEXT);
		LGLP(glSecondaryColor3fvEXT);
		LGLP(glSecondaryColor3iEXT);
		LGLP(glSecondaryColor3ivEXT);
		LGLP(glSecondaryColor3sEXT);
		LGLP(glSecondaryColor3svEXT);
		LGLP(glSecondaryColor3ubEXT);
		LGLP(glSecondaryColor3ubvEXT);
		LGLP(glSecondaryColor3uiEXT);
		LGLP(glSecondaryColor3uivEXT);
		LGLP(glSecondaryColor3usEXT);
		LGLP(glSecondaryColor3usvEXT);
		LGLP(glSecondaryColorPointerEXT);
		LGLTRACE(GL_EXT_secondary_color);
	}
	else
	{
		RGLP(glSecondaryColor3bEXT);
		RGLP(glSecondaryColor3bvEXT);
		RGLP(glSecondaryColor3dEXT);
		RGLP(glSecondaryColor3dvEXT);
		RGLP(glSecondaryColor3fEXT);
		RGLP(glSecondaryColor3fvEXT);
		RGLP(glSecondaryColor3iEXT);
		RGLP(glSecondaryColor3ivEXT);
		RGLP(glSecondaryColor3sEXT);
		RGLP(glSecondaryColor3svEXT);
		RGLP(glSecondaryColor3ubEXT);
		RGLP(glSecondaryColor3ubvEXT);
		RGLP(glSecondaryColor3uiEXT);
		RGLP(glSecondaryColor3uivEXT);
		RGLP(glSecondaryColor3usEXT);
		RGLP(glSecondaryColor3usvEXT);
		RGLP(glSecondaryColorPointerEXT);
	}
	if(HAVE_EXT(GL_EXT_blend_func_separate))
	{
		flag = true;
		LGLP(glBlendFuncSeparateEXT);
		LGLTRACE(GL_EXT_blend_func_separate);
	}
	else
		RGLP(glBlendFuncSeparateEXT);
	EXTTRACE(GL_EXT_stencil_wrap);
	EXTTRACE(GL_EXT_texture_lod_bias);
	EXTTRACE(GL_EXT_shadow_funcs);
	if(HAVE_EXT(GL_EXT_stencil_two_side))
	{
		flag = true;
		LGLP(glActiveStencilFaceEXT);
		LGLTRACE(GL_EXT_stencil_two_side);
	}
	else
		RGLP(glActiveStencilFaceEXT);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * OpenGL 1.2.
 */

GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBlendColor)) (GLclampf, GLclampf, GLclampf, GLclampf);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBlendEquation)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDrawRangeElements)) (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glTexImage3D)) (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glTexSubImage3D)) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCopyTexSubImage3D)) (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glColorTable)) (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glColorTableParameterfv)) (GLenum, GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glColorTableParameteriv)) (GLenum, GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCopyColorTable)) (GLenum, GLenum, GLint, GLint, GLsizei);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetColorTable)) (GLenum, GLenum, GLenum, GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetColorTableParameterfv)) (GLenum, GLenum, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetColorTableParameteriv)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glColorSubTable)) (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCopyColorSubTable)) (GLenum, GLsizei, GLint, GLint, GLsizei);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glConvolutionFilter1D)) (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glConvolutionFilter2D)) (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glConvolutionParameterf)) (GLenum, GLenum, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glConvolutionParameterfv)) (GLenum, GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glConvolutionParameteri)) (GLenum, GLenum, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glConvolutionParameteriv)) (GLenum, GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCopyConvolutionFilter1D)) (GLenum, GLenum, GLint, GLint, GLsizei);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCopyConvolutionFilter2D)) (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetConvolutionFilter)) (GLenum, GLenum, GLenum, GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetConvolutionParameterfv)) (GLenum, GLenum, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetConvolutionParameteriv)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetSeparableFilter)) (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSeparableFilter2D)) (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetHistogram)) (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetHistogramParameterfv)) (GLenum, GLenum, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetHistogramParameteriv)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetMinmax)) (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetMinmaxParameterfv)) (GLenum, GLenum, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetMinmaxParameteriv)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glHistogram)) (GLenum, GLsizei, GLenum, GLboolean);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMinmax)) (GLenum, GLenum, GLboolean);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glResetHistogram)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glResetMinmax)) (GLenum);

#ifdef	DLL_TARGET_DCC

VGLEXTAPI void VGLEXTAPIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
	(*GLPTR(glBlendColor))(red, green, blue, alpha);
}

VGLEXTAPI void VGLEXTAPIENTRY glBlendEquation (GLenum mode)
{
	(*GLPTR(glBlendEquation))(mode);
}

VGLEXTAPI void VGLEXTAPIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
{
	(*GLPTR(glDrawRangeElements))(mode, start, end, count, type, indices);
}

VGLEXTAPI void VGLEXTAPIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
	(*GLPTR(glTexImage3D))(target, level, internalformat, width, height, depth, border, format, type, pixels);
}

VGLEXTAPI void VGLEXTAPIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
{
	(*GLPTR(glTexSubImage3D))(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
}

VGLEXTAPI void VGLEXTAPIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
	(*GLPTR(glCopyTexSubImage3D))(target, level, xoffset, yoffset, zoffset, x, y, width, height);
}

VGLEXTAPI void VGLEXTAPIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *data)
{
	(*GLPTR(glColorTable))(target, internalformat, width, format, type, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params)
{
	(*GLPTR(glColorTableParameterfv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params)
{
	(*GLPTR(glColorTableParameteriv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
	(*GLPTR(glCopyColorTable))(target, internalformat, x, y, width);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table)
{
	(*GLPTR(glGetColorTable))(target, format, type, table);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params)
{
	(*GLPTR(glGetColorTableParameterfv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetColorTableParameteriv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
{
	(*GLPTR(glColorSubTable))(target, start, count, format, type, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei count)
{
	(*GLPTR(glCopyColorSubTable))(target, start, x, y, count);
}

VGLEXTAPI void VGLEXTAPIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *data)
{
	(*GLPTR(glConvolutionFilter1D))(target, internalformat, width, format, type, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data)
{
	(*GLPTR(glConvolutionFilter2D))(target, internalformat, width, height, format, type, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat param)
{
	(*GLPTR(glConvolutionParameterf))(target, pname, param);
}

VGLEXTAPI void VGLEXTAPIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params)
{
	(*GLPTR(glConvolutionParameterfv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint param)
{
	(*GLPTR(glConvolutionParameteri))(target, pname, param);
}

VGLEXTAPI void VGLEXTAPIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params)
{
	(*GLPTR(glConvolutionParameteriv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
	(*GLPTR(glCopyConvolutionFilter1D))(target, internalformat, x, y, width);
}

VGLEXTAPI void VGLEXTAPIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
{
	(*GLPTR(glCopyConvolutionFilter2D))(target, internalformat, x, y, width, height);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image)
{
	(*GLPTR(glGetConvolutionFilter))(target, format, type, image);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params)
{
	(*GLPTR(glGetConvolutionParameterfv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetConvolutionParameteriv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
{
	(*GLPTR(glGetSeparableFilter))(target, format, type, row, column, span);
}

VGLEXTAPI void VGLEXTAPIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
{
	(*GLPTR(glSeparableFilter2D))(target, internalformat, width, height, format, type, row, column);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
{
	(*GLPTR(glGetHistogram))(target, reset, format, type, values);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params)
{
	(*GLPTR(glGetHistogramParameterfv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetHistogramParameteriv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
{
	(*GLPTR(glGetMinmax))(target, reset, format, type, values);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params)
{
	(*GLPTR(glGetMinmaxParameterfv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetMinmaxParameteriv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
{
	(*GLPTR(glHistogram))(target, width, internalformat, sink);
}

VGLEXTAPI void VGLEXTAPIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink)
{
	(*GLPTR(glMinmax))(target, internalformat, sink);
}

VGLEXTAPI void VGLEXTAPIENTRY glResetHistogram (GLenum target)
{
	(*GLPTR(glResetHistogram))(target);
}

VGLEXTAPI void VGLEXTAPIENTRY glResetMinmax (GLenum target)
{
	(*GLPTR(glResetMinmax))(target);
}

#endif	/* !DLL_TARGET_DCC */

V_LOCAL vboolean
vgl_init_gl_1_2(vboolean *terminate)
{
	vboolean flag = true;
	if(HAVE_EXT(GL_ARB_imaging))
	{
		LGLP(glColorTable);
		LGLP(glColorTableParameterfv);
		LGLP(glColorTableParameteriv);
		LGLP(glCopyColorTable);
		LGLP(glGetColorTable);
		LGLP(glGetColorTableParameterfv);
		LGLP(glGetColorTableParameteriv);
		LGLP(glColorSubTable);
		LGLP(glCopyColorSubTable);
		LGLP(glConvolutionFilter1D);
		LGLP(glConvolutionFilter2D);
		LGLP(glConvolutionParameterf);
		LGLP(glConvolutionParameterfv);
		LGLP(glConvolutionParameteri);
		LGLP(glConvolutionParameteriv);
		LGLP(glCopyConvolutionFilter1D);
		LGLP(glCopyConvolutionFilter2D);
		LGLP(glGetConvolutionFilter);
		LGLP(glGetConvolutionParameterfv);
		LGLP(glGetConvolutionParameteriv);
		LGLP(glGetSeparableFilter);
		LGLP(glSeparableFilter2D);
		LGLP(glGetHistogram);
		LGLP(glGetHistogramParameterfv);
		LGLP(glGetHistogramParameteriv);
		LGLP(glGetMinmax);
		LGLP(glGetMinmaxParameterfv);
		LGLP(glGetMinmaxParameteriv);
		LGLP(glHistogram);
		LGLP(glMinmax);
		LGLP(glResetHistogram);
		LGLP(glResetMinmax);
	}
	else
		conlPuts(LOG_TRACE,"Warning: GL_ARB_imaging not supported.");
	LGLP(glBlendColor);
	LGLP(glBlendEquation);
	LGLP(glDrawRangeElements);
	LGLP(glTexImage3D);
	LGLP(glTexSubImage3D);
	LGLP(glCopyTexSubImage3D);
	if(*terminate)
		return false;
	conlPrintf(LOG_TRACE,"OpenGL 1.2 %s.\n",
		flag ? "initialized" : "failed to initialize");
	return flag;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * OpenGL 1.3.
 */

GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glActiveTexture)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glClientActiveTexture)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1d)) (GLenum, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1dv)) (GLenum, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1f)) (GLenum, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1fv)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1i)) (GLenum, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1iv)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1s)) (GLenum, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord1sv)) (GLenum, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2d)) (GLenum, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2dv)) (GLenum, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2f)) (GLenum, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2fv)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2i)) (GLenum, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2iv)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2s)) (GLenum, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord2sv)) (GLenum, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3d)) (GLenum, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3dv)) (GLenum, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3f)) (GLenum, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3fv)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3i)) (GLenum, GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3iv)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3s)) (GLenum, GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord3sv)) (GLenum, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4d)) (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4dv)) (GLenum, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4f)) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4fv)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4i)) (GLenum, GLint, GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4iv)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4s)) (GLenum, GLshort, GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiTexCoord4sv)) (GLenum, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glLoadTransposeMatrixf)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glLoadTransposeMatrixd)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultTransposeMatrixf)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultTransposeMatrixd)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSampleCoverage)) (GLclampf, GLboolean);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexImage3D)) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexImage2D)) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexImage1D)) (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexSubImage3D)) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexSubImage2D)) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompressedTexSubImage1D)) (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetCompressedTexImage)) (GLenum, GLint, GLvoid *);

#ifdef	DLL_TARGET_DCC

VGLEXTAPI void VGLEXTAPIENTRY glActiveTexture (GLenum texture)
{
	(*GLPTR(glActiveTexture))(texture);
}

VGLEXTAPI void VGLEXTAPIENTRY glClientActiveTexture (GLenum texture)
{
	(*GLPTR(glClientActiveTexture))(texture);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1d (GLenum texture, GLdouble s)
{
	(*GLPTR(glMultiTexCoord1d))(texture, s);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1dv (GLenum texture, const GLdouble *v)
{
	(*GLPTR(glMultiTexCoord1dv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1f (GLenum texture, GLfloat s)
{
	(*GLPTR(glMultiTexCoord1f))(texture, s);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1fv (GLenum texture, const GLfloat *v)
{
	(*GLPTR(glMultiTexCoord1fv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1i (GLenum texture, GLint s)
{
	(*GLPTR(glMultiTexCoord1i))(texture, s);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1iv (GLenum texture, const GLint *v)
{
	(*GLPTR(glMultiTexCoord1iv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1s (GLenum texture, GLshort s)
{
	(*GLPTR(glMultiTexCoord1s))(texture, s);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord1sv (GLenum texture, const GLshort *v)
{
	(*GLPTR(glMultiTexCoord1sv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2d (GLenum texture, GLdouble s, GLdouble t)
{
	(*GLPTR(glMultiTexCoord2d))(texture, s, t);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2dv (GLenum texture, const GLdouble *v)
{
	(*GLPTR(glMultiTexCoord2dv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2f(GLenum texture, GLfloat s, GLfloat t)
{
	(*GLPTR(glMultiTexCoord2f))(texture, s, t);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2fv (GLenum texture, const GLfloat *v)
{
	(*GLPTR(glMultiTexCoord2fv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2i (GLenum texture, GLint s, GLint t)
{
	(*GLPTR(glMultiTexCoord2i))(texture, s, t);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2iv (GLenum texture, const GLint *v)
{
	(*GLPTR(glMultiTexCoord2iv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2s (GLenum texture, GLshort s, GLshort t)
{
	(*GLPTR(glMultiTexCoord2s))(texture, s, t);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord2sv (GLenum texture, const GLshort *v)
{
	(*GLPTR(glMultiTexCoord2sv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3d (GLenum texture, GLdouble s, GLdouble t, GLdouble p)
{
	(*GLPTR(glMultiTexCoord3d))(texture, s, t, p);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3dv (GLenum texture, const GLdouble *v)
{
	(*GLPTR(glMultiTexCoord3dv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3f (GLenum texture, GLfloat s, GLfloat t, GLfloat p)
{
	(*GLPTR(glMultiTexCoord3f))(texture, s, t, p);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3fv (GLenum texture, const GLfloat *v)
{
	(*GLPTR(glMultiTexCoord3fv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3i (GLenum texture, GLint s, GLint t, GLint p)
{
	(*GLPTR(glMultiTexCoord3i))(texture, s, t, p);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3iv (GLenum texture, const GLint *v)
{
	(*GLPTR(glMultiTexCoord3iv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3s (GLenum texture, GLshort s, GLshort t, GLshort p)
{
	(*GLPTR(glMultiTexCoord3s))(texture, s, t, p);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord3sv (GLenum texture, const GLshort *v)
{
	(*GLPTR(glMultiTexCoord3sv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4d (GLenum texture, GLdouble s, GLdouble t, GLdouble p, GLdouble q)
{
	(*GLPTR(glMultiTexCoord4d))(texture, s, t, p, q);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4dv (GLenum texture, const GLdouble *v)
{
	(*GLPTR(glMultiTexCoord4dv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4f (GLenum texture, GLfloat s, GLfloat t, GLfloat p, GLfloat q)
{
	(*GLPTR(glMultiTexCoord4f))(texture, s, t, p, q);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4fv (GLenum texture, const GLfloat *v)
{
	(*GLPTR(glMultiTexCoord4fv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4i (GLenum texture, GLint s, GLint t, GLint p, GLint q)
{
	(*GLPTR(glMultiTexCoord4i))(texture, s, t, p, q);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4iv (GLenum texture, const GLint *v)
{
	(*GLPTR(glMultiTexCoord4iv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4s (GLenum texture, GLshort s, GLshort t, GLshort p, GLshort q)
{
	(*GLPTR(glMultiTexCoord4s))(texture, s, t, p, q);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiTexCoord4sv (GLenum texture, const GLshort *v)
{
	(*GLPTR(glMultiTexCoord4sv))(texture, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexImage3D(GLenum target, GLint level,
	GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth,
	GLint border, GLsizei imageSize,
	const GLvoid *data)
{
	(*GLPTR(glCompressedTexImage3D))(target, level, internalformat, width, height,
		depth, border, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexImage2D(GLenum target, GLint level,
	GLenum internalformat, GLsizei width, GLsizei height,
	GLint border, GLsizei imageSize,
	const GLvoid *data)
{
	(*GLPTR(glCompressedTexImage2D))(target, level, internalformat, width, height,
		border, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexImage1D (GLenum target, GLint level,
	GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
{
	(*GLPTR(glCompressedTexImage1D))(target, level, internalformat, width, border, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexSubImage3D (GLenum target, GLint level,
	GLint xoffset, GLint yoffset, GLint zoffset,
	GLsizei width, GLsizei height, GLsizei depth,
	GLenum format, GLsizei imageSize, const GLvoid *data)
{
	(*GLPTR(glCompressedTexSubImage3D))(target, level, xoffset, yoffset, zoffset,
		width, height, depth, format, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexSubImage2D (GLenum target, GLint level,
	GLint xoffset, GLint yoffset,
	GLsizei width, GLsizei height,
	GLenum format, GLsizei imageSize, const GLvoid *data)
{
	(*GLPTR(glCompressedTexSubImage2D))(target, level, xoffset, yoffset,
		width, height, format, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompressedTexSubImage1D (GLenum target, GLint level,
	GLint xoffset, GLsizei width,
	GLenum format, GLsizei imageSize, const GLvoid *data)
{
	(*GLPTR(glCompressedTexSubImage1D))(target, level, xoffset, width, format, imageSize, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetCompressedTexImage (GLenum target, GLint lod, GLvoid *img)
{
	(*GLPTR(glGetCompressedTexImage))(target, lod, img);
}


VGLEXTAPI void VGLEXTAPIENTRY glSampleCoverage (GLclampf value, GLboolean invert)
{
	(*GLPTR(glSampleCoverage))(value, invert);
}

VGLEXTAPI void VGLEXTAPIENTRY glLoadTransposeMatrixf (const GLfloat *m)
{
	(*GLPTR(glLoadTransposeMatrixf))(m);
}

VGLEXTAPI void VGLEXTAPIENTRY glLoadTransposeMatrixd (const GLdouble *m)
{
	(*GLPTR(glLoadTransposeMatrixd))(m);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultTransposeMatrixf (const GLfloat *m)
{
	(*GLPTR(glMultTransposeMatrixf))(m);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultTransposeMatrixd (const GLdouble *m)
{
	(*GLPTR(glMultTransposeMatrixd))(m);
}

#endif	/* !DLL_TARGET_DCC */

V_LOCAL vboolean
vgl_init_gl_1_3(vboolean *terminate)
{
	vboolean flag = true;
	LGLP(glActiveTexture);
	LGLP(glClientActiveTexture);
	LGLP(glMultiTexCoord1d);
	LGLP(glMultiTexCoord1dv);
	LGLP(glMultiTexCoord1f);
	LGLP(glMultiTexCoord1fv);
	LGLP(glMultiTexCoord1i);
	LGLP(glMultiTexCoord1iv);
	LGLP(glMultiTexCoord1s);
	LGLP(glMultiTexCoord1sv);
	LGLP(glMultiTexCoord2d);
	LGLP(glMultiTexCoord2dv);
	LGLP(glMultiTexCoord2f);
	LGLP(glMultiTexCoord2fv);
	LGLP(glMultiTexCoord2i);
	LGLP(glMultiTexCoord2iv);
	LGLP(glMultiTexCoord2s);
	LGLP(glMultiTexCoord2sv);
	LGLP(glMultiTexCoord3d);
	LGLP(glMultiTexCoord3dv);
	LGLP(glMultiTexCoord3f);
	LGLP(glMultiTexCoord3fv);
	LGLP(glMultiTexCoord3i);
	LGLP(glMultiTexCoord3iv);
	LGLP(glMultiTexCoord3s);
	LGLP(glMultiTexCoord3sv);
	LGLP(glMultiTexCoord4d);
	LGLP(glMultiTexCoord4dv);
	LGLP(glMultiTexCoord4f);
	LGLP(glMultiTexCoord4fv);
	LGLP(glMultiTexCoord4i);
	LGLP(glMultiTexCoord4iv);
	LGLP(glMultiTexCoord4s);
	LGLP(glMultiTexCoord4sv);
	LGLP(glLoadTransposeMatrixf);
	LGLP(glLoadTransposeMatrixd);
	LGLP(glMultTransposeMatrixf);
	LGLP(glMultTransposeMatrixd);
	LGLP(glSampleCoverage);
	LGLP(glCompressedTexImage3D);
	LGLP(glCompressedTexImage2D);
	LGLP(glCompressedTexImage1D);
	LGLP(glCompressedTexSubImage3D);
	LGLP(glCompressedTexSubImage2D);
	LGLP(glCompressedTexSubImage1D);
	LGLP(glGetCompressedTexImage);
	if(*terminate)
		return false;
	conlPrintf(LOG_TRACE,"OpenGL 1.3 %s.\n",
		flag ? "initialized" : "failed to initialize");
	return flag;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * OpenGL 1.4.
 */

GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBlendFuncSeparate)) (GLenum, GLenum, GLenum, GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoordf)) (GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoordfv)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoordd)) (GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoorddv)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glFogCoordPointer)) (GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiDrawArrays)) (GLenum, GLint *, GLsizei *, GLsizei);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glMultiDrawElements)) (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glPointParameterf)) (GLenum, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glPointParameterfv)) (GLenum, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glPointParameteri)) (GLenum, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glPointParameteriv)) (GLenum, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3b)) (GLbyte, GLbyte, GLbyte);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3bv)) (const GLbyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3d)) (GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3dv)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3f)) (GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3fv)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3i)) (GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3iv)) (const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3s)) (GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3sv)) (const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3ub)) (GLubyte, GLubyte, GLubyte);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3ubv)) (const GLubyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3ui)) (GLuint, GLuint, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3uiv)) (const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3us)) (GLushort, GLushort, GLushort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColor3usv)) (const GLushort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glSecondaryColorPointer)) (GLint, GLenum, GLsizei, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2d)) (GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2dv)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2f)) (GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2fv)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2i)) (GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2iv)) (const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2s)) (GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos2sv)) (const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3d)) (GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3dv)) (const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3f)) (GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3fv)) (const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3i)) (GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3iv)) (const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3s)) (GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glWindowPos3sv)) (const GLshort *);

#ifdef	DLL_TARGET_DCC

VGLEXTAPI void VGLEXTAPIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
	(*GLPTR(glBlendFuncSeparate))(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoordf (GLfloat v)
{
	(*GLPTR(glFogCoordf))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoordfv (const GLfloat *v)
{
	(*GLPTR(glFogCoordfv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoordd (GLdouble v)
{
	(*GLPTR(glFogCoordd))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoorddv (const GLdouble *v)
{
	(*GLPTR(glFogCoorddv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer)
{
	(*GLPTR(glFogCoordPointer))(type, stride, pointer);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiDrawArrays (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount)
{
	(*GLPTR(glMultiDrawArrays))(mode, first, count, primcount);
}

VGLEXTAPI void VGLEXTAPIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)
{
	(*GLPTR(glMultiDrawElements))(mode, count, type, indices, primcount);
}

VGLEXTAPI void VGLEXTAPIENTRY glPointParameterf (GLenum pname, GLfloat param)
{
	(*GLPTR(glPointParameterf))(pname, param);
}

VGLEXTAPI void VGLEXTAPIENTRY glPointParameterfv (GLenum pname, const GLfloat *params)
{
	(*GLPTR(glPointParameterfv))(pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glPointParameteri (GLenum pname, GLint param)
{
	(*GLPTR(glPointParameteri))(pname, param);
}

VGLEXTAPI void VGLEXTAPIENTRY glPointParameteriv (GLenum pname, const GLint *params)
{
	(*GLPTR(glPointParameteriv))(pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3b (GLbyte r, GLbyte g, GLbyte b)
{
	(*GLPTR(glSecondaryColor3b))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3bv (const GLbyte *v)
{
	(*GLPTR(glSecondaryColor3bv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3d (GLdouble r, GLdouble g, GLdouble b)
{
	(*GLPTR(glSecondaryColor3d))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3dv (const GLdouble *v)
{
	(*GLPTR(glSecondaryColor3dv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3f (GLfloat r, GLfloat g, GLfloat b)
{
	(*GLPTR(glSecondaryColor3f))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3fv (const GLfloat *v)
{
	(*GLPTR(glSecondaryColor3fv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3i (GLint r, GLint g, GLint b)
{
	(*GLPTR(glSecondaryColor3i))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3iv (const GLint *v)
{
	(*GLPTR(glSecondaryColor3iv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3s (GLshort r, GLshort g, GLshort b)
{
	(*GLPTR(glSecondaryColor3s))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3sv (const GLshort *v)
{
	(*GLPTR(glSecondaryColor3sv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3ub (GLubyte r, GLubyte g, GLubyte b)
{
	(*GLPTR(glSecondaryColor3ub))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3ubv (const GLubyte *v)
{
	(*GLPTR(glSecondaryColor3ubv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3ui (GLuint r, GLuint g, GLuint b)
{
	(*GLPTR(glSecondaryColor3ui))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3uiv (const GLuint *v)
{
	(*GLPTR(glSecondaryColor3uiv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3us (GLushort r, GLushort g, GLushort b)
{
	(*GLPTR(glSecondaryColor3us))(r, g, b);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColor3usv (const GLushort *v)
{
	(*GLPTR(glSecondaryColor3usv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
{
	(*GLPTR(glSecondaryColorPointer))(size, type, stride, pointer);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2d (GLdouble x, GLdouble y)
{
	(*GLPTR(glWindowPos2d))(x, y);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2dv (const GLdouble *v)
{
	(*GLPTR(glWindowPos2dv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2f (GLfloat x, GLfloat y)
{
	(*GLPTR(glWindowPos2f))(x, y);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2fv (const GLfloat *v)
{
	(*GLPTR(glWindowPos2fv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2i (GLint x, GLint y)
{
	(*GLPTR(glWindowPos2i))(x, y);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2iv (const GLint *v)
{
	(*GLPTR(glWindowPos2iv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2s (GLshort x, GLshort y)
{
	(*GLPTR(glWindowPos2s))(x, y);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos2sv (const GLshort *v)
{
	(*GLPTR(glWindowPos2sv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z)
{
	(*GLPTR(glWindowPos3d))(x, y, z);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3dv (const GLdouble *v)
{
	(*GLPTR(glWindowPos3dv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z)
{
	(*GLPTR(glWindowPos3f))(x, y, z);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3fv (const GLfloat *v)
{
	(*GLPTR(glWindowPos3fv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3i (GLint x, GLint y, GLint z)
{
	(*GLPTR(glWindowPos3i))(x, y, z);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3iv (const GLint *v)
{
	(*GLPTR(glWindowPos3iv))(v);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z)
{
	(*GLPTR(glWindowPos3s))(x, y, z);
}

VGLEXTAPI void VGLEXTAPIENTRY glWindowPos3sv (const GLshort *v)
{
	(*GLPTR(glWindowPos3sv))(v);
}

#endif	/* !DLL_TARGET_DCC */

V_LOCAL vboolean
vgl_init_gl_1_4(vboolean *terminate)
{
	vboolean flag = true;
	LGLP(glBlendFuncSeparate);
	LGLP(glFogCoordf);
	LGLP(glFogCoordfv);
	LGLP(glFogCoordd);
	LGLP(glFogCoorddv);
	LGLP(glFogCoordPointer);
	LGLP(glMultiDrawArrays);
	LGLP(glMultiDrawElements);
	LGLP(glPointParameterf);
	LGLP(glPointParameterfv);
	LGLP(glPointParameteri);
	LGLP(glPointParameteriv);
	LGLP(glSecondaryColor3b);
	LGLP(glSecondaryColor3bv);
	LGLP(glSecondaryColor3d);
	LGLP(glSecondaryColor3dv);
	LGLP(glSecondaryColor3f);
	LGLP(glSecondaryColor3fv);
	LGLP(glSecondaryColor3i);
	LGLP(glSecondaryColor3iv);
	LGLP(glSecondaryColor3s);
	LGLP(glSecondaryColor3sv);
	LGLP(glSecondaryColor3ub);
	LGLP(glSecondaryColor3ubv);
	LGLP(glSecondaryColor3ui);
	LGLP(glSecondaryColor3uiv);
	LGLP(glSecondaryColor3us);
	LGLP(glSecondaryColor3usv);
	LGLP(glSecondaryColorPointer);
	LGLP(glWindowPos2d);
	LGLP(glWindowPos2dv);
	LGLP(glWindowPos2f);
	LGLP(glWindowPos2fv);
	LGLP(glWindowPos2i);
	LGLP(glWindowPos2iv);
	LGLP(glWindowPos2s);
	LGLP(glWindowPos2sv);
	LGLP(glWindowPos3d);
	LGLP(glWindowPos3dv);
	LGLP(glWindowPos3f);
	LGLP(glWindowPos3fv);
	LGLP(glWindowPos3i);
	LGLP(glWindowPos3iv);
	LGLP(glWindowPos3s);
	LGLP(glWindowPos3sv);
	if(*terminate)
		return false;
	conlPrintf(LOG_TRACE,"OpenGL 1.4 %s.\n",
		flag ? "initialized" : "failed to initialize");
	return flag;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * OpenGL 1.5.
 */

GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGenQueries)) (GLsizei, GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDeleteQueries)) (GLsizei, const GLuint *);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glIsQuery)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBeginQuery)) (GLenum, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glEndQuery)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetQueryiv)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetQueryObjectiv)) (GLuint, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetQueryObjectuiv)) (GLuint, GLenum, GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBindBuffer)) (GLenum, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDeleteBuffers)) (GLsizei, const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGenBuffers)) (GLsizei, GLuint *);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glIsBuffer)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBufferData)) (GLenum, GLsizeiptr, const GLvoid *, GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBufferSubData)) (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetBufferSubData)) (GLenum, GLintptr, GLsizeiptr, GLvoid *);
GLPTR_LNK GLvoid* (VGLEXTAPIENTRY *GLPTR(glMapBuffer)) (GLenum, GLenum);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glUnmapBuffer)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetBufferParameteriv)) (GLenum, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetBufferPointerv)) (GLenum, GLenum, GLvoid* *);

#ifdef	DLL_TARGET_DCC

VGLEXTAPI void VGLEXTAPIENTRY glGenQueries (GLsizei n, GLuint *ids)
{
	(*GLPTR(glGenQueries))(n, ids);
}

VGLEXTAPI void VGLEXTAPIENTRY glDeleteQueries (GLsizei n, const GLuint *ids)
{
	(*GLPTR(glDeleteQueries))(n, ids);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glIsQuery (GLuint id)
{
	return (*GLPTR(glIsQuery))(id);
}

VGLEXTAPI void VGLEXTAPIENTRY glBeginQuery (GLenum target, GLuint id)
{
	(*GLPTR(glBeginQuery))(target, id);
}

VGLEXTAPI void VGLEXTAPIENTRY glEndQuery (GLenum target)
{
	(*GLPTR(glEndQuery))(target);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetQueryiv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params)
{
	(*GLPTR(glGetQueryObjectiv))(id, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params)
{
	(*GLPTR(glGetQueryObjectuiv))(id, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glBindBuffer (GLenum target, GLuint buffer)
{
	(*GLPTR(glBindBuffer))(target, buffer);
}

VGLEXTAPI void VGLEXTAPIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers)
{
	(*GLPTR(glDeleteBuffers))(n, buffers);
}

VGLEXTAPI void VGLEXTAPIENTRY glGenBuffers (GLsizei n, GLuint *buffers)
{
	(*GLPTR(glGenBuffers))(n, buffers);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glIsBuffer (GLuint buffer)
{
	return (*GLPTR(glIsBuffer))(buffer);
}

VGLEXTAPI void VGLEXTAPIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
{
	(*GLPTR(glBufferData))(target, size, data, usage);
}

VGLEXTAPI void VGLEXTAPIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
{
	(*GLPTR(glBufferSubData))(target, offset, size, data);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)
{
	(*GLPTR(glGetBufferSubData))(target, offset, size, data);
}

VGLEXTAPI GLvoid* VGLEXTAPIENTRY glMapBuffer (GLenum target, GLenum access)
{
	return (*GLPTR(glMapBuffer))(target, access);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glUnmapBuffer (GLenum target)
{
	return (*GLPTR(glUnmapBuffer))(target);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetBufferParameteriv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid **params)
{
	(*GLPTR(glGetBufferPointerv))(target, pname, params);
}

#endif	/* !DLL_TARGET_DCC */

V_LOCAL vboolean
vgl_init_gl_1_5(vboolean *terminate)
{
	vboolean flag = true;
	LGLP(glGenQueries);
	LGLP(glDeleteQueries);
	LGLP(glIsQuery);
	LGLP(glBeginQuery);
	LGLP(glEndQuery);
	LGLP(glGetQueryiv);
	LGLP(glGetQueryObjectiv);
	LGLP(glGetQueryObjectuiv);
	LGLP(glBindBuffer);
	LGLP(glDeleteBuffers);
	LGLP(glGenBuffers);
	LGLP(glIsBuffer);
	LGLP(glBufferData);
	LGLP(glBufferSubData);
	LGLP(glGetBufferSubData);
	LGLP(glMapBuffer);
	LGLP(glUnmapBuffer);
	LGLP(glGetBufferParameteriv);
	LGLP(glGetBufferPointerv);
	if(*terminate)
		return false;
	conlPrintf(LOG_TRACE,
		"OpenGL 1.5 %s.\n",flag ? "initialized" : "failed to initialize");
	return flag;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * OpenGL 2.0.
 */

GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBlendEquationSeparate)) (GLenum, GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDrawBuffers)) (GLsizei, const GLenum *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glStencilOpSeparate)) (GLenum, GLenum, GLenum, GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glStencilFuncSeparate)) (GLenum, GLenum, GLint, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glStencilMaskSeparate)) (GLenum, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glAttachShader)) (GLuint, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glBindAttribLocation)) (GLuint, GLuint, const GLchar *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glCompileShader)) (GLuint);
GLPTR_LNK GLuint (VGLEXTAPIENTRY *GLPTR(glCreateProgram)) (void);
GLPTR_LNK GLuint (VGLEXTAPIENTRY *GLPTR(glCreateShader)) (GLenum);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDeleteProgram)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDeleteShader)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDetachShader)) (GLuint, GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glDisableVertexAttribArray)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glEnableVertexAttribArray)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetActiveAttrib)) (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetActiveUniform)) (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetAttachedShaders)) (GLuint, GLsizei, GLsizei *, GLuint *);
GLPTR_LNK GLint (VGLEXTAPIENTRY *GLPTR(glGetAttribLocation)) (GLuint, const GLchar *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetProgramiv)) (GLuint, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetProgramInfoLog)) (GLuint, GLsizei, GLsizei *, GLchar *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetShaderiv)) (GLuint, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetShaderInfoLog)) (GLuint, GLsizei, GLsizei *, GLchar *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetShaderSource)) (GLuint, GLsizei, GLsizei *, GLchar *);
GLPTR_LNK GLint (VGLEXTAPIENTRY *GLPTR(glGetUniformLocation)) (GLuint, const GLchar *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetUniformfv)) (GLuint, GLint, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetUniformiv)) (GLuint, GLint, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetVertexAttribdv)) (GLuint, GLenum, GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetVertexAttribfv)) (GLuint, GLenum, GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetVertexAttribiv)) (GLuint, GLenum, GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glGetVertexAttribPointerv)) (GLuint, GLenum, GLvoid* *);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glIsProgram)) (GLuint);
GLPTR_LNK GLboolean (VGLEXTAPIENTRY *GLPTR(glIsShader)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glLinkProgram)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glShaderSource)) (GLuint, GLsizei, const GLchar* *, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUseProgram)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform1f)) (GLint, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform2f)) (GLint, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform3f)) (GLint, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform4f)) (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform1i)) (GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform2i)) (GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform3i)) (GLint, GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform4i)) (GLint, GLint, GLint, GLint, GLint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform1fv)) (GLint, GLsizei, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform2fv)) (GLint, GLsizei, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform3fv)) (GLint, GLsizei, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform4fv)) (GLint, GLsizei, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform1iv)) (GLint, GLsizei, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform2iv)) (GLint, GLsizei, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform3iv)) (GLint, GLsizei, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniform4iv)) (GLint, GLsizei, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniformMatrix2fv)) (GLint, GLsizei, GLboolean, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniformMatrix3fv)) (GLint, GLsizei, GLboolean, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glUniformMatrix4fv)) (GLint, GLsizei, GLboolean, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glValidateProgram)) (GLuint);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1d)) (GLuint, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1dv)) (GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1f)) (GLuint, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1fv)) (GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1s)) (GLuint, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib1sv)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2d)) (GLuint, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2dv)) (GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2f)) (GLuint, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2fv)) (GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2s)) (GLuint, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib2sv)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3d)) (GLuint, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3dv)) (GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3f)) (GLuint, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3fv)) (GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3s)) (GLuint, GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib3sv)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4Nbv)) (GLuint, const GLbyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4Niv)) (GLuint, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4Nsv)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4Nub)) (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4Nubv)) (GLuint, const GLubyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4Nuiv)) (GLuint, const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4Nusv)) (GLuint, const GLushort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4bv)) (GLuint, const GLbyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4d)) (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4dv)) (GLuint, const GLdouble *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4f)) (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4fv)) (GLuint, const GLfloat *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4iv)) (GLuint, const GLint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4s)) (GLuint, GLshort, GLshort, GLshort, GLshort);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4sv)) (GLuint, const GLshort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4ubv)) (GLuint, const GLubyte *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4uiv)) (GLuint, const GLuint *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttrib4usv)) (GLuint, const GLushort *);
GLPTR_LNK void (VGLEXTAPIENTRY *GLPTR(glVertexAttribPointer)) (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);

#ifdef	DLL_TARGET_DCC

VGLEXTAPI void VGLEXTAPIENTRY glBlendEquationSeparate(GLenum ?, GLenum ?)
{
	(*GLPTR(glBlendEquationSeparate))(?, ?);
}

VGLEXTAPI void VGLEXTAPIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs)
{
	(*GLPTR(glDrawBuffers))(n, bufs);
}

VGLEXTAPI void VGLEXTAPIENTRY glStencilOpSeparate (GLenum ?, GLenum ?, GLenum ?, GLenum ?)
{
	(*GLPTR(glStencilOpSeparate))(?, ?);
}

VGLEXTAPI void VGLEXTAPIENTRY glStencilFuncSeparate (GLenum ?, GLenum ?, GLint ?, GLuint ?)
{
	(*GLPTR(glStencilFuncSeparate))(?, ?, ?, ?);
}

VGLEXTAPI void (VGLEXTAPIENTRY *glStencilMaskSeparate) (GLenum ?, GLuint ?)
{
	(*GLPTR(glStencilMaskSeparate))(?, ?);
}

VGLEXTAPI void VGLEXTAPIENTRY glAttachShader (GLuint containerObj, GLuint obj)
{
	(*GLPTR(glAttachShader))(containerObj, obj);
}

VGLEXTAPI void VGLEXTAPIENTRY glBindAttribLocation (GLuint programObj, GLuint index, const GLchar *name)
{
	(*GLPTR(glBindAttribLocation))(programObj, index, name);
}

VGLEXTAPI void VGLEXTAPIENTRY glCompileShader (GLuint obj)
{
	(*GLPTR(glCompileShader))(obj);
}

VGLEXTAPI GLuint VGLEXTAPIENTRY glCreateProgram (void)
{
	return (*GLPTR(glCreateProgram))();
}

VGLEXTAPI GLuint VGLEXTAPIENTRY glCreateShader (GLenum ?)
{
	return (*GLPTR(glCreateShader))(?);
}

VGLEXTAPI GLuint VGLEXTAPIENTRY glDeleteProgram (GLuint obj)
{
	(*GLPTR(glDeleteProgram))(obj);
}

VGLEXTAPI GLuint VGLEXTAPIENTRY glDeleteShader (GLuint obj)
{
	(*GLPTR(glDeleteShader))(obj);
}

VGLEXTAPI void VGLEXTAPIENTRY glDetachShader (GLuint containerObj, GLuint obj)
{
	(*GLPTR(glDetachShader))(containerObj, obj);
}

VGLEXTAPI void VGLEXTAPIENTRY glDisableVertexAttribArray (GLuint index)
{
	(*GLPTR(glDisableVertexAttribArray))(index);
}

VGLEXTAPI void VGLEXTAPIENTRY glEnableVertexAttribArray (GLuint index)
{
	(*GLPTR(glEnableVertexAttribArray))(index);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetActiveAttrib (GLuint programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
{
	(*GLPTR(glGetActiveAttrib))(programObj, index, maxLength, length, size, type, name);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetActiveUniform (GLuint programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
{
	(*GLPTR(glGetActiveUniform))(programObj, index, maxLength, length, size, type, name);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetAttachedShaders (GLuint containerObj, GLsizei maxCount, GLsizei *count, GLuint *obj)
{
	(*GLPTR(glGetAttachedShaders))(containerObj, maxCount, count, obj);
}

VGLEXTAPI GLint VGLEXTAPIENTRY glGetAttribLocation (GLhandle programObj, const GLchar *name)
{
	return (*GLPTR(glGetAttribLocation))(programObj, name);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetProgramiv (GLenum target, GLenum pname, GLint *params)
{
	(*GLPTR(glGetProgramiv))(target, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetProgramInfoLog (GLuint obj, GLsizei maxLength, GLsizei *length, GLchar *infoLog)
{
	(*GLPTR(glGetProgramInfoLog))(obj, maxLength, length, infoLog);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetShaderiv (GLuint ?, GLenum ?, GLint * ?)
{
	(*GLPTR(glGetShaderiv))(?, ?, ?);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetShaderInfoLog (GLuint ?, GLsizei ?, GLsizei *?, GLchar *?)
{
	(*GLPTR(glGetShaderInfoLog))(?, ?, ?, ?);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetShaderSource (GLuint obj, GLsizei maxLength, GLsizei *length, GLchar *source)
{
	(*GLPTR(glGetShaderSource))(obj, maxLength, length, source);
}

VGLEXTAPI GLint VGLEXTAPIENTRY glGetUniformLocation (GKuint programObj, const GLchar *name)
{
	return (*GLPTR(glGetUniformLocation))(programObj, name);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetUniformfv (GLuint programObj, GLint location, GLfloat *params)
{
	(*GLPTR(glGetUniformfv))(programObj, location, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetUniformiv (GLuint programObj, GLint location, GLint *params)
{
	(*GLPTR(glGetUniformiv))(programObj, location, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params)
{
	(*GLPTR(glGetVertexAttribdv))(index, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params)
{
	(*GLPTR(glGetVertexAttribfv))(index, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params)
{
	(*GLPTR(glGetVertexAttribiv))(index, pname, params);
}

VGLEXTAPI void VGLEXTAPIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid **pointer)
{
	(*GLPTR(glGetVertexAttribPointerv))(index, pname, pointer);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glIsProgram (GLuint obj)
{
	return (*GLPTR(glIsProgram))(obj);
}

VGLEXTAPI GLboolean VGLEXTAPIENTRY glIsShader (GLuint obj)
{
	return (*GLPTR(glIsShader))(obj);
}

VGLEXTAPI void VGLEXTAPIENTRY glLinkProgram (GLuint programObj)
{
	(*GLPTR(glLinkProgram))(programObj);
}

VGLEXTAPI void VGLEXTAPIENTRY glShaderSource (GLuint shaderObj, GLsizei count,
	const GLchar **src_strings, const GLint *src_lens)
{
	(*GLPTR(glShaderSource))(shaderObj, count, src_strings, src_lens);
}

VGLEXTAPI void VGLEXTAPIENTRY glUseProgram (GLuint programObj)
{
	(*GLPTR(glUseProgram))(programObj);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform1f (GLint location, GLfloat v0)
{
	(*GLPTR(glUniform1f))(location, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1)
{
	(*GLPTR(glUniform2f))(location, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
	(*GLPTR(glUniform3f))(location, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
	(*GLPTR(glUniform4f))(location, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform1i (GLint location, GLint v0)
{
	(*GLPTR(glUniform1i))(location, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform2i (GLint location, GLint v0, GLint v1)
{
	(*GLPTR(glUniform2i))(location, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2)
{
	(*GLPTR(glUniform3i))(location, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
	(*GLPTR(glUniform4i))(location, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value)
{
	(*GLPTR(glUniform1fv))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value)
{
	(*GLPTR(glUniform2fv))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value)
{
	(*GLPTR(glUniform3fv))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value)
{
	(*GLPTR(glUniform4fv))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value)
{
	(*GLPTR(glUniform1iv))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value)
{
	(*GLPTR(glUniform2iv))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value)
{
	(*GLPTR(glUniform3iv))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value)
{
	(*GLPTR(glUniform4iv))(location, count, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
	(*GLPTR(glUniformMatrix2fv))(location, count, transpose, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
	(*GLPTR(glUniformMatrix3fv))(location, count, transpose, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
	(*GLPTR(glUniformMatrix4fv))(location, count, transpose, value);
}

VGLEXTAPI void VGLEXTAPIENTRY glValidateProgram (GLuint programObj)
{
	(*GLPTR(glValidateProgram))(programObj);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1d (GLuint index, GLdouble v0)
{
	(*GLPTR(glVertexAttrib1d))(index, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v)
{
	(*GLPTR(glVertexAttrib1dv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1f (GLuint index, GLfloat v0)
{
	(*GLPTR(glVertexAttrib1f))(index, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v)
{
	(*GLPTR(glVertexAttrib1fv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1s (GLuint index, GLshort v0)
{
	(*GLPTR(glVertexAttrib1s))(index, v0);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib1sv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2d (GLuint index, GLdouble v0, GLdouble v1)
{
	(*GLPTR(glVertexAttrib2d))(index, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v)
{
	(*GLPTR(glVertexAttrib2dv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2f (GLuint index, GLfloat v0, GLfloat v1)
{
	(*GLPTR(glVertexAttrib2f))(index, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v)
{
	(*GLPTR(glVertexAttrib2fv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2s (GLuint index, GLshort v0, GLshort v1)
{
	(*GLPTR(glVertexAttrib2s))(index, v0, v1);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib2sv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3d (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2)
{
	(*GLPTR(glVertexAttrib3d))(index, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v)
{
	(*GLPTR(glVertexAttrib3dv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3f (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2)
{
	(*GLPTR(glVertexAttrib3f))(index, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v)
{
	(*GLPTR(glVertexAttrib3fv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3s (GLuint index, GLshort v0, GLshort v1, GLshort v2)
{
	(*GLPTR(glVertexAttrib3s))(index, v0, v1, v2);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib3sv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v)
{
	(*GLPTR(glVertexAttrib4Nbv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v)
{
	(*GLPTR(glVertexAttrib4Niv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib4Nsv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
{
	(*GLPTR(glVertexAttrib4Nub))(index, x, y, z, w);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v)
{
	(*GLPTR(glVertexAttrib4Nubv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v)
{
	(*GLPTR(glVertexAttrib4Nuiv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v)
{
	(*GLPTR(glVertexAttrib4Nusv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v)
{
	(*GLPTR(glVertexAttrib4bv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4d (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3)
{
	(*GLPTR(glVertexAttrib4d))(index, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v)
{
	(*GLPTR(glVertexAttrib4dv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4f (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
	(*GLPTR(glVertexAttrib4f))(index, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v)
{
	(*GLPTR(glVertexAttrib4fv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4iv (GLuint index, const GLint *v)
{
	(*GLPTR(glVertexAttrib4iv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4s (GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3)
{
	(*GLPTR(glVertexAttrib4s))(index, v0, v1, v2, v3);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v)
{
	(*GLPTR(glVertexAttrib4sv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v)
{
	(*GLPTR(glVertexAttrib4ubv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v)
{
	(*GLPTR(glVertexAttrib4uiv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v)
{
	(*GLPTR(glVertexAttrib4usv))(index, v);
}

VGLEXTAPI void VGLEXTAPIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
{
	(*GLPTR(glVertexAttribPointer))(index, size, type, normalized, stride, pointer);
}

#endif	/* !DLL_TARGET_DCC */

V_LOCAL vboolean
vgl_init_gl_2_0(vboolean *terminate)
{
	vboolean flag = true;
    LGLP(glBlendEquationSeparate);
    LGLP(glDrawBuffers);
    LGLP(glStencilOpSeparate);
    LGLP(glStencilFuncSeparate);
    LGLP(glStencilMaskSeparate);
    LGLP(glAttachShader);
    LGLP(glBindAttribLocation);
    LGLP(glCompileShader);
	LGLP(glCreateProgram);
	LGLP(glCreateShader);
    LGLP(glDeleteProgram);
    LGLP(glDeleteShader);
    LGLP(glDetachShader);
    LGLP(glDisableVertexAttribArray);
    LGLP(glEnableVertexAttribArray);
    LGLP(glGetActiveAttrib);
    LGLP(glGetActiveUniform);
    LGLP(glGetAttachedShaders);
    LGLP(glGetAttribLocation);
    LGLP(glGetProgramiv);
    LGLP(glGetProgramInfoLog);
    LGLP(glGetShaderiv);
    LGLP(glGetShaderInfoLog);
    LGLP(glGetShaderSource);
    LGLP(glGetUniformLocation);
    LGLP(glGetUniformfv);
    LGLP(glGetUniformiv);
    LGLP(glGetVertexAttribdv);
    LGLP(glGetVertexAttribfv);
    LGLP(glGetVertexAttribiv);
    LGLP(glGetVertexAttribPointerv);
    LGLP(glIsProgram);
    LGLP(glIsShader);
    LGLP(glLinkProgram);
    LGLP(glShaderSource);
    LGLP(glUseProgram);
    LGLP(glUniform1f);
    LGLP(glUniform2f);
    LGLP(glUniform3f);
    LGLP(glUniform4f);
    LGLP(glUniform1i);
    LGLP(glUniform2i);
    LGLP(glUniform3i);
    LGLP(glUniform4i);
    LGLP(glUniform1fv);
    LGLP(glUniform2fv);
    LGLP(glUniform3fv);
    LGLP(glUniform4fv);
    LGLP(glUniform1iv);
    LGLP(glUniform2iv);
    LGLP(glUniform3iv);
    LGLP(glUniform4iv);
    LGLP(glUniformMatrix2fv);
    LGLP(glUniformMatrix3fv);
    LGLP(glUniformMatrix4fv);
    LGLP(glValidateProgram);
    LGLP(glVertexAttrib1d);
    LGLP(glVertexAttrib1dv);
    LGLP(glVertexAttrib1f);
    LGLP(glVertexAttrib1fv);
    LGLP(glVertexAttrib1s);
    LGLP(glVertexAttrib1sv);
    LGLP(glVertexAttrib2d);
    LGLP(glVertexAttrib2dv);
    LGLP(glVertexAttrib2f);
    LGLP(glVertexAttrib2fv);
    LGLP(glVertexAttrib2s);
    LGLP(glVertexAttrib2sv);
    LGLP(glVertexAttrib3d);
    LGLP(glVertexAttrib3dv);
    LGLP(glVertexAttrib3f);
    LGLP(glVertexAttrib3fv);
    LGLP(glVertexAttrib3s);
    LGLP(glVertexAttrib3sv);
    LGLP(glVertexAttrib4Nbv);
    LGLP(glVertexAttrib4Niv);
    LGLP(glVertexAttrib4Nsv);
    LGLP(glVertexAttrib4Nub);
    LGLP(glVertexAttrib4Nubv);
    LGLP(glVertexAttrib4Nuiv);
    LGLP(glVertexAttrib4Nusv);
    LGLP(glVertexAttrib4bv);
    LGLP(glVertexAttrib4d);
    LGLP(glVertexAttrib4dv);
    LGLP(glVertexAttrib4f);
    LGLP(glVertexAttrib4fv);
    LGLP(glVertexAttrib4iv);
    LGLP(glVertexAttrib4s);
    LGLP(glVertexAttrib4sv);
    LGLP(glVertexAttrib4ubv);
    LGLP(glVertexAttrib4uiv);
    LGLP(glVertexAttrib4usv);
    LGLP(glVertexAttribPointer);
	if(*terminate)
		return false;
	conlPrintf(LOG_TRACE,"OpenGL 2.0 %s.\n",
		flag ? "initialized" : "failed to initialize");
	return flag;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Extension management stuff.
 */

V_LOCAL int
vgl_cmp_ver(char *sysver,char *refver)
{
	for(;*sysver && *refver;sysver++,refver++)
	{
		if(*refver > *sysver)
			return -1;
		else
		{
			if(*sysver > *refver)
				return 1;
		}
	}
	if(*sysver)
		return 1;
	if(*refver)
		return -1;
	return 0;
}

V_LOCAL char *
vgl_init_or_check_gl(void)
{
	vboolean pass, terminate = false;
	static char *ver_1_1 = "1.1";
	static char *ver_1_2 = "1.2";
	static char *ver_1_3 = "1.3";
	static char *ver_1_4 = "1.4";
	static char *ver_1_5 = "1.5";
	static char *ver_2_0 = "2.0";
	char *sysver = (char *)glGetString(GL_VERSION);
	V_ASSERT(sysver);
	vgl_load_arb_extensions(&terminate);
	if(terminate)
		goto another_gl_vendor;
	vgl_load_misc_extensions(&terminate);
	if(terminate)
		goto another_gl_vendor;
	if(vgl_cmp_ver(sysver,ver_1_1) < 0)
		return ver_1_1;
	pass = vgl_cmp_ver(sysver,ver_1_2) >= 0 && vgl_init_gl_1_2(&terminate);
	if(terminate)
		goto another_gl_vendor;
	if(!pass)
		return ver_1_1;
	pass = vgl_cmp_ver(sysver,ver_1_3) >= 0 && vgl_init_gl_1_3(&terminate);
	if(terminate)
		goto another_gl_vendor;
	if(!pass)
		return ver_1_2;
	pass = vgl_cmp_ver(sysver,ver_1_4) >= 0 && vgl_init_gl_1_4(&terminate);
	if(terminate)
		goto another_gl_vendor;
	if(!pass)
		return ver_1_3;
	pass = vgl_cmp_ver(sysver,ver_1_5) >= 0 && vgl_init_gl_1_5(&terminate);
	if(terminate)
		goto another_gl_vendor;
	if(!pass)
		return ver_1_4;
	pass = vgl_cmp_ver(sysver,ver_2_0) >= 0 && vgl_init_gl_2_0(&terminate);
	if(terminate)
		goto another_gl_vendor;
	if(!pass)
		return ver_1_5;
	return ver_2_0;
another_gl_vendor:;
	conlPuts(LOG_ERROR,
		"Unable to switch to another GL implementation after first init.");
	return NULL;
}

VGLEXTAPI char * VGLEXTAPIENTRY
vglGetVersionString (void)
{
	gl_context_p ctx;
	ctx = (gl_context_p)GetThreadData()->gl_context;
	if(!ctx)
		return NULL;
	libvLockGlobal();
	if(!ctx->libv_gl_version_string)
		ctx->libv_gl_version_string = vgl_init_or_check_gl();
	libvUnlockGlobal();
	return ctx->libv_gl_version_string;
}

#endif	/* ARCH_WINDOWING_SUPPORTED */
