OpenSceneGraph
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
osg::VertexArrayState Class Reference
Inheritance diagram for osg::VertexArrayState:
Inheritance graph
[legend]

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)
 
GLBufferObjectgetCurrentVertexBufferObject ()
 
void bindVertexBufferObject (osg::GLBufferObject *vbo)
 
void unbindVertexBufferObject ()
 
void setCurrentElementBufferObject (osg::GLBufferObject *ebo)
 
GLBufferObjectgetCurrentElementBufferObject ()
 
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 ()
 Mark all the vertex attributes as being disabled but leave the disabling till a later call to applyDisablingOfVertexAttributes. More...
 
void applyDisablingOfVertexAttributes (osg::State &state)
 Disable all the vertex attributes that have been marked as to be disabled. More...
 
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)
 Deprecated, Referenced is now always uses thread safe ref/unref, use default Referenced() constructor instead. More...
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool)
 Deprecated, Referenced is always theadsafe so there method now has no effect and does not need to be called. More...
 
bool getThreadSafeRefUnref () const
 Get whether a mutex is used to ensure ref() and unref() are thread safe. More...
 
OpenThreads::MutexgetRefMutex () const
 Get the mutex used to ensure thread safety of ref()/unref(). More...
 
int ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
int unref () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int referenceCount () const
 Return the number of pointers currently referencing this object. More...
 
ObserverSetgetObserverSet () const
 Get the ObserverSet if one is attached, otherwise return NULL. More...
 
ObserverSetgetOrCreateObserverSet () const
 Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More...
 
void addObserver (Observer *observer) const
 Add a Observer that is observing this object, notify the Observer when this object gets deleted. More...
 
void removeObserver (Observer *observer) const
 Remove Observer that is observing this object. More...
 

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::MutexgetGlobalReferencedMutex ()
 Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More...
 
static void setDeleteHandler (DeleteHandler *handler)
 Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More...
 
static DeleteHandlergetDeleteHandler ()
 Get a DeleteHandler. More...
 
- 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

◆ 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

◆ 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

◆ bindVertexBufferObject()

void osg::VertexArrayState::bindVertexBufferObject ( osg::GLBufferObject vbo)
inline

◆ 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

◆ disableColorArray()

void osg::VertexArrayState::disableColorArray ( osg::State state)
inline

◆ disableFogCoordArray()

void osg::VertexArrayState::disableFogCoordArray ( osg::State state)
inline

◆ disableNormalArray()

void osg::VertexArrayState::disableNormalArray ( osg::State state)
inline

◆ disableSecondaryColorArray()

void osg::VertexArrayState::disableSecondaryColorArray ( osg::State state)
inline

◆ disableTexCoordArray()

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

◆ disableTexCoordArrayAboveAndIncluding()

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

◆ disableVertexArray()

void osg::VertexArrayState::disableVertexArray ( osg::State state)
inline

◆ disableVertexAttribArray()

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

◆ disableVertexAttribArrayAboveAndIncluding()

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

◆ generateVertexArrayObject()

void osg::VertexArrayState::generateVertexArrayObject ( )

◆ getCurrentElementBufferObject()

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

◆ getCurrentVertexBufferObject()

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

◆ getRequiresSetArrays()

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

◆ getVertexArrayObject()

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

◆ isVertexBufferObjectSupported()

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

◆ 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 osg::VertexArrayState::ArrayDispatch::active.

◆ release()

void osg::VertexArrayState::release ( )

◆ resetBufferObjectPointers()

void osg::VertexArrayState::resetBufferObjectPointers ( )
inline

◆ setArray() [1/2]

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

◆ 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

◆ setColorArray() [2/2]

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

◆ setCurrentElementBufferObject()

void osg::VertexArrayState::setCurrentElementBufferObject ( osg::GLBufferObject ebo)
inline

◆ setCurrentVertexBufferObject()

void osg::VertexArrayState::setCurrentVertexBufferObject ( osg::GLBufferObject vbo)
inline

◆ setFogCoordArray()

void osg::VertexArrayState::setFogCoordArray ( osg::State state,
const osg::Array array 
)
inline

◆ 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

◆ setNormalArray() [2/2]

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

◆ setRequiresSetArrays()

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

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

◆ setSecondaryColorArray()

void osg::VertexArrayState::setSecondaryColorArray ( osg::State state,
const osg::Array array 
)
inline

◆ setTexCoordArray() [1/2]

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

◆ 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

◆ setVertexArray() [1/2]

void osg::VertexArrayState::setVertexArray ( osg::State state,
const osg::Array array 
)
inline

◆ setVertexArray() [2/2]

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

◆ setVertexAttribArray()

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

◆ setVertexBufferObjectSupported()

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

◆ unbindElementBufferObject()

void osg::VertexArrayState::unbindElementBufferObject ( )
inline

◆ unbindVertexBufferObject()

void osg::VertexArrayState::unbindVertexBufferObject ( )
inline

References GL_ARRAY_BUFFER_ARB.

Member Data Documentation

◆ _activeDispatchers

ActiveDispatchers osg::VertexArrayState::_activeDispatchers

◆ _colorArray

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

◆ _currentEBO

GLBufferObject* osg::VertexArrayState::_currentEBO

◆ _currentVBO

GLBufferObject* osg::VertexArrayState::_currentVBO

◆ _ext

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

◆ _fogCoordArray

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

◆ _isVertexBufferObjectSupported

bool osg::VertexArrayState::_isVertexBufferObjectSupported

◆ _normalArray

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

◆ _previous_activeDispatchers

ActiveDispatchers osg::VertexArrayState::_previous_activeDispatchers

◆ _requiresSetArrays

bool osg::VertexArrayState::_requiresSetArrays

◆ _secondaryColorArray

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

◆ _state

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

◆ _stateObserverSet

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

◆ _texCoordArrays

ArrayDispatchList osg::VertexArrayState::_texCoordArrays

◆ _vertexArray

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

◆ _vertexArrayObject

GLuint osg::VertexArrayState::_vertexArrayObject

◆ _vertexAttribArrays

ArrayDispatchList osg::VertexArrayState::_vertexAttribArrays

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