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:
Robert Osfield
2016-08-12 18:44:38 +01:00
parent d8fdf33be5
commit 94891778c4
10 changed files with 175 additions and 116 deletions

View File

@@ -716,10 +716,11 @@ class OSG_EXPORT State : public Referenced
inline bool isVertexBufferObjectSupported() const { return _isVertexBufferObjectSupported; }
inline bool useVertexBufferObject(bool useVBO) const { return _forceVertexBufferObject || (_isVertexBufferObjectSupported && useVBO); }
inline bool isVertexArrayObjectSupported() const { return _isVertexArrayObjectSupported; }
inline bool useVertexArrayObject(bool useVAO) const { return _forceVertexArrayObject || (_isVertexArrayObjectSupported && useVAO); }
inline bool useVertexArrayObject() const { return _useVertexArrayObject; }
inline void setLastAppliedProgramObject(const Program::PerContextProgram* program)
{
@@ -1306,8 +1307,8 @@ class OSG_EXPORT State : public Referenced
bool _isFogCoordSupported;
bool _isVertexBufferObjectSupported;
bool _isVertexArrayObjectSupported;
bool _useVertexArrayObject;
bool _forceVertexBufferObject;
bool _forceVertexArrayObject;
typedef void (GL_APIENTRY * ActiveTextureProc) (GLenum texture);
typedef void (GL_APIENTRY * FogCoordPointerProc) (GLenum type, GLsizei stride, const GLvoid *pointer);