osg::VertexArrayState Class Reference

`#include <VertexArrayState>`

Inheritance diagram for osg::VertexArrayState:

## Classes

struct | ArrayDispatch

## Public Types

typedef std::vector< ref_ptr< ArrayDispatch > > | ArrayDispatchList
typedef std::vector< ArrayDispatch * > | ActiveDispatchers

## Public Member Functions

| VertexArrayState (osg::State *state)
void | setCurrentVertexBufferObject (osg::GLBufferObject *vbo)
GLBufferObject * | getCurrentVertexBufferObject ()
void | bindVertexBufferObject (osg::GLBufferObject *vbo)
void | unbindVertexBufferObject ()
void | setCurrentElementBufferObject (osg::GLBufferObject *ebo)
GLBufferObject * | getCurrentElementBufferObject ()
void | bindElementBufferObject (osg::GLBufferObject *ebo)
void | unbindElementBufferObject ()
void | resetBufferObjectPointers ()
bool | correctArrayDispatchAssigned (const ArrayDispatch *ad)
void | assignAllDispatchers ()
void | assignVertexArrayDispatcher ()
void | assignNormalArrayDispatcher ()
void | assignColorArrayDispatcher ()
void | assignSecondaryColorArrayDispatcher ()
void | assignFogCoordArrayDispatcher ()
void | assignTexCoordArrayDispatcher (unsigned int numUnits)
void | assignVertexAttribArrayDispatcher (unsigned int numUnits)
void | setVertexBufferObjectSupported (bool flag)
bool | isVertexBufferObjectSupported () const
void | setArray (ArrayDispatch *vad, osg::State &state, const osg::Array *new_array)
void | setArray (ArrayDispatch *vad, osg::State &state, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized)
void | disable (ArrayDispatch *vad, osg::State &state)
void | setInterleavedArrays (osg::State &state, GLenum format, GLsizei stride, const GLvoid *pointer)
void | setVertexArray (osg::State &state, const osg::Array *array)
void | setVertexArray (osg::State &state, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
void | disableVertexArray (osg::State &state)
void | setNormalArray (osg::State &state, const osg::Array *array)
void | setNormalArray (osg::State &state, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
void | disableNormalArray (osg::State &state)
void | setColorArray (osg::State &state, const osg::Array *array)
void | setColorArray (osg::State &state, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_TRUE)
void | disableColorArray (osg::State &state)
void | setSecondaryColorArray (osg::State &state, const osg::Array *array)
void | disableSecondaryColorArray (osg::State &state)
void | setFogCoordArray (osg::State &state, const osg::Array *array)
void | disableFogCoordArray (osg::State &state)
void | setTexCoordArray (osg::State &state, unsigned int unit, const osg::Array *array)
void | setTexCoordArray (osg::State &state, unsigned int unit, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
void | disableTexCoordArray (osg::State &state, unsigned int unit)
void | disableTexCoordArrayAboveAndIncluding (osg::State &state, unsigned int index)
void | setVertexAttribArray (osg::State &state, unsigned int unit, const osg::Array *array)
void | disableVertexAttribArray (osg::State &state, unsigned int unit)
void | disableVertexAttribArrayAboveAndIncluding (osg::State &state, unsigned int index)
void | lazyDisablingOfVertexAttributes ()
void | applyDisablingOfVertexAttributes (osg::State &state)
void | generateVertexArrayObject ()
void | deleteVertexArrayObject ()
GLuint | getVertexArrayObject () const
void | setRequiresSetArrays (bool flag)
bool | getRequiresSetArrays () const
void | dirty ()
void | release ()
virtual | ~VertexArrayState ()
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
virtual void | setThreadSafeRefUnref (bool)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Public Attributes

osg::State * | _state
osg::ref_ptr< ObserverSet > | _stateObserverSet
osg::ref_ptr< osg::GLExtensions > | _ext
bool | _isVertexBufferObjectSupported
GLuint | _vertexArrayObject
osg::ref_ptr< ArrayDispatch > | _vertexArray
osg::ref_ptr< ArrayDispatch > | _normalArray
osg::ref_ptr< ArrayDispatch > | _colorArray
osg::ref_ptr< ArrayDispatch > | _secondaryColorArray
osg::ref_ptr< ArrayDispatch > | _fogCoordArray
ArrayDispatchList | _texCoordArrays
ArrayDispatchList | _vertexAttribArrays
ActiveDispatchers | _activeDispatchers
ActiveDispatchers | _previous_activeDispatchers
GLBufferObject * | _currentVBO
GLBufferObject * | _currentEBO
bool | _requiresSetArrays

## Additional Inherited Members

Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Member Typedef Documentation

## ActiveDispatchers

typedef std::vector<ArrayDispatch*> osg::VertexArrayState::ActiveDispatchers

## ArrayDispatchList

typedef std::vector< ref_ptr<ArrayDispatch> > osg::VertexArrayState::ArrayDispatchList

## Constructor & Destructor Documentation

## VertexArrayState()

osg::VertexArrayState::VertexArrayState | ( | osg::State * | state | ) |

## ~VertexArrayState()

virtual osg::VertexArrayState::~VertexArrayState | ( |  | ) |

virtual

## Member Function Documentation

## applyDisablingOfVertexAttributes()

void osg::VertexArrayState::applyDisablingOfVertexAttributes | ( | osg::State & | state | ) |

inline

Disable all the vertex attributes that have been marked as to be disabled.

References _previous_activeDispatchers, osg::VertexArrayState::ArrayDispatch::active, osg::VertexArrayState::ArrayDispatch::array, osg::VertexArrayState::ArrayDispatch::disable(), and osg::VertexArrayState::ArrayDispatch::modifiedCount.

## assignAllDispatchers()

void osg::VertexArrayState::assignAllDispatchers | ( |  | ) |

## assignColorArrayDispatcher()

void osg::VertexArrayState::assignColorArrayDispatcher | ( |  | ) |

## assignFogCoordArrayDispatcher()

void osg::VertexArrayState::assignFogCoordArrayDispatcher | ( |  | ) |

## assignNormalArrayDispatcher()

void osg::VertexArrayState::assignNormalArrayDispatcher | ( |  | ) |

## assignSecondaryColorArrayDispatcher()

void osg::VertexArrayState::assignSecondaryColorArrayDispatcher | ( |  | ) |

## assignTexCoordArrayDispatcher()

void osg::VertexArrayState::assignTexCoordArrayDispatcher | ( | unsigned int | numUnits | ) |

## assignVertexArrayDispatcher()

void osg::VertexArrayState::assignVertexArrayDispatcher | ( |  | ) |

## assignVertexAttribArrayDispatcher()

void osg::VertexArrayState::assignVertexAttribArrayDispatcher | ( | unsigned int | numUnits | ) |

## bindElementBufferObject()

void osg::VertexArrayState::bindElementBufferObject | ( | osg::GLBufferObject * | ebo | ) |

inline

References _currentEBO, osg::GLBufferObject::bindBuffer(), osg::GLBufferObject::compileBuffer(), and osg::GLBufferObject::isDirty().

## bindVertexBufferObject()

void osg::VertexArrayState::bindVertexBufferObject | ( | osg::GLBufferObject * | vbo | ) |

inline

References _currentVBO, osg::GLBufferObject::bindBuffer(), osg::GLBufferObject::compileBuffer(), and osg::GLBufferObject::isDirty().

## correctArrayDispatchAssigned()

bool osg::VertexArrayState::correctArrayDispatchAssigned | ( | const ArrayDispatch * | ad | ) |

## deleteVertexArrayObject()

void osg::VertexArrayState::deleteVertexArrayObject | ( |  | ) |

## dirty()

void osg::VertexArrayState::dirty | ( |  | ) |

## disable()

void osg::VertexArrayState::disable | ( | ArrayDispatch * | vad,
|  | osg::State & | state )

inline

References osg::VertexArrayState::ArrayDispatch::active, osg::VertexArrayState::ArrayDispatch::array, osg::VertexArrayState::ArrayDispatch::disable(), and osg::VertexArrayState::ArrayDispatch::modifiedCount.

Referenced by disableColorArray(), disableFogCoordArray(), disableNormalArray(), disableSecondaryColorArray(), disableTexCoordArray(), disableTexCoordArrayAboveAndIncluding(), disableVertexArray(), disableVertexAttribArray(), and disableVertexAttribArrayAboveAndIncluding().

## disableColorArray()

void osg::VertexArrayState::disableColorArray | ( | osg::State & | state | ) |

inline

References _colorArray, and disable().

## disableFogCoordArray()

void osg::VertexArrayState::disableFogCoordArray | ( | osg::State & | state | ) |

inline

References _fogCoordArray, and disable().

## disableNormalArray()

void osg::VertexArrayState::disableNormalArray | ( | osg::State & | state | ) |

inline

References _normalArray, and disable().

## disableSecondaryColorArray()

void osg::VertexArrayState::disableSecondaryColorArray | ( | osg::State & | state | ) |

inline

References _secondaryColorArray, and disable().

## disableTexCoordArray()

void osg::VertexArrayState::disableTexCoordArray | ( | osg::State & | state,
|  | unsigned int | unit )

inline

References _texCoordArrays, disable(), and osg::get().

## disableTexCoordArrayAboveAndIncluding()

void osg::VertexArrayState::disableTexCoordArrayAboveAndIncluding | ( | osg::State & | state,
|  | unsigned int | index )

inline

References _texCoordArrays, disable(), and osg::get().

## disableVertexArray()

void osg::VertexArrayState::disableVertexArray | ( | osg::State & | state | ) |

inline

References _vertexArray, and disable().

## disableVertexAttribArray()

void osg::VertexArrayState::disableVertexAttribArray | ( | osg::State & | state,
|  | unsigned int | unit )

inline

References _vertexAttribArrays, disable(), and osg::get().

## disableVertexAttribArrayAboveAndIncluding()

void osg::VertexArrayState::disableVertexAttribArrayAboveAndIncluding | ( | osg::State & | state,
|  | unsigned int | index )

inline

References _vertexAttribArrays, disable(), and osg::get().

## generateVertexArrayObject()

void osg::VertexArrayState::generateVertexArrayObject | ( |  | ) |

## getCurrentElementBufferObject()

GLBufferObject * osg::VertexArrayState::getCurrentElementBufferObject | ( |  | ) |

inline

References _currentEBO.

## getCurrentVertexBufferObject()

GLBufferObject * osg::VertexArrayState::getCurrentVertexBufferObject | ( |  | ) |

inline

References _currentVBO.

## getRequiresSetArrays()

bool osg::VertexArrayState::getRequiresSetArrays | ( |  | ) | const

inline

References _requiresSetArrays.

## getVertexArrayObject()

GLuint osg::VertexArrayState::getVertexArrayObject | ( |  | ) | const

inline

References _vertexArrayObject.

Referenced by osg::State::bindVertexArrayObject(), and osg::State::resetCurrentVertexArrayStateOnMatch().

## isVertexBufferObjectSupported()

bool osg::VertexArrayState::isVertexBufferObjectSupported | ( |  | ) | const

inline

References _isVertexBufferObjectSupported.

## lazyDisablingOfVertexAttributes()

void osg::VertexArrayState::lazyDisablingOfVertexAttributes | ( |  | ) |

inline

Mark all the vertex attributes as being disabled but leave the disabling till a later call to applyDisablingOfVertexAttributes.

References _activeDispatchers, _previous_activeDispatchers, and osg::VertexArrayState::ArrayDispatch::active.

## release()

void osg::VertexArrayState::release | ( |  | ) |

## resetBufferObjectPointers()

void osg::VertexArrayState::resetBufferObjectPointers | ( |  | ) |

inline

References _currentEBO, and _currentVBO.

## setArray() [1/2]

void osg::VertexArrayState::setArray | ( | ArrayDispatch * | vad,
|  | osg::State & | state,
|  | const osg::Array * | new_array )

Referenced by setColorArray(), setColorArray(), setFogCoordArray(), setNormalArray(), setNormalArray(), setSecondaryColorArray(), setTexCoordArray(), setTexCoordArray(), setVertexArray(), setVertexArray(), and setVertexAttribArray().

## setArray() [2/2]

void osg::VertexArrayState::setArray | ( | ArrayDispatch * | vad,
|  | osg::State & | state,
|  | GLint | size,
|  | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized )

## setColorArray() [1/2]

void osg::VertexArrayState::setColorArray | ( | osg::State & | state,
|  | const osg::Array * | array )

inline

References _colorArray, and setArray().

## setColorArray() [2/2]

void osg::VertexArrayState::setColorArray | ( | osg::State & | state,
|  | GLint | size,
|  | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized = GL_TRUE )

inline

References _colorArray, and setArray().

## setCurrentElementBufferObject()

void osg::VertexArrayState::setCurrentElementBufferObject | ( | osg::GLBufferObject * | ebo | ) |

inline

References _currentEBO.

## setCurrentVertexBufferObject()

void osg::VertexArrayState::setCurrentVertexBufferObject | ( | osg::GLBufferObject * | vbo | ) |

inline

References _currentVBO.

## setFogCoordArray()

void osg::VertexArrayState::setFogCoordArray | ( | osg::State & | state,
|  | const osg::Array * | array )

inline

References _fogCoordArray, and setArray().

## setInterleavedArrays()

void osg::VertexArrayState::setInterleavedArrays | ( | osg::State & | state,
|  | GLenum | format,
|  | GLsizei | stride,
|  | const GLvoid * | pointer )

## setNormalArray() [1/2]

void osg::VertexArrayState::setNormalArray | ( | osg::State & | state,
|  | const osg::Array * | array )

inline

References _normalArray, and setArray().

## setNormalArray() [2/2]

void osg::VertexArrayState::setNormalArray | ( | osg::State & | state,
|  | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized = GL_FALSE )

inline

References _normalArray, and setArray().

## setRequiresSetArrays()

void osg::VertexArrayState::setRequiresSetArrays | ( | bool | flag | ) |

inline

References _requiresSetArrays.

Referenced by osg::Drawable::draw().

## setSecondaryColorArray()

void osg::VertexArrayState::setSecondaryColorArray | ( | osg::State & | state,
|  | const osg::Array * | array )

inline

References _secondaryColorArray, and setArray().

## setTexCoordArray() [1/2]

void osg::VertexArrayState::setTexCoordArray | ( | osg::State & | state,
|  | unsigned int | unit,
|  | const osg::Array * | array )

inline

References _texCoordArrays, osg::get(), and setArray().

## setTexCoordArray() [2/2]

void osg::VertexArrayState::setTexCoordArray | ( | osg::State & | state,
|  | unsigned int | unit,
|  | GLint | size,
|  | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized = GL_FALSE )

inline

References _texCoordArrays, osg::get(), and setArray().

## setVertexArray() [1/2]

void osg::VertexArrayState::setVertexArray | ( | osg::State & | state,
|  | const osg::Array * | array )

inline

References _vertexArray, and setArray().

## setVertexArray() [2/2]

void osg::VertexArrayState::setVertexArray | ( | osg::State & | state,
|  | GLint | size,
|  | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized = GL_FALSE )

inline

References _vertexArray, and setArray().

## setVertexAttribArray()

void osg::VertexArrayState::setVertexAttribArray | ( | osg::State & | state,
|  | unsigned int | unit,
|  | const osg::Array * | array )

inline

References _vertexAttribArrays, osg::get(), and setArray().

## setVertexBufferObjectSupported()

void osg::VertexArrayState::setVertexBufferObjectSupported | ( | bool | flag | ) |

inline

References _isVertexBufferObjectSupported.

## unbindElementBufferObject()

void osg::VertexArrayState::unbindElementBufferObject | ( |  | ) |

inline

References _currentEBO, _ext, and GL_ELEMENT_ARRAY_BUFFER_ARB.

## unbindVertexBufferObject()

void osg::VertexArrayState::unbindVertexBufferObject | ( |  | ) |

inline

References _currentVBO, _ext, and GL_ARRAY_BUFFER_ARB.

## Member Data Documentation

## _activeDispatchers

ActiveDispatchers osg::VertexArrayState::_activeDispatchers

Referenced by lazyDisablingOfVertexAttributes().

## _colorArray

osg::ref_ptr<ArrayDispatch> osg::VertexArrayState::_colorArray

Referenced by disableColorArray(), setColorArray(), and setColorArray().

## _currentEBO

GLBufferObject* osg::VertexArrayState::_currentEBO

Referenced by bindElementBufferObject(), getCurrentElementBufferObject(), resetBufferObjectPointers(), setCurrentElementBufferObject(), and unbindElementBufferObject().

## _currentVBO

GLBufferObject* osg::VertexArrayState::_currentVBO

Referenced by bindVertexBufferObject(), getCurrentVertexBufferObject(), resetBufferObjectPointers(), setCurrentVertexBufferObject(), and unbindVertexBufferObject().

## _ext

osg::ref_ptr<osg::GLExtensions> osg::VertexArrayState::_ext

Referenced by unbindElementBufferObject(), and unbindVertexBufferObject().

## _fogCoordArray

osg::ref_ptr<ArrayDispatch> osg::VertexArrayState::_fogCoordArray

Referenced by disableFogCoordArray(), and setFogCoordArray().

## _isVertexBufferObjectSupported

bool osg::VertexArrayState::_isVertexBufferObjectSupported

Referenced by isVertexBufferObjectSupported(), and setVertexBufferObjectSupported().

## _normalArray

osg::ref_ptr<ArrayDispatch> osg::VertexArrayState::_normalArray

Referenced by disableNormalArray(), setNormalArray(), and setNormalArray().

## _previous_activeDispatchers

ActiveDispatchers osg::VertexArrayState::_previous_activeDispatchers

Referenced by applyDisablingOfVertexAttributes(), and lazyDisablingOfVertexAttributes().

## _requiresSetArrays

bool osg::VertexArrayState::_requiresSetArrays

Referenced by getRequiresSetArrays(), and setRequiresSetArrays().

## _secondaryColorArray

osg::ref_ptr<ArrayDispatch> osg::VertexArrayState::_secondaryColorArray

Referenced by disableSecondaryColorArray(), and setSecondaryColorArray().

## _state

osg::State* osg::VertexArrayState::_state

## _stateObserverSet

osg::ref_ptr<ObserverSet> osg::VertexArrayState::_stateObserverSet

## _texCoordArrays

ArrayDispatchList osg::VertexArrayState::_texCoordArrays

Referenced by disableTexCoordArray(), disableTexCoordArrayAboveAndIncluding(), setTexCoordArray(), and setTexCoordArray().

## _vertexArray

osg::ref_ptr<ArrayDispatch> osg::VertexArrayState::_vertexArray

Referenced by disableVertexArray(), setVertexArray(), and setVertexArray().

## _vertexArrayObject

GLuint osg::VertexArrayState::_vertexArrayObject

Referenced by getVertexArrayObject().

## _vertexAttribArrays

ArrayDispatchList osg::VertexArrayState::_vertexAttribArrays

Referenced by disableVertexAttribArray(), disableVertexAttribArrayAboveAndIncluding(), and setVertexAttribArray().

The documentation for this class was generated from the following file:

- VertexArrayState