Added initializers and handling of null case
This commit is contained in:
parent
79f174aee4
commit
bc8452512f
@ -517,10 +517,14 @@ class OSG_EXPORT State : public Referenced
|
||||
const GLBufferObject* getCurrentVertexBufferObject() { return _currentVBO; }
|
||||
inline void bindVertexBufferObject(osg::GLBufferObject* vbo)
|
||||
{
|
||||
if (vbo == _currentVBO) return;
|
||||
if (vbo->isDirty()) vbo->compileBuffer();
|
||||
else vbo->bindBuffer();
|
||||
_currentVBO = vbo;
|
||||
if (vbo)
|
||||
{
|
||||
if (vbo == _currentVBO) return;
|
||||
if (vbo->isDirty()) vbo->compileBuffer();
|
||||
else vbo->bindBuffer();
|
||||
_currentVBO = vbo;
|
||||
}
|
||||
else unbindVertexBufferObject();
|
||||
}
|
||||
|
||||
inline void unbindVertexBufferObject()
|
||||
@ -535,10 +539,14 @@ class OSG_EXPORT State : public Referenced
|
||||
|
||||
inline void bindElementBufferObject(osg::GLBufferObject* ebo)
|
||||
{
|
||||
if (ebo == _currentEBO) return;
|
||||
if (ebo->isDirty()) ebo->compileBuffer();
|
||||
else ebo->bindBuffer();
|
||||
_currentEBO = ebo;
|
||||
if (ebo)
|
||||
{
|
||||
if (ebo == _currentEBO) return;
|
||||
if (ebo->isDirty()) ebo->compileBuffer();
|
||||
else ebo->bindBuffer();
|
||||
_currentEBO = ebo;
|
||||
}
|
||||
else unbindElementBufferObject();
|
||||
}
|
||||
|
||||
inline void unbindElementBufferObject()
|
||||
@ -553,12 +561,19 @@ class OSG_EXPORT State : public Referenced
|
||||
|
||||
inline void bindPixelBufferObject(osg::GLBufferObject* pbo)
|
||||
{
|
||||
if (pbo == _currentPBO) return;
|
||||
if (pbo)
|
||||
{
|
||||
if (pbo == _currentPBO) return;
|
||||
|
||||
if (pbo->isDirty()) pbo->compileBuffer();
|
||||
else pbo->bindBuffer();
|
||||
if (pbo->isDirty()) pbo->compileBuffer();
|
||||
else pbo->bindBuffer();
|
||||
|
||||
_currentPBO = pbo;
|
||||
_currentPBO = pbo;
|
||||
}
|
||||
else
|
||||
{
|
||||
unbindPixelBufferObject();
|
||||
}
|
||||
}
|
||||
|
||||
inline void unbindPixelBufferObject()
|
||||
|
@ -115,6 +115,10 @@ State::State():
|
||||
_glDisableVertexAttribArray = 0;
|
||||
_glDrawArraysInstanced = 0;
|
||||
_glDrawElementsInstanced = 0;
|
||||
_glMultiTexCoord4f = 0;
|
||||
_glVertexAttrib4fv = 0;
|
||||
_glVertexAttrib4f = 0;
|
||||
_glBindBuffer = 0;
|
||||
|
||||
_dynamicObjectCount = 0;
|
||||
|
||||
@ -133,6 +137,9 @@ State::State():
|
||||
_gpuTick = 0;
|
||||
_gpuTimestamp = 0;
|
||||
_timestampBits = 0;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
State::~State()
|
||||
|
Loading…
Reference in New Issue
Block a user