Moved GLBufferObject::Extensions structure into osg::GL2Extensions

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14570 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-12-04 18:13:11 +00:00
parent 69407f4054
commit d02c0bdc49
9 changed files with 65 additions and 23 deletions

View File

@@ -16,6 +16,7 @@
#define OSG_BUFFEROBJECT 1
#include <osg/GL>
#include <osg/GL2Extensions>
#include <osg/Object>
#include <osg/buffered_value>
#include <osg/FrameStamp>
@@ -248,7 +249,7 @@ class OSG_EXPORT GLBufferObject : public Referenced
void assign(BufferObject* bufferObject);
bool isPBOSupported() const { return _extensions->isPBOSupported(); }
bool isPBOSupported() const { return _extensions->isPBOSupported; }
static GLBufferObject* createGLBufferObject(unsigned int contextID, const BufferObject* bufferObject);
@@ -258,7 +259,7 @@ class OSG_EXPORT GLBufferObject : public Referenced
static void discardAllDeletedBufferObjects(unsigned int contextID);
static void flushDeletedBufferObjects(unsigned int contextID,double currentTime, double& availbleTime);
static void releaseGLBufferObject(unsigned int contextID, GLBufferObject* to);
#if 0
/** Extensions class which encapsulates the querying of extensions and
* associated function pointers, and provide convenience wrappers to
* check for the extensions or use the associated functions.*/
@@ -343,6 +344,7 @@ class OSG_EXPORT GLBufferObject : public Referenced
* typically used when you have different extensions supported across graphics pipes
* but need to ensure that they all use the same low common denominator extensions.*/
static void setExtensions(unsigned int contextID,Extensions* extensions);
#endif
bool hasAllBufferDataBeenRead() const;
@@ -380,7 +382,7 @@ class OSG_EXPORT GLBufferObject : public Referenced
unsigned int _frameLastUsed;
public:
Extensions* _extensions;
GL2Extensions* _extensions;
};

View File

@@ -719,10 +719,29 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
void (GL_APIENTRY * glGetActiveAtomicCounterBufferiv)( GLuint program, GLuint bufferIndex, GLenum pname, GLint* params );
void (GL_APIENTRY * glDispatchCompute)( GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ );
// Buffer Object extensions
bool isBufferObjectSupported;
bool isPBOSupported;
bool isTBOSupported;
void (GL_APIENTRY * glGenBuffers) (GLsizei n, GLuint *buffers);
void (GL_APIENTRY * glBindBuffer) (GLenum target, GLuint buffer);
void (GL_APIENTRY * glBufferData) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
void (GL_APIENTRY * glBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
void (GL_APIENTRY * glDeleteBuffers) (GLsizei n, const GLuint *buffers);
GLboolean (GL_APIENTRY * glIsBuffer) (GLuint buffer);
void (GL_APIENTRY * glGetBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
GLvoid* (GL_APIENTRY * glMapBuffer) (GLenum target, GLenum access);
GLvoid* (GL_APIENTRY * glMapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
GLboolean (GL_APIENTRY * glUnmapBuffer) (GLenum target);
void (GL_APIENTRY * glGetBufferParameteriv) (GLenum target, GLenum pname, GLint *params);
void (GL_APIENTRY * glGetBufferPointerv) (GLenum target, GLenum pname, GLvoid* *params);
void (GL_APIENTRY * glBindBufferRange) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
void (GL_APIENTRY * glBindBufferBase) (GLenum target, GLuint index, GLuint buffer);
void (GL_APIENTRY * glTexBuffer) (GLenum target, GLenum internalFormat, GLuint buffer);
void (GL_APIENTRY * glMemoryBarrier)( GLbitfield barriers );
GLvoid* (GL_APIENTRY * glMapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
void (GL_APIENTRY * glBindBufferBase)(GLenum target, GLuint index, GLuint buffer);
};
}

View File

@@ -121,7 +121,7 @@ class OSG_EXPORT TextureBuffer : public Texture
_id(0),
_usageHint(usageHint)
{
_extensions = osg::GLBufferObject::getExtensions(contextID, true);
_extensions = osg::GL2Extensions::Get(contextID, true);
}
void bindBuffer(GLenum target);
@@ -134,7 +134,7 @@ class OSG_EXPORT TextureBuffer : public Texture
public:
GLuint _id;
GLenum _usageHint;
osg::GLBufferObject::Extensions* _extensions;
osg::GL2Extensions* _extensions;
};
typedef osg::buffered_object<osg::ref_ptr<TextureBufferObject> > TextureBufferObjectList;