From 134b2e506f4d84d3d1fbd304235a59ef9a23ceaa Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 6 Jan 2015 17:23:26 +0000 Subject: [PATCH] Cleaned up GL_TEXTURE_BUFFER_*ARB usage as include/osg/GLDefines now provides the non ARB variants git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14652 16af8721-9629-0410-8352-f15c8da7e697 --- include/osg/TextureBuffer | 10 +--------- src/osg/StateSet.cpp | 2 +- src/osg/TextureBuffer.cpp | 18 +++++++++--------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/include/osg/TextureBuffer b/include/osg/TextureBuffer index 7130bdb37..36a476ef7 100644 --- a/include/osg/TextureBuffer +++ b/include/osg/TextureBuffer @@ -19,14 +19,6 @@ #include #include -#ifndef GL_ARB_texture_buffer_object - #define GL_TEXTURE_BUFFER_ARB 0x8C2A - #define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B - #define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C - #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D - #define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -#endif - namespace osg { /** Encapsulates OpenGL texture buffer functionality. @@ -48,7 +40,7 @@ class OSG_EXPORT TextureBuffer : public Texture /** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */ virtual int compare(const StateAttribute& rhs) const; - virtual GLenum getTextureTarget() const { return GL_TEXTURE_BUFFER_ARB; } + virtual GLenum getTextureTarget() const { return GL_TEXTURE_BUFFER; } /** Sets the texture image. */ void setImage(Image* image); diff --git a/src/osg/StateSet.cpp b/src/osg/StateSet.cpp index fce671172..16defaa33 100644 --- a/src/osg/StateSet.cpp +++ b/src/osg/StateSet.cpp @@ -50,7 +50,7 @@ class TextureGLModeSet _textureModeSet.insert(GL_TEXTURE_1D); _textureModeSet.insert(GL_TEXTURE_2D); _textureModeSet.insert(GL_TEXTURE_3D); - _textureModeSet.insert(GL_TEXTURE_BUFFER_ARB); + _textureModeSet.insert(GL_TEXTURE_BUFFER); _textureModeSet.insert(GL_TEXTURE_CUBE_MAP); _textureModeSet.insert(GL_TEXTURE_RECTANGLE_NV); diff --git a/src/osg/TextureBuffer.cpp b/src/osg/TextureBuffer.cpp index d7b1f0b28..8cf70e303 100644 --- a/src/osg/TextureBuffer.cpp +++ b/src/osg/TextureBuffer.cpp @@ -113,9 +113,9 @@ void TextureBuffer::apply(State& state) const if (_image.valid() && getModifiedCount(contextID) != _image->getModifiedCount()) { computeInternalFormat(); - textureBufferObject->bindBuffer(GL_TEXTURE_BUFFER_ARB); + textureBufferObject->bindBuffer(GL_TEXTURE_BUFFER); textureBufferObject->bufferSubData(_image.get() ); - textureBufferObject->unbindBuffer(GL_TEXTURE_BUFFER_ARB); + textureBufferObject->unbindBuffer(GL_TEXTURE_BUFFER); _modifiedCount[contextID] = _image->getModifiedCount(); } textureObject->bind(); @@ -135,7 +135,7 @@ void TextureBuffer::apply(State& state) const } else if (_image.valid() && _image->data()) { - textureObject = generateTextureObject(this, contextID,GL_TEXTURE_BUFFER_ARB); + textureObject = generateTextureObject(this, contextID, GL_TEXTURE_BUFFER); _textureObjectBuffer[contextID] = textureObject; textureObject->bind(); @@ -154,10 +154,10 @@ void TextureBuffer::apply(State& state) const computeInternalFormat(); _textureWidth = _image->s(); - textureBufferObject->bindBuffer(GL_TEXTURE_BUFFER_ARB); + textureBufferObject->bindBuffer(GL_TEXTURE_BUFFER); textureBufferObject->bufferData( _image.get() ); textureObject->setAllocated(true); - textureBufferObject->unbindBuffer(GL_TEXTURE_BUFFER_ARB); + textureBufferObject->unbindBuffer(GL_TEXTURE_BUFFER); textureObject->bind(); textureBufferObject->texBuffer(_internalFormat); @@ -166,7 +166,7 @@ void TextureBuffer::apply(State& state) const } else { - glBindTexture(GL_TEXTURE_BUFFER_ARB, 0); + glBindTexture(GL_TEXTURE_BUFFER, 0); } #else @@ -208,15 +208,15 @@ void TextureBuffer::TextureBufferObject::unbindBuffer(GLenum target) void TextureBuffer::TextureBufferObject::texBuffer(GLenum internalFormat) { - _extensions->glTexBuffer(GL_TEXTURE_BUFFER_ARB, internalFormat, _id); + _extensions->glTexBuffer(GL_TEXTURE_BUFFER, internalFormat, _id); } void TextureBuffer::TextureBufferObject::bufferData( osg::Image* image ) { - _extensions->glBufferData(GL_TEXTURE_BUFFER_ARB, image->getTotalDataSize(), image->data(), _usageHint); + _extensions->glBufferData(GL_TEXTURE_BUFFER, image->getTotalDataSize(), image->data(), _usageHint); } void TextureBuffer::TextureBufferObject::bufferSubData( osg::Image* image ) { - _extensions->glBufferSubData(GL_TEXTURE_BUFFER_ARB, 0, image->getTotalDataSize(), image->data()); + _extensions->glBufferSubData(GL_TEXTURE_BUFFER, 0, image->getTotalDataSize(), image->data()); }