From 15b4be874e6ad4479cf93368477cf59749f80873 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Fri, 2 Aug 2013 01:27:56 +0200 Subject: [PATCH] Removed the ARB keyword from the VBO managing GL functions, as they are part of the core specification as of OpenGL 3.3 --HG-- branch : gsoc2013-dfighter --- code/nel/src/3d/driver/OpenGL3/GL/glext.h | 44 +++++++++---------- .../OpenGL3/driver_opengl_extension.cpp | 44 +++++++++---------- .../driver/OpenGL3/driver_opengl_extension.h | 22 +++++----- .../driver/OpenGL3/driver_opengl_states.cpp | 2 +- .../driver_opengl_vertex_buffer_hard.cpp | 36 +++++++-------- 5 files changed, 74 insertions(+), 74 deletions(-) diff --git a/code/nel/src/3d/driver/OpenGL3/GL/glext.h b/code/nel/src/3d/driver/OpenGL3/GL/glext.h index 89a129dfa..3bb6dd4cd 100644 --- a/code/nel/src/3d/driver/OpenGL3/GL/glext.h +++ b/code/nel/src/3d/driver/OpenGL3/GL/glext.h @@ -7419,29 +7419,29 @@ typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); +GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); #endif #ifndef GL_ARB_occlusion_query diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp index 259e1593e..d32cf437f 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp @@ -283,17 +283,17 @@ NEL_PFNGLPROGRAMLOCALPARAMETER4FVARBPROC nglGetProgramLocalParameter4fvARB; //NEL_PFNGLISPROGRAMARBPROC nglIsProgramARB; // GL_ARB_vertex_buffer_object -PFNGLBINDBUFFERARBPROC nglBindBufferARB; -PFNGLDELETEBUFFERSARBPROC nglDeleteBuffersARB; -PFNGLGENBUFFERSARBPROC nglGenBuffersARB; -PFNGLISBUFFERARBPROC nglIsBufferARB; -PFNGLBUFFERDATAARBPROC nglBufferDataARB; -PFNGLBUFFERSUBDATAARBPROC nglBufferSubDataARB; -PFNGLGETBUFFERSUBDATAARBPROC nglGetBufferSubDataARB; -PFNGLMAPBUFFERARBPROC nglMapBufferARB; -PFNGLUNMAPBUFFERARBPROC nglUnmapBufferARB; -PFNGLGETBUFFERPARAMETERIVARBPROC nglGetBufferParameterivARB; -PFNGLGETBUFFERPOINTERVARBPROC nglGetBufferPointervARB; +PFNGLBINDBUFFERPROC nglBindBuffer; +PFNGLDELETEBUFFERSPROC nglDeleteBuffers; +PFNGLGENBUFFERSPROC nglGenBuffers; +PFNGLISBUFFERPROC nglIsBuffer; +PFNGLBUFFERDATAPROC nglBufferData; +PFNGLBUFFERSUBDATAPROC nglBufferSubData; +PFNGLGETBUFFERSUBDATAPROC nglGetBufferSubData; +PFNGLMAPBUFFERPROC nglMapBuffer; +PFNGLUNMAPBUFFERPROC nglUnmapBuffer; +PFNGLGETBUFFERPARAMETERIVPROC nglGetBufferParameteriv; +PFNGLGETBUFFERPOINTERVPROC nglGetBufferPointerv; // GL_ARB_vertex_program PFNGLVERTEXATTRIB1SARBPROC nglVertexAttrib1sARB; @@ -971,17 +971,17 @@ static bool setupARBVertexBufferObject(const char *glext) CHECK_EXT("GL_ARB_vertex_buffer_object"); - CHECK_ADDRESS(PFNGLBINDBUFFERARBPROC, glBindBufferARB); - CHECK_ADDRESS(PFNGLDELETEBUFFERSARBPROC, glDeleteBuffersARB); - CHECK_ADDRESS(PFNGLGENBUFFERSARBPROC, glGenBuffersARB); - CHECK_ADDRESS(PFNGLISBUFFERARBPROC, glIsBufferARB); - CHECK_ADDRESS(PFNGLBUFFERDATAARBPROC, glBufferDataARB); - CHECK_ADDRESS(PFNGLBUFFERSUBDATAARBPROC, glBufferSubDataARB); - CHECK_ADDRESS(PFNGLGETBUFFERSUBDATAARBPROC, glGetBufferSubDataARB); - CHECK_ADDRESS(PFNGLMAPBUFFERARBPROC, glMapBufferARB); - CHECK_ADDRESS(PFNGLUNMAPBUFFERARBPROC, glUnmapBufferARB); - CHECK_ADDRESS(PFNGLGETBUFFERPARAMETERIVARBPROC, glGetBufferParameterivARB); - CHECK_ADDRESS(PFNGLGETBUFFERPOINTERVARBPROC, glGetBufferPointervARB); + CHECK_ADDRESS(PFNGLBINDBUFFERPROC, glBindBuffer); + CHECK_ADDRESS(PFNGLDELETEBUFFERSPROC, glDeleteBuffers); + CHECK_ADDRESS(PFNGLGENBUFFERSPROC, glGenBuffers); + CHECK_ADDRESS(PFNGLISBUFFERPROC, glIsBuffer); + CHECK_ADDRESS(PFNGLBUFFERDATAPROC, glBufferData); + CHECK_ADDRESS(PFNGLBUFFERSUBDATAPROC, glBufferSubData); + CHECK_ADDRESS(PFNGLGETBUFFERSUBDATAPROC, glGetBufferSubData); + CHECK_ADDRESS(PFNGLMAPBUFFERPROC, glMapBuffer); + CHECK_ADDRESS(PFNGLUNMAPBUFFERPROC, glUnmapBuffer); + CHECK_ADDRESS(PFNGLGETBUFFERPARAMETERIVPROC, glGetBufferParameteriv); + CHECK_ADDRESS(PFNGLGETBUFFERPOINTERVPROC, glGetBufferPointerv); return true; } diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h index f274f658f..d684e0741 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h @@ -495,17 +495,17 @@ extern NEL_PFNGLISPROGRAMARBPROC nglIsProgramARB; // GL_ARB_vertex_buffer_object //================================== -extern PFNGLBINDBUFFERARBPROC nglBindBufferARB; -extern PFNGLDELETEBUFFERSARBPROC nglDeleteBuffersARB; -extern PFNGLGENBUFFERSARBPROC nglGenBuffersARB; -extern PFNGLISBUFFERARBPROC nglIsBufferARB; -extern PFNGLBUFFERDATAARBPROC nglBufferDataARB; -extern PFNGLBUFFERSUBDATAARBPROC nglBufferSubDataARB; -extern PFNGLGETBUFFERSUBDATAARBPROC nglGetBufferSubDataARB; -extern PFNGLMAPBUFFERARBPROC nglMapBufferARB; -extern PFNGLUNMAPBUFFERARBPROC nglUnmapBufferARB; -extern PFNGLGETBUFFERPARAMETERIVARBPROC nglGetBufferParameterivARB; -extern PFNGLGETBUFFERPOINTERVARBPROC nglGetBufferPointervARB; +extern PFNGLBINDBUFFERPROC nglBindBuffer; +extern PFNGLDELETEBUFFERSPROC nglDeleteBuffers; +extern PFNGLGENBUFFERSPROC nglGenBuffers; +extern PFNGLISBUFFERPROC nglIsBuffer; +extern PFNGLBUFFERDATAPROC nglBufferData; +extern PFNGLBUFFERSUBDATAPROC nglBufferSubData; +extern PFNGLGETBUFFERSUBDATAPROC nglGetBufferSubData; +extern PFNGLMAPBUFFERPROC nglMapBuffer; +extern PFNGLUNMAPBUFFERPROC nglUnmapBuffer; +extern PFNGLGETBUFFERPARAMETERIVPROC nglGetBufferParameteriv; +extern PFNGLGETBUFFERPOINTERVPROC nglGetBufferPointerv; diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp index 21a79c795..aeb693197 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp @@ -1031,7 +1031,7 @@ void CDriverGLStates3::forceBindARBVertexBuffer(uint objectID) { H_AUTO_OGL(CDriverGLStates3_forceBindARBVertexBuffer) - nglBindBufferARB(GL_ARRAY_BUFFER_ARB, objectID); + nglBindBuffer(GL_ARRAY_BUFFER_ARB, objectID); _CurrARBVertexBuffer = objectID; } diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp index e0bb65610..efa01bd28 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp @@ -77,20 +77,20 @@ IVertexBufferHardGL *CVertexArrayRange::createVBHardGL(uint size, CVertexBuffer GLuint vertexBufferID; glGetError(); - nglGenBuffersARB(1, &vertexBufferID); + nglGenBuffers(1, &vertexBufferID); if (glGetError() != GL_NO_ERROR) return NULL; _Driver->_DriverGLStates.forceBindARBVertexBuffer(vertexBufferID); switch(_VBType) { case CVertexBuffer::AGPPreferred: - nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); + nglBufferData(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); break; case CVertexBuffer::StaticPreferred: if (_Driver->getStaticMemoryToVRAM()) - nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); + nglBufferData(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); else - nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); + nglBufferData(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); break; default: nlassert(0); @@ -98,7 +98,7 @@ IVertexBufferHardGL *CVertexArrayRange::createVBHardGL(uint size, CVertexBuffer } if (glGetError() != GL_NO_ERROR) { - nglDeleteBuffersARB(1, &vertexBufferID); + nglDeleteBuffers(1, &vertexBufferID); return NULL; } CVertexBufferHard *newVbHard= new CVertexBufferHard(_Driver, vb); @@ -140,8 +140,8 @@ void CVertexArrayRange::updateLostBuffers() { nlassert((*it)->_VertexObjectId); GLuint id = (GLuint) (*it)->_VertexObjectId; - nlassert(nglIsBufferARB(id)); - nglDeleteBuffersARB(1, &id); + nlassert(nglIsBuffer(id)); + nglDeleteBuffers(1, &id); (*it)->_VertexObjectId = 0; (*it)->VB->setLocation(CVertexBuffer::NotResident); } @@ -184,8 +184,8 @@ CVertexBufferHard::~CVertexBufferHard() if (_VertexObjectId) { GLuint id = (GLuint) _VertexObjectId; - nlassert(nglIsBufferARB(id)); - nglDeleteBuffersARB(1, &id); + nlassert(nglIsBuffer(id)); + nglDeleteBuffers(1, &id); } if (_VertexArrayRange) { @@ -223,7 +223,7 @@ void *CVertexBufferHard::lock() // recreate a vb GLuint vertexBufferID; - nglGenBuffersARB(1, &vertexBufferID); + nglGenBuffers(1, &vertexBufferID); if (glGetError() != GL_NO_ERROR) { @@ -235,13 +235,13 @@ void *CVertexBufferHard::lock() switch(_MemType) { case CVertexBuffer::AGPPreferred: - nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); + nglBufferData(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); break; case CVertexBuffer::StaticPreferred: if (_Driver->getStaticMemoryToVRAM()) - nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); + nglBufferData(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); else - nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); + nglBufferData(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); break; default: nlassert(0); @@ -250,7 +250,7 @@ void *CVertexBufferHard::lock() if (glGetError() != GL_NO_ERROR) { _Driver->incrementResetCounter(); - nglDeleteBuffersARB(1, &vertexBufferID); + nglDeleteBuffers(1, &vertexBufferID); return &_DummyVB[0];; } _VertexObjectId = vertexBufferID; @@ -268,11 +268,11 @@ void *CVertexBufferHard::lock() _Driver->_DriverGLStates.bindARBVertexBuffer(_VertexObjectId); - _VertexPtr = nglMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + _VertexPtr = nglMapBuffer(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); if (!_VertexPtr) { - nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); - nlassert(nglIsBufferARB((GLuint) _VertexObjectId)); + nglUnmapBuffer(GL_ARRAY_BUFFER_ARB); + nlassert(nglIsBuffer((GLuint) _VertexObjectId)); invalidate(); return &_DummyVB[0]; } @@ -312,7 +312,7 @@ void CVertexBufferHard::unlock() #endif GLboolean unmapOk = GL_FALSE; - unmapOk = nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); + unmapOk = nglUnmapBuffer(GL_ARRAY_BUFFER_ARB); #ifdef NL_DEBUG _Unmapping = false;