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:
@@ -51,7 +51,7 @@ void BufferIndexBinding::apply(State& state) const
|
||||
{
|
||||
GLBufferObject* glObject
|
||||
= _bufferObject->getOrCreateGLBufferObject(state.getContextID());
|
||||
if (!glObject->_extensions->isUniformBufferObjectSupported())
|
||||
if (!glObject->_extensions->isUniformBufferObjectSupported)
|
||||
return;
|
||||
if (glObject->isDirty()) glObject->compileBuffer();
|
||||
glObject->_extensions->glBindBufferRange(_target, _index,
|
||||
|
||||
@@ -64,7 +64,7 @@ GLBufferObject::GLBufferObject(unsigned int contextID, BufferObject* bufferObjec
|
||||
{
|
||||
assign(bufferObject);
|
||||
|
||||
_extensions = GLBufferObject::getExtensions(contextID, true);
|
||||
_extensions = GL2Extensions::Get(contextID, true);
|
||||
|
||||
if (glObjectID==0)
|
||||
{
|
||||
@@ -264,6 +264,7 @@ void GLBufferObject::setBufferDataHasBeenRead(const osg::BufferData* bd)
|
||||
++entry.numRead;
|
||||
}
|
||||
|
||||
#if 0
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Extension support
|
||||
@@ -448,6 +449,7 @@ void GLBufferObject::Extensions::glTexBuffer( GLenum target, GLenum internalForm
|
||||
if ( _glTexBuffer ) _glTexBuffer( target, internalFormat, buffer );
|
||||
else OSG_WARN<<"Error: glTexBuffer not supported by OpenGL driver\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -1679,7 +1681,7 @@ void PixelDataBufferObject::bindBufferInWriteMode(State& state)
|
||||
//--------------------------------------------------------------------------------
|
||||
void PixelDataBufferObject::unbindBuffer(unsigned int contextID) const
|
||||
{
|
||||
GLBufferObject::Extensions* extensions = GLBufferObject::getExtensions(contextID,true);
|
||||
GL2Extensions* extensions = GL2Extensions::Get(contextID, true);
|
||||
|
||||
switch(_mode[contextID])
|
||||
{
|
||||
|
||||
@@ -273,8 +273,27 @@ GL2Extensions::GL2Extensions(unsigned int contextID)
|
||||
setGLExtensionFuncPtr(glDispatchCompute, "glDispatchCompute" );
|
||||
|
||||
setGLExtensionFuncPtr(glMemoryBarrier, "glMemoryBarrier", "glMemoryBarrierEXT" );
|
||||
|
||||
setGLExtensionFuncPtr(glGenBuffers, "glGenBuffers","glGenBuffersARB");
|
||||
setGLExtensionFuncPtr(glBindBuffer, "glBindBuffer","glBindBufferARB");
|
||||
setGLExtensionFuncPtr(glBufferData, "glBufferData","glBufferDataARB");
|
||||
setGLExtensionFuncPtr(glBufferSubData, "glBufferSubData","glBufferSubDataARB");
|
||||
setGLExtensionFuncPtr(glDeleteBuffers, "glDeleteBuffers","glDeleteBuffersARB");
|
||||
setGLExtensionFuncPtr(glIsBuffer, "glIsBuffer","glIsBufferARB");
|
||||
setGLExtensionFuncPtr(glGetBufferSubData, "glGetBufferSubData","glGetBufferSubDataARB");
|
||||
setGLExtensionFuncPtr(glMapBuffer, "glMapBuffer","glMapBufferARB");
|
||||
setGLExtensionFuncPtr(glMapBufferRange, "glMapBufferRange" );
|
||||
setGLExtensionFuncPtr(glUnmapBuffer, "glUnmapBuffer","glUnmapBufferARB");
|
||||
setGLExtensionFuncPtr(glGetBufferParameteriv, "glGetBufferParameteriv","glGetBufferParameterivARB");
|
||||
setGLExtensionFuncPtr(glGetBufferPointerv, "glGetBufferPointerv","glGetBufferPointervARB");
|
||||
setGLExtensionFuncPtr(glBindBufferRange, "glBindBufferRange");
|
||||
setGLExtensionFuncPtr(glBindBufferBase, "glBindBufferBase", "glBindBufferBaseEXT", "glBindBufferBaseNV" );
|
||||
setGLExtensionFuncPtr(glTexBuffer, "glTexBuffer","glTexBufferARB" );
|
||||
|
||||
isPBOSupported = OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_pixel_buffer_object");
|
||||
isUniformBufferObjectSupported = osg::isGLExtensionSupported(contextID, "GL_ARB_uniform_buffer_object");
|
||||
isTBOSupported = osg::isGLExtensionSupported(contextID,"GL_ARB_texture_buffer_object");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@ void Geometry::compileGLObjects(RenderInfo& renderInfo) const
|
||||
{
|
||||
State& state = *renderInfo.getState();
|
||||
unsigned int contextID = state.getContextID();
|
||||
GLBufferObject::Extensions* extensions = GLBufferObject::getExtensions(contextID, true);
|
||||
GL2Extensions* extensions = state.get<GL2Extensions>();
|
||||
if (!extensions) return;
|
||||
|
||||
typedef std::set<BufferObject*> BufferObjects;
|
||||
|
||||
Reference in New Issue
Block a user