From 501acc65f5a15c87adc7a38ee37094afc54f2903 Mon Sep 17 00:00:00 2001 From: prefect Date: Sun, 30 Oct 2005 01:18:15 +0000 Subject: [PATCH] Extension function pointers are renamed from glXyzARB to pglXyzARB to avoid conflicts with system header files. This was SVN commit r3054. --- source/gui/GUIRenderer.cpp | 2 +- source/lib/glext_funcs.h | 222 +++++++++--------- source/lib/ogl.cpp | 14 +- source/lib/ogl.h | 4 +- source/lib/res/graphics/ogl_shader.cpp | 40 ++-- source/lib/res/graphics/ogl_tex.cpp | 4 +- .../renderer/FixedFunctionModelRenderer.cpp | 2 +- source/renderer/HWLightingModelRenderer.cpp | 6 +- source/renderer/InstancingModelRenderer.cpp | 18 +- source/renderer/PatchRData.cpp | 24 +- source/renderer/PlayerRenderer.cpp | 24 +- source/renderer/RenderModifiers.cpp | 2 +- source/renderer/Renderer.cpp | 6 +- source/renderer/TransparencyRenderer.cpp | 2 +- source/renderer/VertexBuffer.cpp | 14 +- 15 files changed, 192 insertions(+), 192 deletions(-) diff --git a/source/gui/GUIRenderer.cpp b/source/gui/GUIRenderer.cpp index e33f234aad..3b93cfa6c6 100644 --- a/source/gui/GUIRenderer.cpp +++ b/source/gui/GUIRenderer.cpp @@ -313,7 +313,7 @@ public: void Unset() { glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); } }; diff --git a/source/lib/glext_funcs.h b/source/lib/glext_funcs.h index 783efa3c49..52faca5136 100755 --- a/source/lib/glext_funcs.h +++ b/source/lib/glext_funcs.h @@ -23,132 +23,132 @@ The names are made accessible to engine code only via the ARB name, to make it obvious that care must be taken (i.e. by being certain that the extension is actually supported). +Function names are in the form that is used in the OpenGL and extensions +specifications, i.e. without the 'gl' prefix. The FUNC/FUNC2 macro add an +appropriate prefix ('pgl' to avoid conflict with the system's GL headers). + */ // were these defined as real functions in gl.h already? -#ifndef REAL_GL_1_2 // GL_EXT_draw_range_elements / GL1.2: -FUNC2(void, glDrawRangeElementsEXT, glDrawRangeElements, "1.2", (GLenum, GLuint, GLuint, GLsizei, GLenum, GLvoid*)) -#endif +FUNC2(void, DrawRangeElementsEXT, DrawRangeElements, "1.2", (GLenum, GLuint, GLuint, GLsizei, GLenum, GLvoid*)) -#ifndef REAL_GL_1_3 // GL_ARB_multitexture / GL1.3: -FUNC2(void, glMultiTexCoord2fARB, glMultiTexCoord2f, "1.3", (int, float, float)) -FUNC2(void, glActiveTextureARB, glActiveTexture, "1.3", (int)) -FUNC2(void, glClientActiveTextureARB, glClientActiveTexture, "1.3", (int)) -#endif +FUNC2(void, MultiTexCoord2fARB, MultiTexCoord2f, "1.3", (int, float, float)) +FUNC2(void, ActiveTextureARB, ActiveTexture, "1.3", (int)) +FUNC2(void, ClientActiveTextureARB, ClientActiveTexture, "1.3", (int)) // GL_ARB_vertex_buffer_object / GL1.5: -FUNC2(void, glBindBufferARB, glBindBuffer, "1.5", (int target, GLuint buffer)) -FUNC2(void, glDeleteBuffersARB, glDeleteBuffers, "1.5", (GLsizei n, const GLuint* buffers)) -FUNC2(void, glGenBuffersARB, glGenBuffers, "1.5", (GLsizei n, GLuint* buffers)) -FUNC2(bool, glIsBufferARB, glIsBuffer, "1.5", (GLuint buffer)) -FUNC2(void, glBufferDataARB, glBufferData, "1.5", (int target, GLsizeiptrARB size, const void* data, int usage)) -FUNC2(void, glBufferSubDataARB, glBufferSubData, "1.5", (int target, GLintptrARB offset, GLsizeiptrARB size, const void* data)) -FUNC2(void, glGetBufferSubDataARB, glGetBufferSubData, "1.5", (int target, GLintptrARB offset, GLsizeiptrARB size, void* data)) -FUNC2(void*, glMapBufferARB, glMapBuffer, "1.5", (int target, int access)) -FUNC2(bool, glUnmapBufferARB, glUnmapBuffer, "1.5", (int target)) -FUNC2(void, glGetBufferParameterivARB, glGetBufferParameteriv, "1.5", (int target, int pname, int* params)) -FUNC2(void, glGetBufferPointervARB, glGetBufferPointerv, "1.5", (int target, int pname, void** params)) +FUNC2(void, BindBufferARB, BindBuffer, "1.5", (int target, GLuint buffer)) +FUNC2(void, DeleteBuffersARB, DeleteBuffers, "1.5", (GLsizei n, const GLuint* buffers)) +FUNC2(void, GenBuffersARB, GenBuffers, "1.5", (GLsizei n, GLuint* buffers)) +FUNC2(bool, IsBufferARB, IsBuffer, "1.5", (GLuint buffer)) +FUNC2(void, BufferDataARB, BufferData, "1.5", (int target, GLsizeiptrARB size, const void* data, int usage)) +FUNC2(void, BufferSubDataARB, BufferSubData, "1.5", (int target, GLintptrARB offset, GLsizeiptrARB size, const void* data)) +FUNC2(void, GetBufferSubDataARB, GetBufferSubData, "1.5", (int target, GLintptrARB offset, GLsizeiptrARB size, void* data)) +FUNC2(void*, MapBufferARB, MapBuffer, "1.5", (int target, int access)) +FUNC2(bool, UnmapBufferARB, UnmapBuffer, "1.5", (int target)) +FUNC2(void, GetBufferParameterivARB, GetBufferParameteriv, "1.5", (int target, int pname, int* params)) +FUNC2(void, GetBufferPointervARB, GetBufferPointerv, "1.5", (int target, int pname, void** params)) // GL_ARB_texture_compression / GL1.3 -FUNC2(void, glCompressedTexImage3DARB, glCompressedTexImage3D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*)) -FUNC2(void, glCompressedTexImage2DARB, glCompressedTexImage2D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*)) -FUNC2(void, glCompressedTexImage1DARB, glCompressedTexImage1D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*)) -FUNC2(void, glCompressedTexSubImage3DARB, glCompressedTexSubImage3D, "1.3", (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*)) -FUNC2(void, glCompressedTexSubImage2DARB, glCompressedTexSubImage2D, "1.3", (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*)) -FUNC2(void, glCompressedTexSubImage1DARB, glCompressedTexSubImage1D, "1.3", (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*)) -FUNC2(void, glGetCompressedTexImageARB, glGetCompressedTexImage, "1.3", (GLenum, GLint, GLvoid*)) +FUNC2(void, CompressedTexImage3DARB, CompressedTexImage3D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*)) +FUNC2(void, CompressedTexImage2DARB, CompressedTexImage2D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*)) +FUNC2(void, CompressedTexImage1DARB, CompressedTexImage1D, "1.3", (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*)) +FUNC2(void, CompressedTexSubImage3DARB, CompressedTexSubImage3D, "1.3", (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*)) +FUNC2(void, CompressedTexSubImage2DARB, CompressedTexSubImage2D, "1.3", (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*)) +FUNC2(void, CompressedTexSubImage1DARB, CompressedTexSubImage1D, "1.3", (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*)) +FUNC2(void, GetCompressedTexImageARB, GetCompressedTexImage, "1.3", (GLenum, GLint, GLvoid*)) // GL_ARB_shader_objects -FUNC2(void, glDeleteObjectARB, glDeleteObject, "2.0", (GLhandleARB obj)) -FUNC2(GLhandleARB, glGetHandleARB, glGetHandle, "2.0", (GLenum pname)) -FUNC2(void, glDetachObjectARB, glDetachObject, "2.0", (GLhandleARB containerObj, GLhandleARB attachedObj)) -FUNC2(GLhandleARB, glCreateShaderObjectARB, glCreateShaderObject, "2.0", (GLenum shaderType)) -FUNC2(void, glShaderSourceARB, glShaderSource, "2.0", (GLhandleARB shaderObj, GLsizei count, const char **string, const GLint *length)) -FUNC2(void, glCompileShaderARB, glCompileShader, "2.0", (GLhandleARB shaderObj)) -FUNC2(GLhandleARB, glCreateProgramObjectARB, glCreateProgramObject, "2.0", (void)) -FUNC2(void, glAttachObjectARB, glAttachObject, "2.0", (GLhandleARB containerObj, GLhandleARB obj)) -FUNC2(void, glLinkProgramARB, glLinkProgram, "2.0", (GLhandleARB programObj)) -FUNC2(void, glUseProgramObjectARB, glUseProgramObject, "2.0", (GLhandleARB programObj)) -FUNC2(void, glValidateProgramARB, glValidateProgram, "2.0", (GLhandleARB programObj)) -FUNC2(void, glUniform1fARB, glUniform1f, "2.0", (GLint location, GLfloat v0)) -FUNC2(void, glUniform2fARB, glUniform2f, "2.0", (GLint location, GLfloat v0, GLfloat v1)) -FUNC2(void, glUniform3fARB, glUniform3f, "2.0", (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)) -FUNC2(void, glUniform4fARB, glUniform4f, "2.0", (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) -FUNC2(void, glUniform1iARB, glUniform1i, "2.0", (GLint location, GLint v0)) -FUNC2(void, glUniform2iARB, glUniform2i, "2.0", (GLint location, GLint v0, GLint v1)) -FUNC2(void, glUniform3iARB, glUniform3i, "2.0", (GLint location, GLint v0, GLint v1, GLint v2)) -FUNC2(void, glUniform4iARB, glUniform4i, "2.0", (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)) -FUNC2(void, glUniform1fvARB, glUniform1fv, "2.0", (GLint location, GLsizei count, const GLfloat *value)) -FUNC2(void, glUniform2fvARB, glUniform2fv, "2.0", (GLint location, GLsizei count, const GLfloat *value)) -FUNC2(void, glUniform3fvARB, glUniform3fv, "2.0", (GLint location, GLsizei count, const GLfloat *value)) -FUNC2(void, glUniform4fvARB, glUniform4fv, "2.0", (GLint location, GLsizei count, const GLfloat *value)) -FUNC2(void, glUniform1ivARB, glUniform1iv, "2.0", (GLint location, GLsizei count, const GLint *value)) -FUNC2(void, glUniform2ivARB, glUniform2iv, "2.0", (GLint location, GLsizei count, const GLint *value)) -FUNC2(void, glUniform3ivARB, glUniform3iv, "2.0", (GLint location, GLsizei count, const GLint *value)) -FUNC2(void, glUniform4ivARB, glUniform4iv, "2.0", (GLint location, GLsizei count, const GLint *value)) -FUNC2(void, glUniformMatrix2fvARB, glUniformMatrix2fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -FUNC2(void, glUniformMatrix3fvARB, glUniformMatrix3fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -FUNC2(void, glUniformMatrix4fvARB, glUniformMatrix4fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -FUNC2(void, glGetObjectParameterfvARB, glGetObjectParameterfv, "2.0", (GLhandleARB obj, GLenum pname, GLfloat *params)) -FUNC2(void, glGetObjectParameterivARB, glGetObjectParameteriv, "2.0", (GLhandleARB obj, GLenum pname, GLint *params)) -FUNC2(void, glGetInfoLogARB, glGetInfoLog, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, char *infoLog)) -FUNC2(void, glGetAttachedObjectsARB, glGetAttachedObjects, "2.0", (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj)) -FUNC2(GLint, glGetUniformLocationARB, glGetUniformLocation, "2.0", (GLhandleARB programObj, const char *name)) -FUNC2(void, glGetActiveUniformARB, glGetActiveUniform, "2.0", (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, char *name)) -FUNC2(void, glGetUniformfvARB, glGetUniformfv, "2.0", (GLhandleARB programObj, GLint location, GLfloat *params)) -FUNC2(void, glGetUniformivARB, glGetUniformiv, "2.0", (GLhandleARB programObj, GLint location, GLint *params)) -FUNC2(void, glGetShaderSourceARB, glGetShaderSource, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source)) +FUNC2(void, DeleteObjectARB, DeleteObject, "2.0", (GLhandleARB obj)) +FUNC2(GLhandleARB, GetHandleARB, GetHandle, "2.0", (GLenum pname)) +FUNC2(void, DetachObjectARB, DetachObject, "2.0", (GLhandleARB containerObj, GLhandleARB attachedObj)) +FUNC2(GLhandleARB, CreateShaderObjectARB, CreateShaderObject, "2.0", (GLenum shaderType)) +FUNC2(void, ShaderSourceARB, ShaderSource, "2.0", (GLhandleARB shaderObj, GLsizei count, const char **string, const GLint *length)) +FUNC2(void, CompileShaderARB, CompileShader, "2.0", (GLhandleARB shaderObj)) +FUNC2(GLhandleARB, CreateProgramObjectARB, CreateProgramObject, "2.0", (void)) +FUNC2(void, AttachObjectARB, AttachObject, "2.0", (GLhandleARB containerObj, GLhandleARB obj)) +FUNC2(void, LinkProgramARB, LinkProgram, "2.0", (GLhandleARB programObj)) +FUNC2(void, UseProgramObjectARB, UseProgramObject, "2.0", (GLhandleARB programObj)) +FUNC2(void, ValidateProgramARB, ValidateProgram, "2.0", (GLhandleARB programObj)) +FUNC2(void, Uniform1fARB, Uniform1f, "2.0", (GLint location, GLfloat v0)) +FUNC2(void, Uniform2fARB, Uniform2f, "2.0", (GLint location, GLfloat v0, GLfloat v1)) +FUNC2(void, Uniform3fARB, Uniform3f, "2.0", (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)) +FUNC2(void, Uniform4fARB, Uniform4f, "2.0", (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) +FUNC2(void, Uniform1iARB, Uniform1i, "2.0", (GLint location, GLint v0)) +FUNC2(void, Uniform2iARB, Uniform2i, "2.0", (GLint location, GLint v0, GLint v1)) +FUNC2(void, Uniform3iARB, Uniform3i, "2.0", (GLint location, GLint v0, GLint v1, GLint v2)) +FUNC2(void, Uniform4iARB, Uniform4i, "2.0", (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)) +FUNC2(void, Uniform1fvARB, Uniform1fv, "2.0", (GLint location, GLsizei count, const GLfloat *value)) +FUNC2(void, Uniform2fvARB, Uniform2fv, "2.0", (GLint location, GLsizei count, const GLfloat *value)) +FUNC2(void, Uniform3fvARB, Uniform3fv, "2.0", (GLint location, GLsizei count, const GLfloat *value)) +FUNC2(void, Uniform4fvARB, Uniform4fv, "2.0", (GLint location, GLsizei count, const GLfloat *value)) +FUNC2(void, Uniform1ivARB, Uniform1iv, "2.0", (GLint location, GLsizei count, const GLint *value)) +FUNC2(void, Uniform2ivARB, Uniform2iv, "2.0", (GLint location, GLsizei count, const GLint *value)) +FUNC2(void, Uniform3ivARB, Uniform3iv, "2.0", (GLint location, GLsizei count, const GLint *value)) +FUNC2(void, Uniform4ivARB, Uniform4iv, "2.0", (GLint location, GLsizei count, const GLint *value)) +FUNC2(void, UniformMatrix2fvARB, UniformMatrix2fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +FUNC2(void, UniformMatrix3fvARB, UniformMatrix3fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +FUNC2(void, UniformMatrix4fvARB, UniformMatrix4fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +FUNC2(void, GetObjectParameterfvARB, GetObjectParameterfv, "2.0", (GLhandleARB obj, GLenum pname, GLfloat *params)) +FUNC2(void, GetObjectParameterivARB, GetObjectParameteriv, "2.0", (GLhandleARB obj, GLenum pname, GLint *params)) +FUNC2(void, GetInfoLogARB, GetInfoLog, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, char *infoLog)) +FUNC2(void, GetAttachedObjectsARB, GetAttachedObjects, "2.0", (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj)) +FUNC2(GLint, GetUniformLocationARB, GetUniformLocation, "2.0", (GLhandleARB programObj, const char *name)) +FUNC2(void, GetActiveUniformARB, GetActiveUniform, "2.0", (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, char *name)) +FUNC2(void, GetUniformfvARB, GetUniformfv, "2.0", (GLhandleARB programObj, GLint location, GLfloat *params)) +FUNC2(void, GetUniformivARB, GetUniformiv, "2.0", (GLhandleARB programObj, GLint location, GLint *params)) +FUNC2(void, GetShaderSourceARB, GetShaderSource, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source)) // GL_ARB_vertex_shader -FUNC2(void, glVertexAttrib1fARB, glVertexAttrib1f, "2.0", (GLuint index, GLfloat v0)) -FUNC2(void, glVertexAttrib1sARB, glVertexAttrib1s, "2.0", (GLuint index, GLshort v0)) -FUNC2(void, glVertexAttrib1dARB, glVertexAttrib1d, "2.0", (GLuint index, GLdouble v0)) -FUNC2(void, glVertexAttrib2fARB, glVertexAttrib2f, "2.0", (GLuint index, GLfloat v0, GLfloat v1)) -FUNC2(void, glVertexAttrib2sARB, glVertexAttrib2s, "2.0", (GLuint index, GLshort v0, GLshort v1)) -FUNC2(void, glVertexAttrib2dARB, glVertexAttrib2d, "2.0", (GLuint index, GLdouble v0, GLdouble v1)) -FUNC2(void, glVertexAttrib3fARB, glVertexAttrib3f, "2.0", (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2)) -FUNC2(void, glVertexAttrib3sARB, glVertexAttrib3s, "2.0", (GLuint index, GLshort v0, GLshort v1, GLshort v2)) -FUNC2(void, glVertexAttrib3dARB, glVertexAttrib3d, "2.0", (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2)) -FUNC2(void, glVertexAttrib4fARB, glVertexAttrib4f, "2.0", (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) -FUNC2(void, glVertexAttrib4sARB, glVertexAttrib4s, "2.0", (GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3)) -FUNC2(void, glVertexAttrib4dARB, glVertexAttrib4d, "2.0", (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3)) -FUNC2(void, glVertexAttrib4NubARB, glVertexAttrib4Nub, "2.0", (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) -FUNC2(void, glVertexAttrib1fvARB, glVertexAttrib1fv, "2.0", (GLuint index, const GLfloat *v)) -FUNC2(void, glVertexAttrib1svARB, glVertexAttrib1sv, "2.0", (GLuint index, const GLshort *v)) -FUNC2(void, glVertexAttrib1dvARB, glVertexAttrib1dv, "2.0", (GLuint index, const GLdouble *v)) -FUNC2(void, glVertexAttrib2fvARB, glVertexAttrib2fv, "2.0", (GLuint index, const GLfloat *v)) -FUNC2(void, glVertexAttrib2svARB, glVertexAttrib2sv, "2.0", (GLuint index, const GLshort *v)) -FUNC2(void, glVertexAttrib2dvARB, glVertexAttrib2dv, "2.0", (GLuint index, const GLdouble *v)) -FUNC2(void, glVertexAttrib3fvARB, glVertexAttrib3fv, "2.0", (GLuint index, const GLfloat *v)) -FUNC2(void, glVertexAttrib3svARB, glVertexAttrib3sv, "2.0", (GLuint index, const GLshort *v)) -FUNC2(void, glVertexAttrib3dvARB, glVertexAttrib3dv, "2.0", (GLuint index, const GLdouble *v)) -FUNC2(void, glVertexAttrib4fvARB, glVertexAttrib4fv, "2.0", (GLuint index, const GLfloat *v)) -FUNC2(void, glVertexAttrib4svARB, glVertexAttrib4sv, "2.0", (GLuint index, const GLshort *v)) -FUNC2(void, glVertexAttrib4dvARB, glVertexAttrib4dv, "2.0", (GLuint index, const GLdouble *v)) -FUNC2(void, glVertexAttrib4ivARB, glVertexAttrib4iv, "2.0", (GLuint index, const GLint *v)) -FUNC2(void, glVertexAttrib4bvARB, glVertexAttrib4bv, "2.0", (GLuint index, const GLbyte *v)) -FUNC2(void, glVertexAttrib4ubvARB, glVertexAttrib4ubv, "2.0", (GLuint index, const GLubyte *v)) -FUNC2(void, glVertexAttrib4usvARB, glVertexAttrib4usv, "2.0", (GLuint index, const GLushort *v)) -FUNC2(void, glVertexAttrib4uivARB, glVertexAttrib4uiv, "2.0", (GLuint index, const GLuint *v)) -FUNC2(void, glVertexAttrib4NbvARB, glVertexAttrib4Nbv, "2.0", (GLuint index, const GLbyte *v)) -FUNC2(void, glVertexAttrib4NsvARB, glVertexAttrib4Nsv, "2.0", (GLuint index, const GLshort *v)) -FUNC2(void, glVertexAttrib4NivARB, glVertexAttrib4Niv, "2.0", (GLuint index, const GLint *v)) -FUNC2(void, glVertexAttrib4NubvARB, glVertexAttrib4Nubv, "2.0", (GLuint index, const GLubyte *v)) -FUNC2(void, glVertexAttrib4NusvARB, glVertexAttrib4Nusv, "2.0", (GLuint index, const GLushort *v)) -FUNC2(void, glVertexAttrib4NuivARB, glVertexAttrib4Nuiv, "2.0", (GLuint index, const GLuint *v)) -FUNC2(void, glVertexAttribPointerARB, glVertexAttribPointer, "2.0", (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer)) -FUNC2(void, glEnableVertexAttribArrayARB, glEnableVertexAttribArray, "2.0", (GLuint index)) -FUNC2(void, glDisableVertexAttribArrayARB, glDisableVertexAttribArray, "2.0", (GLuint index)) -FUNC2(void, glBindAttribLocationARB, glBindAttribLocation, "2.0", (GLhandleARB programObj, GLuint index, const char *name)) -FUNC2(void, glGetActiveAttribARB, glGetActiveAttrib, "2.0", (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, int *size, GLenum *type, char *name)) -FUNC2(GLint, glGetAttribLocationARB, glGetAttribLocation, "2.0", (GLhandleARB programObj, const char *name)) -FUNC2(void, glGetVertexAttribdvARB, glGetVertexAttribdv, "2.0", (GLuint index, GLenum pname, GLdouble *params)) -FUNC2(void, glGetVertexAttribfvARB, glGetVertexAttribfv, "2.0", (GLuint index, GLenum pname, GLfloat *params)) -FUNC2(void, glGetVertexAttribivARB, glGetVertexAttribiv, "2.0", (GLuint index, GLenum pname, GLint *params)) -FUNC2(void, glGetVertexAttribPointervARB, glGetVertexAttribPointerv, "2.0", (GLuint index, GLenum pname, void **pointer)) +FUNC2(void, VertexAttrib1fARB, VertexAttrib1f, "2.0", (GLuint index, GLfloat v0)) +FUNC2(void, VertexAttrib1sARB, VertexAttrib1s, "2.0", (GLuint index, GLshort v0)) +FUNC2(void, VertexAttrib1dARB, VertexAttrib1d, "2.0", (GLuint index, GLdouble v0)) +FUNC2(void, VertexAttrib2fARB, VertexAttrib2f, "2.0", (GLuint index, GLfloat v0, GLfloat v1)) +FUNC2(void, VertexAttrib2sARB, VertexAttrib2s, "2.0", (GLuint index, GLshort v0, GLshort v1)) +FUNC2(void, VertexAttrib2dARB, VertexAttrib2d, "2.0", (GLuint index, GLdouble v0, GLdouble v1)) +FUNC2(void, VertexAttrib3fARB, VertexAttrib3f, "2.0", (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2)) +FUNC2(void, VertexAttrib3sARB, VertexAttrib3s, "2.0", (GLuint index, GLshort v0, GLshort v1, GLshort v2)) +FUNC2(void, VertexAttrib3dARB, VertexAttrib3d, "2.0", (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2)) +FUNC2(void, VertexAttrib4fARB, VertexAttrib4f, "2.0", (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) +FUNC2(void, VertexAttrib4sARB, VertexAttrib4s, "2.0", (GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3)) +FUNC2(void, VertexAttrib4dARB, VertexAttrib4d, "2.0", (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3)) +FUNC2(void, VertexAttrib4NubARB, VertexAttrib4Nub, "2.0", (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) +FUNC2(void, VertexAttrib1fvARB, VertexAttrib1fv, "2.0", (GLuint index, const GLfloat *v)) +FUNC2(void, VertexAttrib1svARB, VertexAttrib1sv, "2.0", (GLuint index, const GLshort *v)) +FUNC2(void, VertexAttrib1dvARB, VertexAttrib1dv, "2.0", (GLuint index, const GLdouble *v)) +FUNC2(void, VertexAttrib2fvARB, VertexAttrib2fv, "2.0", (GLuint index, const GLfloat *v)) +FUNC2(void, VertexAttrib2svARB, VertexAttrib2sv, "2.0", (GLuint index, const GLshort *v)) +FUNC2(void, VertexAttrib2dvARB, VertexAttrib2dv, "2.0", (GLuint index, const GLdouble *v)) +FUNC2(void, VertexAttrib3fvARB, VertexAttrib3fv, "2.0", (GLuint index, const GLfloat *v)) +FUNC2(void, VertexAttrib3svARB, VertexAttrib3sv, "2.0", (GLuint index, const GLshort *v)) +FUNC2(void, VertexAttrib3dvARB, VertexAttrib3dv, "2.0", (GLuint index, const GLdouble *v)) +FUNC2(void, VertexAttrib4fvARB, VertexAttrib4fv, "2.0", (GLuint index, const GLfloat *v)) +FUNC2(void, VertexAttrib4svARB, VertexAttrib4sv, "2.0", (GLuint index, const GLshort *v)) +FUNC2(void, VertexAttrib4dvARB, VertexAttrib4dv, "2.0", (GLuint index, const GLdouble *v)) +FUNC2(void, VertexAttrib4ivARB, VertexAttrib4iv, "2.0", (GLuint index, const GLint *v)) +FUNC2(void, VertexAttrib4bvARB, VertexAttrib4bv, "2.0", (GLuint index, const GLbyte *v)) +FUNC2(void, VertexAttrib4ubvARB, VertexAttrib4ubv, "2.0", (GLuint index, const GLubyte *v)) +FUNC2(void, VertexAttrib4usvARB, VertexAttrib4usv, "2.0", (GLuint index, const GLushort *v)) +FUNC2(void, VertexAttrib4uivARB, VertexAttrib4uiv, "2.0", (GLuint index, const GLuint *v)) +FUNC2(void, VertexAttrib4NbvARB, VertexAttrib4Nbv, "2.0", (GLuint index, const GLbyte *v)) +FUNC2(void, VertexAttrib4NsvARB, VertexAttrib4Nsv, "2.0", (GLuint index, const GLshort *v)) +FUNC2(void, VertexAttrib4NivARB, VertexAttrib4Niv, "2.0", (GLuint index, const GLint *v)) +FUNC2(void, VertexAttrib4NubvARB, VertexAttrib4Nubv, "2.0", (GLuint index, const GLubyte *v)) +FUNC2(void, VertexAttrib4NusvARB, VertexAttrib4Nusv, "2.0", (GLuint index, const GLushort *v)) +FUNC2(void, VertexAttrib4NuivARB, VertexAttrib4Nuiv, "2.0", (GLuint index, const GLuint *v)) +FUNC2(void, VertexAttribPointerARB, VertexAttribPointer, "2.0", (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer)) +FUNC2(void, EnableVertexAttribArrayARB, EnableVertexAttribArray, "2.0", (GLuint index)) +FUNC2(void, DisableVertexAttribArrayARB, DisableVertexAttribArray, "2.0", (GLuint index)) +FUNC2(void, BindAttribLocationARB, BindAttribLocation, "2.0", (GLhandleARB programObj, GLuint index, const char *name)) +FUNC2(void, GetActiveAttribARB, GetActiveAttrib, "2.0", (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, int *size, GLenum *type, char *name)) +FUNC2(GLint, GetAttribLocationARB, GetAttribLocation, "2.0", (GLhandleARB programObj, const char *name)) +FUNC2(void, GetVertexAttribdvARB, GetVertexAttribdv, "2.0", (GLuint index, GLenum pname, GLdouble *params)) +FUNC2(void, GetVertexAttribfvARB, GetVertexAttribfv, "2.0", (GLuint index, GLenum pname, GLfloat *params)) +FUNC2(void, GetVertexAttribivARB, GetVertexAttribiv, "2.0", (GLuint index, GLenum pname, GLint *params)) +FUNC2(void, GetVertexAttribPointervARB, GetVertexAttribPointerv, "2.0", (GLuint index, GLenum pname, void **pointer)) #if OS_WIN // WGL_EXT_swap_control diff --git a/source/lib/ogl.cpp b/source/lib/ogl.cpp index 99fd8607b5..14a16a8b0b 100755 --- a/source/lib/ogl.cpp +++ b/source/lib/ogl.cpp @@ -46,8 +46,8 @@ // define extension function pointers extern "C" { -#define FUNC(ret, name, params) ret (CALL_CONV *name) params; -#define FUNC2(ret, nameARB, nameCore, version, params) ret (CALL_CONV *nameARB) params; +#define FUNC(ret, name, params) ret (CALL_CONV *pgl##name) params; +#define FUNC2(ret, nameARB, nameCore, version, params) ret (CALL_CONV *pgl##nameARB) params; #include "glext_funcs.h" #undef FUNC2 #undef FUNC @@ -237,13 +237,13 @@ static void importExtensionFunctions() // It should be safe to load the ARB function pointers even if the // extension isn't advertised, since we won't actually use them without // checking for the extension. -#define FUNC(ret, name, params) *(void**)&name = SDL_GL_GetProcAddress(#name); +#define FUNC(ret, name, params) *(void**)&pgl##name = SDL_GL_GetProcAddress("gl" #name); #define FUNC2(ret, nameARB, nameCore, version, params) \ - nameARB = NULL; \ + pgl##nameARB = NULL; \ if(oglHaveVersion(version)) \ - *(void**)&nameARB = SDL_GL_GetProcAddress(#nameCore); \ - if(!nameARB) /* use the ARB name if the driver lied about what version it supports */ \ - *(void**)&nameARB = SDL_GL_GetProcAddress(#nameARB); + *(void**)&pgl##nameARB = SDL_GL_GetProcAddress("gl" #nameCore); \ + if(!pgl##nameARB) /* use the ARB name if the driver lied about what version it supports */ \ + *(void**)&pgl##nameARB = SDL_GL_GetProcAddress("gl" #nameARB); #include "glext_funcs.h" #undef FUNC2 #undef FUNC diff --git a/source/lib/ogl.h b/source/lib/ogl.h index 4fda6487ec..3aed42549a 100755 --- a/source/lib/ogl.h +++ b/source/lib/ogl.h @@ -81,8 +81,8 @@ extern const char* oglExtList(void); # define CALL_CONV #endif -#define FUNC(ret, name, params) extern ret (CALL_CONV *name) params; -#define FUNC2(ret, nameARB, nameCore, version, params) extern ret (CALL_CONV *nameARB) params; +#define FUNC(ret, name, params) extern ret (CALL_CONV *pgl##name) params; +#define FUNC2(ret, nameARB, nameCore, version, params) extern ret (CALL_CONV *pgl##nameARB) params; #include "glext_funcs.h" #undef FUNC2 #undef FUNC diff --git a/source/lib/res/graphics/ogl_shader.cpp b/source/lib/res/graphics/ogl_shader.cpp index a04fc1c320..728876e8c9 100644 --- a/source/lib/res/graphics/ogl_shader.cpp +++ b/source/lib/res/graphics/ogl_shader.cpp @@ -90,7 +90,7 @@ static int Ogl_Shader_reload(Ogl_Shader* shdr, const char* filename, Handle UNUS oglCheck(); - shdr->id = glCreateShaderObjectARB(shdr->type); + shdr->id = pglCreateShaderObjectARB(shdr->type); if (!shdr->id) { // May be out of memory, but bad shdr->type is also possible. @@ -102,17 +102,17 @@ static int Ogl_Shader_reload(Ogl_Shader* shdr, const char* filename, Handle UNUS goto fail_fileloaded; } - glShaderSourceARB(shdr->id, 1, (const char**)&file, (const GLint*)&file_size); - glCompileShaderARB(shdr->id); + pglShaderSourceARB(shdr->id, 1, (const char**)&file, (const GLint*)&file_size); + pglCompileShaderARB(shdr->id); - glGetObjectParameterivARB(shdr->id, GL_OBJECT_COMPILE_STATUS_ARB, &compile_success); - glGetObjectParameterivARB(shdr->id, GL_OBJECT_INFO_LOG_LENGTH_ARB, &log_length); + pglGetObjectParameterivARB(shdr->id, GL_OBJECT_COMPILE_STATUS_ARB, &compile_success); + pglGetObjectParameterivARB(shdr->id, GL_OBJECT_INFO_LOG_LENGTH_ARB, &log_length); if (log_length > 1) { char typenamebuf[32]; char* infolog = new char[log_length]; - glGetInfoLogARB(shdr->id, log_length, 0, infolog); + pglGetInfoLogARB(shdr->id, log_length, 0, infolog); debug_printf("Compile log for shader %hs (type %hs):\n%hs", filename, @@ -143,7 +143,7 @@ static int Ogl_Shader_reload(Ogl_Shader* shdr, const char* filename, Handle UNUS return 0; fail_shadercreated: - glDeleteObjectARB(shdr->id); + pglDeleteObjectARB(shdr->id); shdr->id = 0; fail_fileloaded: mem_free_h(hm); @@ -157,7 +157,7 @@ static void Ogl_Shader_dtor(Ogl_Shader* shdr) // shdr->id is 0 when reload has failed if (shdr->id) { - glDeleteObjectARB(shdr->id); + pglDeleteObjectARB(shdr->id); shdr->id = 0; } } @@ -202,7 +202,7 @@ int ogl_shader_attach(GLhandleARB program, Handle& h) if (!shdr->id) return ERR_SHDR_NO_SHADER; - glAttachObjectARB(program, shdr->id); + pglAttachObjectARB(program, shdr->id); return 0; } @@ -287,7 +287,7 @@ static int Ogl_Program_reload(Ogl_Program* p, const char* filename, Handle h) oglCheck(); - p->id = glCreateProgramObjectARB(); + p->id = pglCreateProgramObjectARB(); if (!p->id) { // The spec doesn't mention any error state that can be set @@ -349,17 +349,17 @@ static int Ogl_Program_reload(Ogl_Program* p, const char* filename, Handle h) } } - glLinkProgramARB(p->id); + pglLinkProgramARB(p->id); GLint log_length; GLint linked; - glGetObjectParameterivARB(p->id, GL_OBJECT_LINK_STATUS_ARB, &linked); - glGetObjectParameterivARB(p->id, GL_OBJECT_INFO_LOG_LENGTH_ARB, &log_length); + pglGetObjectParameterivARB(p->id, GL_OBJECT_LINK_STATUS_ARB, &linked); + pglGetObjectParameterivARB(p->id, GL_OBJECT_INFO_LOG_LENGTH_ARB, &log_length); if (log_length > 1) { char* infolog = new char[log_length]; - glGetInfoLogARB(p->id, log_length, 0, infolog); + pglGetInfoLogARB(p->id, log_length, 0, infolog); debug_printf("Linker log for %hs:\n%hs\n", filename, infolog); delete[] infolog; @@ -380,7 +380,7 @@ static void Ogl_Program_dtor(Ogl_Program* p) { if (p->id) { - glDeleteObjectARB(p->id); + pglDeleteObjectARB(p->id); p->id = 0; } } @@ -421,19 +421,19 @@ int ogl_program_use(Handle h) { if (!h) { - glUseProgramObjectARB(0); + pglUseProgramObjectARB(0); return 0; } Ogl_Program* p = H_USER_DATA(h, Ogl_Program); if (!p || !p->id) { - glUseProgramObjectARB(0); + pglUseProgramObjectARB(0); CHECK_ERR(ERR_INVALID_HANDLE); UNREACHABLE; } - glUseProgramObjectARB(p->id); + pglUseProgramObjectARB(p->id); return 0; } @@ -443,7 +443,7 @@ GLint ogl_program_get_uniform_location(Handle h, const char* name) { H_DEREF(h, Ogl_Program, p); - return glGetUniformLocationARB(p->id, name); + return pglGetUniformLocationARB(p->id, name); } @@ -452,5 +452,5 @@ GLint ogl_program_get_attrib_location(Handle h, const char* name) { H_DEREF(h, Ogl_Program, p); - return glGetAttribLocationARB(p->id, name); + return pglGetAttribLocationARB(p->id, name); } diff --git a/source/lib/res/graphics/ogl_tex.cpp b/source/lib/res/graphics/ogl_tex.cpp index 2c25c2c879..a4568266f8 100755 --- a/source/lib/res/graphics/ogl_tex.cpp +++ b/source/lib/res/graphics/ogl_tex.cpp @@ -750,7 +750,7 @@ static void upload_compressed_level(uint level, uint level_w, uint level_h, const u8* restrict level_data, size_t level_data_size, void* restrict ctx) { const UploadParams* up = (const UploadParams*)ctx; - glCompressedTexImage2DARB(GL_TEXTURE_2D, level, up->fmt, + pglCompressedTexImage2DARB(GL_TEXTURE_2D, level, up->fmt, (GLsizei)level_w, (GLsizei)level_h, 0, (GLsizei)level_data_size, level_data); } @@ -918,7 +918,7 @@ int ogl_tex_bind(Handle ht, uint unit) { // note: there are many call sites of glActiveTextureARB, so caching // those and ignoring redundant sets isn't feasible. - glActiveTextureARB(GL_TEXTURE0+unit); + pglActiveTextureARB(GL_TEXTURE0+unit); // special case: disable texturing if(ht == 0) diff --git a/source/renderer/FixedFunctionModelRenderer.cpp b/source/renderer/FixedFunctionModelRenderer.cpp index c75e3563d0..9ff067532d 100644 --- a/source/renderer/FixedFunctionModelRenderer.cpp +++ b/source/renderer/FixedFunctionModelRenderer.cpp @@ -254,7 +254,7 @@ void FixedFunctionModelRenderer::RenderModel(CModel* model, void* data) // render the lot size_t numFaces = mdldef->GetNumFaces(); - glDrawRangeElementsEXT(GL_TRIANGLES, 0, mdldef->GetNumVertices(), + pglDrawRangeElementsEXT(GL_TRIANGLES, 0, mdldef->GetNumVertices(), numFaces*3, GL_UNSIGNED_SHORT, m->ffmodeldef->m_Indices); // bump stats diff --git a/source/renderer/HWLightingModelRenderer.cpp b/source/renderer/HWLightingModelRenderer.cpp index 1bd87505df..4dc1584f1f 100644 --- a/source/renderer/HWLightingModelRenderer.cpp +++ b/source/renderer/HWLightingModelRenderer.cpp @@ -128,7 +128,7 @@ void HWLightingModelRenderer::Render(RenderModifierPtr modifier, u32 flags) ogl_program_use(g_Renderer.m_VertexShader->m_ModelLight); idx = g_Renderer.m_VertexShader->m_ModelLight_SHCoefficients; - glUniform3fvARB(idx, 9, (float*)coeffs); + pglUniform3fvARB(idx, 9, (float*)coeffs); glEnableClientState(GL_NORMAL_ARRAY); } @@ -138,7 +138,7 @@ void HWLightingModelRenderer::Render(RenderModifierPtr modifier, u32 flags) if (m->streamflags & STREAM_UV0) glDisableClientState(GL_TEXTURE_COORD_ARRAY); if (m->streamflags & STREAM_COLOR) { - glUseProgramObjectARB(0); + pglUseProgramObjectARB(0); glDisableClientState(GL_NORMAL_ARRAY); } @@ -261,7 +261,7 @@ void HWLightingModelRenderer::RenderModel(CModel* model, void* data) // render the lot size_t numFaces = mdldef->GetNumFaces(); - glDrawRangeElementsEXT(GL_TRIANGLES, 0, mdldef->GetNumVertices(), + pglDrawRangeElementsEXT(GL_TRIANGLES, 0, mdldef->GetNumVertices(), numFaces*3, GL_UNSIGNED_SHORT, m->hwlmodeldef->m_Indices); // bump stats diff --git a/source/renderer/InstancingModelRenderer.cpp b/source/renderer/InstancingModelRenderer.cpp index 57932cd04f..b65b3f928f 100644 --- a/source/renderer/InstancingModelRenderer.cpp +++ b/source/renderer/InstancingModelRenderer.cpp @@ -148,7 +148,7 @@ void InstancingModelRenderer::Render(RenderModifierPtr modifier, u32 flags) ogl_program_use(g_Renderer.m_VertexShader->m_InstancingLight); idx = g_Renderer.m_VertexShader->m_InstancingLight_SHCoefficients; - glUniform3fvARB(idx, 9, (float*)coeffs); + pglUniform3fvARB(idx, 9, (float*)coeffs); glEnableClientState(GL_NORMAL_ARRAY); } @@ -162,7 +162,7 @@ void InstancingModelRenderer::Render(RenderModifierPtr modifier, u32 flags) if (m->streamflags & STREAM_UV0) glDisableClientState(GL_TEXTURE_COORD_ARRAY); if (m->streamflags & STREAM_COLOR) glDisableClientState(GL_NORMAL_ARRAY); - glUseProgramObjectARB(0); + pglUseProgramObjectARB(0); } while(!modifier->EndPass(m->pass++)); @@ -241,20 +241,20 @@ void InstancingModelRenderer::RenderModel(CModel* model, void* data) CColor sc = model->GetShadingColor(); glColor3f(sc.r, sc.g, sc.b); - glVertexAttrib4fARB(rpvs->m_InstancingLight_Instancing1, mat._11, mat._12, mat._13, mat._14); - glVertexAttrib4fARB(rpvs->m_InstancingLight_Instancing2, mat._21, mat._22, mat._23, mat._24); - glVertexAttrib4fARB(rpvs->m_InstancingLight_Instancing3, mat._31, mat._32, mat._33, mat._34); + pglVertexAttrib4fARB(rpvs->m_InstancingLight_Instancing1, mat._11, mat._12, mat._13, mat._14); + pglVertexAttrib4fARB(rpvs->m_InstancingLight_Instancing2, mat._21, mat._22, mat._23, mat._24); + pglVertexAttrib4fARB(rpvs->m_InstancingLight_Instancing3, mat._31, mat._32, mat._33, mat._34); } else { - glVertexAttrib4fARB(rpvs->m_Instancing_Instancing1, mat._11, mat._12, mat._13, mat._14); - glVertexAttrib4fARB(rpvs->m_Instancing_Instancing2, mat._21, mat._22, mat._23, mat._24); - glVertexAttrib4fARB(rpvs->m_Instancing_Instancing3, mat._31, mat._32, mat._33, mat._34); + pglVertexAttrib4fARB(rpvs->m_Instancing_Instancing1, mat._11, mat._12, mat._13, mat._14); + pglVertexAttrib4fARB(rpvs->m_Instancing_Instancing2, mat._21, mat._22, mat._23, mat._24); + pglVertexAttrib4fARB(rpvs->m_Instancing_Instancing3, mat._31, mat._32, mat._33, mat._34); } // render the lot size_t numFaces = mdldef->GetNumFaces(); - glDrawRangeElementsEXT(GL_TRIANGLES, 0, mdldef->GetNumVertices(), + pglDrawRangeElementsEXT(GL_TRIANGLES, 0, mdldef->GetNumVertices(), numFaces*3, GL_UNSIGNED_SHORT, m->imodeldef->m_Indices); // bump stats diff --git a/source/renderer/PatchRData.cpp b/source/renderer/PatchRData.cpp index 82ed2d4747..2495f443bb 100755 --- a/source/renderer/PatchRData.cpp +++ b/source/renderer/PatchRData.cpp @@ -550,10 +550,10 @@ void CPatchRData::RenderBlends() glVertexPointer(3,GL_FLOAT,stride,base+offsetof(SBlendVertex,m_Position)); glColorPointer(4,GL_UNSIGNED_BYTE,stride,base+offsetof(SBlendVertex,m_Color)); - glClientActiveTextureARB(GL_TEXTURE0); + pglClientActiveTextureARB(GL_TEXTURE0); glTexCoordPointer(2,GL_FLOAT,stride,base+offsetof(SBlendVertex,m_UVs[0])); - glClientActiveTextureARB(GL_TEXTURE1); + pglClientActiveTextureARB(GL_TEXTURE1); glTexCoordPointer(2,GL_FLOAT,stride,base+offsetof(SBlendVertex,m_AlphaUVs[0])); for (uint i=0;i<(uint)m_BlendSplats.size();i++) { @@ -652,8 +652,8 @@ void CPatchRData::RenderBaseSplats() // set up texture environment for base pass MICROLOG(L"base splat textures"); - glActiveTextureARB(GL_TEXTURE0); - glClientActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); + pglClientActiveTextureARB(GL_TEXTURE0); oglCheck(); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); @@ -730,9 +730,9 @@ void CPatchRData::RenderBlendSplats() uint i; // switch on second uv set - glClientActiveTextureARB(GL_TEXTURE1); + pglClientActiveTextureARB(GL_TEXTURE1); glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glClientActiveTextureARB(GL_TEXTURE0); + pglClientActiveTextureARB(GL_TEXTURE0); // switch on the composite alpha map texture (void)ogl_tex_bind(g_Renderer.m_hCompositeAlphaMap, 1); @@ -784,10 +784,10 @@ void CPatchRData::RenderBlendSplats() u32 stride=sizeof(SBlendVertex); glVertexPointer(3,GL_FLOAT,stride,base+offsetof(SBlendVertex,m_Position)); glColorPointer(4,GL_UNSIGNED_BYTE,stride,base+offsetof(SBlendVertex,m_Color)); - glClientActiveTextureARB(GL_TEXTURE0); + pglClientActiveTextureARB(GL_TEXTURE0); glTexCoordPointer(2,GL_FLOAT,stride,base+offsetof(SBlendVertex,m_UVs[0])); - glClientActiveTextureARB(GL_TEXTURE1); + pglClientActiveTextureARB(GL_TEXTURE1); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2,GL_FLOAT,stride,base+offsetof(SBlendVertex,m_AlphaUVs[0])); @@ -822,17 +822,17 @@ void CPatchRData::RenderBlendSplats() glDisable(GL_BLEND); // switch off second uv set - glClientActiveTextureARB(GL_TEXTURE1); + pglClientActiveTextureARB(GL_TEXTURE1); glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glClientActiveTextureARB(GL_TEXTURE0); + pglClientActiveTextureARB(GL_TEXTURE0); // switch off texture unit 1, make unit 0 active texture g_Renderer.BindTexture(1,0); - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); // tidy up client states glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glClientActiveTextureARB(GL_TEXTURE0); + pglClientActiveTextureARB(GL_TEXTURE0); } ///////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/renderer/PlayerRenderer.cpp b/source/renderer/PlayerRenderer.cpp index 449e157731..0120e1693e 100644 --- a/source/renderer/PlayerRenderer.cpp +++ b/source/renderer/PlayerRenderer.cpp @@ -49,7 +49,7 @@ u32 FastPlayerColorRender::BeginPass(uint pass) // Result = (1 - ((1 - PlayerColor) * (1 - Texture.a)))*Texture*Color // TexEnv #0 - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE0); @@ -63,7 +63,7 @@ u32 FastPlayerColorRender::BeginPass(uint pass) glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); // TexEnv #1 - glActiveTextureARB(GL_TEXTURE0+1); + pglActiveTextureARB(GL_TEXTURE0+1); glEnable(GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); @@ -78,7 +78,7 @@ u32 FastPlayerColorRender::BeginPass(uint pass) glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); // TexEnv #2 - glActiveTextureARB(GL_TEXTURE0+2); + pglActiveTextureARB(GL_TEXTURE0+2); glEnable(GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); @@ -92,7 +92,7 @@ u32 FastPlayerColorRender::BeginPass(uint pass) glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); return STREAM_POS|STREAM_COLOR|STREAM_UV0; } @@ -101,11 +101,11 @@ u32 FastPlayerColorRender::BeginPass(uint pass) bool FastPlayerColorRender::EndPass(uint pass) { // Restore state - glActiveTextureARB(GL_TEXTURE1); + pglActiveTextureARB(GL_TEXTURE1); glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE2); + pglActiveTextureARB(GL_TEXTURE2); glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); return true; } @@ -147,7 +147,7 @@ u32 SlowPlayerColorRender::BeginPass(uint pass) if (pass == 0) { // TexEnv #0 - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE); @@ -179,7 +179,7 @@ u32 SlowPlayerColorRender::BeginPass(uint pass) glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); // TexEnv #1 - glActiveTextureARB(GL_TEXTURE1); + pglActiveTextureARB(GL_TEXTURE1); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS); @@ -191,7 +191,7 @@ u32 SlowPlayerColorRender::BeginPass(uint pass) glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); // Setup blending glEnable(GL_BLEND); @@ -211,9 +211,9 @@ bool SlowPlayerColorRender::EndPass(uint pass) return false; // need two passes // Restore state - glActiveTextureARB(GL_TEXTURE1); + pglActiveTextureARB(GL_TEXTURE1); glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); glDisable(GL_BLEND); glDisable(GL_ALPHA_TEST); glDepthMask(1); diff --git a/source/renderer/RenderModifiers.cpp b/source/renderer/RenderModifiers.cpp index 5fa4960fb4..d362cbeb22 100644 --- a/source/renderer/RenderModifiers.cpp +++ b/source/renderer/RenderModifiers.cpp @@ -50,7 +50,7 @@ u32 PlainRenderModifier::BeginPass(uint pass) debug_assert(pass == 0); // set up texture environment for base pass - modulate texture and primary color - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE); diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index f4f8878488..a305dff910 100755 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -960,7 +960,7 @@ void CRenderer::RenderWater() float ty = fmod(time, 35.0f)/35.0f; glTranslatef(tx, ty, 0); - glActiveTextureARB(GL_TEXTURE0); + pglActiveTextureARB(GL_TEXTURE0); glEnable(GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); @@ -1035,7 +1035,7 @@ void CRenderer::RenderWater() } glColor4f(m_WaterColor.r*losMod, m_WaterColor.g*losMod, m_WaterColor.b*losMod, alpha); - glMultiTexCoord2fARB(GL_TEXTURE0, vertX/16.0f, vertZ/16.0f); + pglMultiTexCoord2fARB(GL_TEXTURE0, vertX/16.0f, vertZ/16.0f); glVertex3f(vertX, m_WaterHeight, vertZ); } } //end of x loop @@ -1381,7 +1381,7 @@ bool CRenderer::LoadTexture(CTexture* texture,u32 wrapflags) // BindTexture: bind a GL texture object to current active unit void CRenderer::BindTexture(int unit,GLuint tex) { - glActiveTextureARB(GL_TEXTURE0+unit); + pglActiveTextureARB(GL_TEXTURE0+unit); glBindTexture(GL_TEXTURE_2D,tex); if (tex) { diff --git a/source/renderer/TransparencyRenderer.cpp b/source/renderer/TransparencyRenderer.cpp index e5839cddc6..571109e8e0 100755 --- a/source/renderer/TransparencyRenderer.cpp +++ b/source/renderer/TransparencyRenderer.cpp @@ -373,7 +373,7 @@ void TransparencyRenderer::Render(RenderModifierPtr modifier, u32 flags) // render the lot size_t numFaces = mdef->GetNumFaces(); - glDrawRangeElementsEXT(GL_TRIANGLES, 0, mdef->GetNumVertices(), + pglDrawRangeElementsEXT(GL_TRIANGLES, 0, mdef->GetNumVertices(), numFaces*3, GL_UNSIGNED_SHORT, tmdl->m_Indices); // bump stats diff --git a/source/renderer/VertexBuffer.cpp b/source/renderer/VertexBuffer.cpp index 837d751d49..c3efde8f55 100755 --- a/source/renderer/VertexBuffer.cpp +++ b/source/renderer/VertexBuffer.cpp @@ -44,11 +44,11 @@ CVertexBuffer::CVertexBuffer(size_t vertexSize,bool dynamic) glGetError(); // clear the error state - glGenBuffersARB(1,&m_Handle); - glBindBufferARB(GL_ARRAY_BUFFER_ARB,m_Handle); + pglGenBuffersARB(1,&m_Handle); + pglBindBufferARB(GL_ARRAY_BUFFER_ARB,m_Handle); if (glGetError() != GL_NO_ERROR) throw PSERROR_Renderer_VBOFailed(); - glBufferDataARB(GL_ARRAY_BUFFER_ARB,size,0,m_Dynamic ? GL_DYNAMIC_DRAW_ARB : GL_STATIC_DRAW_ARB); + pglBufferDataARB(GL_ARRAY_BUFFER_ARB,size,0,m_Dynamic ? GL_DYNAMIC_DRAW_ARB : GL_STATIC_DRAW_ARB); if (glGetError() != GL_NO_ERROR) throw PSERROR_Renderer_VBOFailed(); } else { @@ -71,7 +71,7 @@ CVertexBuffer::CVertexBuffer(size_t vertexSize,bool dynamic) CVertexBuffer::~CVertexBuffer() { if (m_Handle) { - glDeleteBuffersARB(1,&m_Handle); + pglDeleteBuffersARB(1,&m_Handle); } else if (m_SysMem) { delete[] m_SysMem; } @@ -192,8 +192,8 @@ void CVertexBuffer::UpdateChunkVertices(VBChunk* chunk,void* data) if (g_Renderer.m_Caps.m_VBO) { debug_assert(m_Handle); glGetError(); // clear the error state - glBindBufferARB(GL_ARRAY_BUFFER_ARB,m_Handle); - glBufferSubDataARB(GL_ARRAY_BUFFER_ARB,chunk->m_Index*m_VertexSize,chunk->m_Count*m_VertexSize,data); + pglBindBufferARB(GL_ARRAY_BUFFER_ARB,m_Handle); + pglBufferSubDataARB(GL_ARRAY_BUFFER_ARB,chunk->m_Index*m_VertexSize,chunk->m_Count*m_VertexSize,data); if (glGetError() != GL_NO_ERROR) throw PSERROR_Renderer_VBOFailed(); } else { debug_assert(m_SysMem); @@ -208,7 +208,7 @@ u8* CVertexBuffer::Bind() { u8* base; if (g_Renderer.m_Caps.m_VBO) { - glBindBufferARB(GL_ARRAY_BUFFER_ARB,m_Handle); + pglBindBufferARB(GL_ARRAY_BUFFER_ARB,m_Handle); base=(u8*) 0; } else { base=(u8*) m_SysMem;