Restructred the enabling of vertex array object support to allow one to set enable the default via osg::State.
Added OSG_VERTEX_BUFFER_HINT env var to osg::DisplaySettings with VERTEX_BUFFER_OBJECT/VBO, VERTEX_ARRAY_OBJECT/VAO and NO_PREFERENCE to allow one to foce on VBO or VAO usage. Restructred BufferObject assigned in osg::Geometry Added
This commit is contained in:
@@ -96,7 +96,9 @@ State::State():
|
||||
_isFogCoordSupported = false;
|
||||
_isVertexBufferObjectSupported = false;
|
||||
_isVertexArrayObjectSupported = false;
|
||||
_useVertexArrayObject = false;
|
||||
|
||||
_forceVertexBufferObject = false;
|
||||
_forceVertexArrayObject = false;
|
||||
|
||||
_lastAppliedProgramObject = 0;
|
||||
|
||||
@@ -176,7 +178,8 @@ void State::initializeExtensionProcs()
|
||||
_isVertexArrayObjectSupported = _glExtensions->isVAOSupported;
|
||||
|
||||
const DisplaySettings* ds = getDisplaySettings() ? getDisplaySettings() : osg::DisplaySettings::instance();
|
||||
_useVertexArrayObject = _isVertexArrayObjectSupported && (ds->getGeometryImplementation()==DisplaySettings::VERTEX_ARRAY_OBJECT);
|
||||
_forceVertexArrayObject = _isVertexArrayObjectSupported && (ds->getVertexBufferHint()==DisplaySettings::VERTEX_ARRAY_OBJECT);
|
||||
_forceVertexBufferObject = _forceVertexArrayObject || (_isVertexBufferObjectSupported && (ds->getVertexBufferHint()==DisplaySettings::VERTEX_BUFFER_OBJECT));
|
||||
|
||||
|
||||
// Set up up global VertexArrayState object
|
||||
|
||||
Reference in New Issue
Block a user