Streamlined State::_is*Supported variables
This commit is contained in:
@@ -715,7 +715,7 @@ class OSG_EXPORT State : public Referenced
|
||||
void dirtyAllVertexArrays();
|
||||
|
||||
|
||||
inline bool isVertexBufferObjectSupported() const { return _isVertexBufferObjectSupportResolved?_isVertexBufferObjectSupported:computeVertexBufferObjectSupported(); }
|
||||
inline bool isVertexBufferObjectSupported() const { return _isVertexBufferObjectSupported; }
|
||||
|
||||
inline bool isVertexArrayObjectSupported() const { return _isVertexArrayObjectSupported; }
|
||||
|
||||
@@ -1302,19 +1302,11 @@ class OSG_EXPORT State : public Referenced
|
||||
void loadModelViewMatrix();
|
||||
|
||||
|
||||
mutable bool _isSecondaryColorSupportResolved;
|
||||
mutable bool _isSecondaryColorSupported;
|
||||
bool computeSecondaryColorSupported() const;
|
||||
|
||||
mutable bool _isFogCoordSupportResolved;
|
||||
mutable bool _isFogCoordSupported;
|
||||
bool computeFogCoordSupported() const;
|
||||
|
||||
mutable bool _isVertexBufferObjectSupportResolved;
|
||||
mutable bool _isVertexBufferObjectSupported;
|
||||
bool computeVertexBufferObjectSupported() const;
|
||||
|
||||
bool _isSecondaryColorSupported;
|
||||
bool _isFogCoordSupported;
|
||||
bool _isVertexBufferObjectSupported;
|
||||
bool _isVertexArrayObjectSupported;
|
||||
|
||||
bool _useVertexArrayObject;
|
||||
|
||||
typedef void (GL_APIENTRY * ActiveTextureProc) (GLenum texture);
|
||||
|
||||
@@ -92,15 +92,9 @@ State::State():
|
||||
_currentEBO = 0;
|
||||
_currentPBO = 0;
|
||||
|
||||
_isSecondaryColorSupportResolved = false;
|
||||
_isSecondaryColorSupported = false;
|
||||
|
||||
_isFogCoordSupportResolved = false;
|
||||
_isFogCoordSupported = false;
|
||||
|
||||
_isVertexBufferObjectSupportResolved = false;
|
||||
_isVertexBufferObjectSupported = false;
|
||||
|
||||
_isVertexArrayObjectSupported = false;
|
||||
_useVertexArrayObject = false;
|
||||
|
||||
@@ -176,13 +170,12 @@ void State::initializeExtensionProcs()
|
||||
_glExtensions = new GLExtensions(_contextID);
|
||||
GLExtensions::Set(_contextID, _glExtensions.get());
|
||||
|
||||
computeSecondaryColorSupported();
|
||||
computeFogCoordSupported();
|
||||
computeVertexBufferObjectSupported();
|
||||
_isSecondaryColorSupported = osg::isGLExtensionSupported(_contextID,"GL_EXT_secondary_color");
|
||||
_isFogCoordSupported = osg::isGLExtensionSupported(_contextID,"GL_EXT_fog_coord");
|
||||
_isVertexBufferObjectSupported = OSG_GLES2_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_buffer_object");
|
||||
_isVertexArrayObjectSupported = _glExtensions->isVAOSupported;
|
||||
|
||||
const DisplaySettings* ds = getDisplaySettings() ? getDisplaySettings() : osg::DisplaySettings::instance();
|
||||
|
||||
_isVertexArrayObjectSupported = _glExtensions->isVAOSupported;
|
||||
_useVertexArrayObject = _isVertexArrayObjectSupported && (ds->getGeometryImplementation()==DisplaySettings::VERTEX_ARRAY_OBJECT);
|
||||
|
||||
|
||||
@@ -1079,33 +1072,6 @@ unsigned int State::getClientActiveTextureUnit() const
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// End of Moved from State header
|
||||
//
|
||||
|
||||
bool State::computeSecondaryColorSupported() const
|
||||
{
|
||||
_isSecondaryColorSupportResolved = true;
|
||||
_isSecondaryColorSupported = osg::isGLExtensionSupported(_contextID,"GL_EXT_secondary_color");
|
||||
return _isSecondaryColorSupported;
|
||||
}
|
||||
|
||||
bool State::computeFogCoordSupported() const
|
||||
{
|
||||
_isFogCoordSupportResolved = true;
|
||||
_isFogCoordSupported = osg::isGLExtensionSupported(_contextID,"GL_EXT_fog_coord");
|
||||
return _isFogCoordSupported;
|
||||
}
|
||||
|
||||
bool State::computeVertexBufferObjectSupported() const
|
||||
{
|
||||
_isVertexBufferObjectSupportResolved = true;
|
||||
_isVertexBufferObjectSupported = OSG_GLES2_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_buffer_object");
|
||||
return _isVertexBufferObjectSupported;
|
||||
}
|
||||
|
||||
bool State::checkGLErrors(const char* str) const
|
||||
{
|
||||
GLenum errorNo = glGetError();
|
||||
|
||||
Reference in New Issue
Block a user