State
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_STATE
#define OSG_STATE 1
#include <osg/Export>
#include <osg/GLExtensions>
#include <osg/StateSet>
#include <osg/Matrix>
#include <osg/Uniform>
#include <osg/BufferObject>
#include <osg/Observer>
#include <osg/Timer>
#include <osg/VertexArrayState>
#include <osg/ShaderComposer>
#include <osg/FrameStamp>
#include <osg/DisplaySettings>
#include <osg/Polytope>
#include <osg/Viewport>
#include <osg/AttributeDispatchers>
#include <osg/GraphicsCostEstimator>
#include <iosfwd>
#include <vector>
#include <map>
#include <set>
#include <string>
#ifndef GL_TEXTURE0
#define GL_TEXTURE0 0x84C0
#endif
namespace osg {
#define OSG_GL_DEBUG(message) \
if (state.getFineGrainedErrorDetection()) \
{ \
GLenum errorNo = glGetError(); \
if (errorNo!=GL_NO_ERROR) \
{ \
osg::notify(WARN)<<"Warning: detected OpenGL error '"<<gluErrorString(errorNo)<<" "<<message<<endl; \
}\
}
// forward declare GraphicsContext, View and State
class GraphicsContext;
class OSG_EXPORT State : public Referenced
{
public :
State();
void setGraphicsContext(GraphicsContext* context) { _graphicsContext = context; }
GraphicsContext* getGraphicsContext() { return _graphicsContext; }
const GraphicsContext* getGraphicsContext() const { return _graphicsContext; }
inline void setContextID(unsigned int contextID) { _contextID=contextID; }
inline unsigned int getContextID() const { return _contextID; }
// ExtensionMap contains GL Extentsions objects used by StateAttribue to call OpenGL extensions/advanced features
typedef std::map<const std::type_info*, osg::ref_ptr<osg::Referenced> > ExtensionMap;
ExtensionMap _extensionMap;
template<typename T>
T* get()
{
const std::type_info* id(&typeid(T));
osg::ref_ptr<osg::Referenced>& ptr = _extensionMap[id];
if (!ptr)
{
ptr = new T(_contextID);
}
return static_cast<T*>(ptr.get());
}
template<typename T>
const T* get() const
{
const std::type_info* id(&typeid(T));
ExtensionMap::const_iterator itr = _extensionMap.find(id);
if (itr==_extensionMap.end()) return 0;
else return itr->second.get();
}
template<typename T>
void set(T* ptr)
{
const std::type_info* id(&typeid(T));
_extensionMap[id] = ptr;
}
/* deprecated.*/
void setShaderCompositionEnabled(bool flag) { _shaderCompositionEnabled = flag; }
/* deprecated.*/
bool getShaderCompositionEnabled() const { return _shaderCompositionEnabled; }
void setShaderComposer(ShaderComposer* sc) { _shaderComposer = sc; }
ShaderComposer* getShaderComposer() { return _shaderComposer.get(); }
const ShaderComposer* getShaderComposer() const { return _shaderComposer.get(); }
StateSet::UniformList& getCurrentShaderCompositionUniformList() { return _currentShaderCompositionUniformList; }
void applyShaderCompositionUniform(const osg::Uniform* uniform, StateAttribute::OverrideValue value=StateAttribute::ON)
{
StateSet::RefUniformPair& up = _currentShaderCompositionUniformList[uniform->getName()];
up.first = const_cast<Uniform*>(uniform);
up.second = value;
}
void pushStateSet(const StateSet* dstate);
void popStateSet();
void popAllStateSets();
void insertStateSet(unsigned int pos,const StateSet* dstate);
void removeStateSet(unsigned int pos);
unsigned int getStateSetStackSize() { return static_cast<unsigned int>(_stateStateStack.size()); }
void popStateSetStackToSize(unsigned int size) { while (_stateStateStack.size()>size) popStateSet(); }
typedef std::vector<const StateSet*> StateSetStack;
StateSetStack& getStateSetStack() { return _stateStateStack; }
void captureCurrentState(StateSet& stateset) const;
void releaseGLObjects();
void reset();
inline const Viewport* getCurrentViewport() const
{
return static_cast<const Viewport*>(getLastAppliedAttribute(osg::StateAttribute::VIEWPORT));
}
void setInitialViewMatrix(const osg::RefMatrix* matrix);
inline const osg::Matrix& getInitialViewMatrix() const { return *_initialViewMatrix; }
inline const osg::Matrix& getInitialInverseViewMatrix() const { return _initialInverseViewMatrix; }
void applyProjectionMatrix(const osg::RefMatrix* matrix);
inline const osg::Matrix& getProjectionMatrix() const { return *_projection; }
void applyModelViewMatrix(const osg::RefMatrix* matrix);
void applyModelViewMatrix(const osg::Matrix&);
const osg::Matrix& getModelViewMatrix() const { return *_modelView; }
void setUseModelViewAndProjectionUniforms(bool flag) { _useModelViewAndProjectionUniforms = flag; }
bool getUseModelViewAndProjectionUniforms() const { return _useModelViewAndProjectionUniforms; }
void updateModelViewAndProjectionMatrixUniforms();
void applyModelViewAndProjectionUniformsIfRequired();
osg::Uniform* getModelViewMatrixUniform() { return _modelViewMatrixUniform.get(); }
osg::Uniform* getProjectionMatrixUniform() { return _projectionMatrixUniform.get(); }
osg::Uniform* getModelViewProjectionMatrixUniform() { return _modelViewProjectionMatrixUniform.get(); }
osg::Uniform* getNormalMatrixUniform() { return _normalMatrixUniform.get(); }
Polytope getViewFrustum() const;
void setUseVertexAttributeAliasing(bool flag);
bool getUseVertexAttributeAliasing() const { return _useVertexAttributeAliasing ; }
typedef std::vector<VertexAttribAlias> VertexAttribAliasList;
void resetVertexAttributeAlias(bool compactAliasing=true, unsigned int numTextureUnits=8);
void setVertexAlias(const VertexAttribAlias& alias) { _vertexAlias = alias; }
const VertexAttribAlias& getVertexAlias() { return _vertexAlias; }
void setNormalAlias(const VertexAttribAlias& alias) { _normalAlias = alias; }
const VertexAttribAlias& getNormalAlias() { return _normalAlias; }
void setColorAlias(const VertexAttribAlias& alias) { _colorAlias = alias; }
const VertexAttribAlias& getColorAlias() { return _colorAlias; }
void setSecondaryColorAlias(const VertexAttribAlias& alias) { _secondaryColorAlias = alias; }
const VertexAttribAlias& getSecondaryColorAlias() { return _secondaryColorAlias; }
void setFogCoordAlias(const VertexAttribAlias& alias) { _fogCoordAlias = alias; }
const VertexAttribAlias& getFogCoordAlias() { return _fogCoordAlias; }
void setTexCoordAliasList(const VertexAttribAliasList& aliasList) { _texCoordAliasList = aliasList; }
const VertexAttribAliasList& getTexCoordAliasList() { return _texCoordAliasList; }
void setAttributeBindingList(const Program::AttribBindingList& attribBindingList) { _attributeBindingList = attribBindingList; }
const Program::AttribBindingList& getAttributeBindingList() { return _attributeBindingList; }
bool convertVertexShaderSourceToOsgBuiltIns(std::string& source) const;
void apply(const StateSet* dstate);
void apply();
void applyShaderComposition();
void glDrawBuffer(GLenum buffer);
GLenum getDrawBuffer() const { return _drawBuffer; }
void glReadBuffer(GLenum buffer);
GLenum getReadBuffer() const { return _readBuffer; }
inline void setModeValidity(StateAttribute::GLMode mode,bool valid)
{
ModeStack& ms = _modeMap[mode];
ms.valid = valid;
}
inline bool getModeValidity(StateAttribute::GLMode mode)
{
ModeStack& ms = _modeMap[mode];
return ms.valid;
}
inline void setGlobalDefaultModeValue(StateAttribute::GLMode mode,bool enabled)
{
ModeStack& ms = _modeMap[mode];
ms.global_default_value = enabled;
}
inline bool getGlobalDefaultModeValue(StateAttribute::GLMode mode)
{
return _modeMap[mode].global_default_value;
}
inline bool getLastAppliedModeValue(StateAttribute::GLMode mode)
{
return _modeMap[mode].last_applied_value;
}
struct ApplyModeProxy
{
inline ApplyModeProxy(osg::State& state, GLenum mode, bool value):_state(state), _mode(mode)
{
_previous_value = _state.getLastAppliedModeValue(mode);
_need_to_apply_value = (_previous_value!=value);
if (_need_to_apply_value) _state.applyMode(_mode, value);
}
inline ~ApplyModeProxy()
{
if (_need_to_apply_value) _state.applyMode(_mode, _previous_value);
}
osg::State& _state;
GLenum _mode;
bool _previous_value;
bool _need_to_apply_value;
};
struct ApplyTextureModeProxy
{
inline ApplyTextureModeProxy(osg::State& state, unsigned int unit, GLenum mode, bool value):_state(state), _unit(unit), _mode(mode)
{
_previous_value = _state.getLastAppliedTextureModeValue(_unit, _mode);
_need_to_apply_value = (_previous_value!=value);
if (_need_to_apply_value) _state.applyTextureMode(_unit, _mode, value);
}
inline ~ApplyTextureModeProxy()
{
if (_need_to_apply_value) _state.applyTextureMode(_unit, _mode, _previous_value);
}
osg::State& _state;
unsigned int _unit;
GLenum _mode;
bool _previous_value;
bool _need_to_apply_value;
};
inline bool applyMode(StateAttribute::GLMode mode,bool enabled)
{
ModeStack& ms = _modeMap[mode];
ms.changed = true;
return applyMode(mode,enabled,ms);
}
inline void setGlobalDefaultTextureModeValue(unsigned int unit, StateAttribute::GLMode mode,bool enabled)
{
ModeMap& modeMap = getOrCreateTextureModeMap(unit);
ModeStack& ms = modeMap[mode];
ms.global_default_value = enabled;
}
inline bool getGlobalDefaultTextureModeValue(unsigned int unit, StateAttribute::GLMode mode)
{
ModeMap& modeMap = getOrCreateTextureModeMap(unit);
ModeStack& ms = modeMap[mode];
return ms.global_default_value;
}
inline bool applyTextureMode(unsigned int unit, StateAttribute::GLMode mode,bool enabled)
{
ModeMap& modeMap = getOrCreateTextureModeMap(unit);
ModeStack& ms = modeMap[mode];
ms.changed = true;
return applyModeOnTexUnit(unit,mode,enabled,ms);
}
inline bool getLastAppliedTextureModeValue(unsigned int unit, StateAttribute::GLMode mode)
{
ModeMap& modeMap = getOrCreateTextureModeMap(unit);
ModeStack& ms = modeMap[mode];
return ms.last_applied_value;
}
inline void setGlobalDefaultAttribute(const StateAttribute* attribute)
{
AttributeStack& as = _attributeMap[attribute->getTypeMemberPair()];
as.global_default_attribute = attribute;
}
inline const StateAttribute* getGlobalDefaultAttribute(StateAttribute::Type type, unsigned int member=0)
{
AttributeStack& as = _attributeMap[StateAttribute::TypeMemberPair(type,member)];
return as.global_default_attribute.get();
}
inline bool applyAttribute(const StateAttribute* attribute)
{
AttributeStack& as = _attributeMap[attribute->getTypeMemberPair()];
as.changed = true;
return applyAttribute(attribute,as);
}
inline void setGlobalDefaultTextureAttribute(unsigned int unit, const StateAttribute* attribute)
{
AttributeMap& attributeMap = getOrCreateTextureAttributeMap(unit);
AttributeStack& as = attributeMap[attribute->getTypeMemberPair()];
as.global_default_attribute = attribute;
}
inline const StateAttribute* getGlobalDefaultTextureAttribute(unsigned int unit, StateAttribute::Type type, unsigned int member = 0)
{
AttributeMap& attributeMap = getOrCreateTextureAttributeMap(unit);
AttributeStack& as = attributeMap[StateAttribute::TypeMemberPair(type,member)];
return as.global_default_attribute.get();
}
inline bool applyTextureAttribute(unsigned int unit, const StateAttribute* attribute)
{
AttributeMap& attributeMap = getOrCreateTextureAttributeMap(unit);
AttributeStack& as = attributeMap[attribute->getTypeMemberPair()];
as.changed = true;
return applyAttributeOnTexUnit(unit,attribute,as);
}
void haveAppliedMode(StateAttribute::GLMode mode,StateAttribute::GLModeValue value);
void haveAppliedMode(StateAttribute::GLMode mode);
void haveAppliedAttribute(const StateAttribute* attribute);
void haveAppliedAttribute(StateAttribute::Type type, unsigned int member=0);
bool getLastAppliedMode(StateAttribute::GLMode mode) const;
const StateAttribute* getLastAppliedAttribute(StateAttribute::Type type, unsigned int member=0) const;
void haveAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode,StateAttribute::GLModeValue value);
void haveAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode);
void haveAppliedTextureAttribute(unsigned int unit, const StateAttribute* attribute);
void haveAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type, unsigned int member=0);
bool getLastAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode) const;
const StateAttribute* getLastAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type, unsigned int member=0) const;
void dirtyAllModes();
void dirtyAllAttributes();
struct SetCurrentVertexArrayStateProxy
{
SetCurrentVertexArrayStateProxy(osg::State& state, VertexArrayState* vas):_state(state) { _state.setCurrentVertexArrayState(vas); }
~SetCurrentVertexArrayStateProxy() { _state.setCurrentToGlobalVertexArrayState(); }
osg::State& _state;
};
void setCurrentVertexArrayState(VertexArrayState* vas) { _vas = vas; }
VertexArrayState* getCurrentVertexArrayState() const { return _vas; }
void setCurrentToGlobalVertexArrayState() { _vas = _globalVertexArrayState.get(); }
void resetCurrentVertexArrayStateOnMatch(VertexArrayState* vas)
{
if (vas->getVertexArrayObject()== _currentVAO) _currentVAO = 0;
if (_vas==vas) _vas = _globalVertexArrayState.get();
}
void disableAllVertexArrays();
void lazyDisablingOfVertexAttributes() { _vas->lazyDisablingOfVertexAttributes(); }
void applyDisablingOfVertexAttributes() { _vas->applyDisablingOfVertexAttributes(*this); }
void setCurrentVertexBufferObject(osg::GLBufferObject* vbo) { _vas->setCurrentVertexBufferObject(vbo); }
const GLBufferObject* getCurrentVertexBufferObject() { return _vas->getCurrentVertexBufferObject(); }
void bindVertexBufferObject(osg::GLBufferObject* vbo) { _vas->bindVertexBufferObject(vbo); }
void unbindVertexBufferObject() { _vas->unbindVertexBufferObject(); }
void setCurrentElementBufferObject(osg::GLBufferObject* ebo) { _vas->setCurrentElementBufferObject(ebo); }
const GLBufferObject* getCurrentElementBufferObject() { return _vas->getCurrentElementBufferObject(); }
void bindElementBufferObject(osg::GLBufferObject* ebo) { _vas->bindElementBufferObject(ebo); }
void unbindElementBufferObject() { _vas->unbindElementBufferObject(); }
void setCurrentPixelBufferObject(osg::GLBufferObject* pbo) { _currentPBO = pbo; }
const GLBufferObject* getCurrentPixelBufferObject() const { return _currentPBO; }
inline void bindPixelBufferObject(osg::GLBufferObject* pbo)
{
if (pbo)
{
if (pbo == _currentPBO) return;
if (pbo->isDirty()) pbo->compileBuffer();
else pbo->bindBuffer();
_currentPBO = pbo;
}
else
{
unbindPixelBufferObject();
}
}
inline void unbindPixelBufferObject()
{
if (!_currentPBO) return;
_glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB,0);
_currentPBO = 0;
}
inline void bindDrawIndirectBufferObject(osg::GLBufferObject* ibo)
{
if (ibo->isDirty())
{
ibo->compileBuffer();
_currentDIBO = ibo;
}
else if (ibo != _currentDIBO)
{
ibo->bindBuffer();
_currentDIBO = ibo;
}
}
inline void unbindDrawIndirectBufferObject()
{
if (!_currentDIBO) return;
_glBindBuffer(GL_DRAW_INDIRECT_BUFFER,0);
_currentDIBO = 0;
}
void setCurrentVertexArrayObject(GLuint vao) { _currentVAO = vao; }
GLuint getCurrentVertexArrayObject() const { return _currentVAO; }
inline void bindVertexArrayObject(const VertexArrayState* vas) { bindVertexArrayObject(vas->getVertexArrayObject()); }
inline void bindVertexArrayObject(GLuint vao) { if (_currentVAO!=vao) { _glExtensions->glBindVertexArray(vao); _currentVAO = vao; } }
inline void unbindVertexArrayObject() { if (_currentVAO!=0) { _glExtensions->glBindVertexArray(0); _currentVAO = 0; } }
typedef std::vector<GLushort> IndicesGLushort;
IndicesGLushort _quadIndicesGLushort[4];
typedef std::vector<GLuint> IndicesGLuint;
IndicesGLuint _quadIndicesGLuint[4];
void drawQuads(GLint first, GLsizei count, GLsizei primCount=0);
inline void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
{
if (primcount>=1 && _glDrawArraysInstanced!=0) _glDrawArraysInstanced(mode, first, count, primcount);
else glDrawArrays(mode, first, count);
}
inline void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount )
{
if (primcount>=1 && _glDrawElementsInstanced!=0) _glDrawElementsInstanced(mode, count, type, indices, primcount);
else glDrawElements(mode, count, type, indices);
}
inline void Vertex(float x, float y, float z, float w=1.0f)
{
#if defined(OSG_GL_VERTEX_FUNCS_AVAILABLE) && !defined(OSG_GLES1_AVAILABLE)
if (_useVertexAttributeAliasing) _glVertexAttrib4f( _vertexAlias._location, x,y,z,w);
else glVertex4f(x,y,z,w);
#else
_glVertexAttrib4f( _vertexAlias._location, x,y,z,w);
#endif
}
inline void Color(float r, float g, float b, float a=1.0f)
{
#ifdef OSG_GL_VERTEX_FUNCS_AVAILABLE
if (_useVertexAttributeAliasing) _glVertexAttrib4f( _colorAlias._location, r,g,b,a);
else glColor4f(r,g,b,a);
#else
_glVertexAttrib4f( _colorAlias._location, r,g,b,a);
#endif
}
void Normal(float x, float y, float z)
{
#ifdef OSG_GL_VERTEX_FUNCS_AVAILABLE
if (_useVertexAttributeAliasing) _glVertexAttrib4f( _normalAlias._location, x,y,z,0.0);
else glNormal3f(x,y,z);
#else
_glVertexAttrib4f( _normalAlias._location, x,y,z,0.0);
#endif
}
void TexCoord(float x, float y=0.0f, float z=0.0f, float w=1.0f)
{
#if !defined(OSG_GLES1_AVAILABLE)
#ifdef OSG_GL_VERTEX_FUNCS_AVAILABLE
if (_useVertexAttributeAliasing) _glVertexAttrib4f( _texCoordAliasList[0]._location, x,y,z,w);
else glTexCoord4f(x,y,z,w);
#else
_glVertexAttrib4f( _texCoordAliasList[0]._location, x,y,z,w);
#endif
#endif
}
void MultiTexCoord(unsigned int unit, float x, float y=0.0f, float z=0.0f, float w=1.0f)
{
#if !defined(OSG_GLES1_AVAILABLE)
#ifdef OSG_GL_VERTEX_FUNCS_AVAILABLE
if (_useVertexAttributeAliasing) _glVertexAttrib4f( _texCoordAliasList[unit]._location, x,y,z,w);
else _glMultiTexCoord4f(GL_TEXTURE0+unit,x,y,z,w);
#else
_glVertexAttrib4f( _texCoordAliasList[unit]._location, x,y,z,w);
#endif
#endif
}
void VerteAttrib(unsigned int location, float x, float y=0.0f, float z=0.0f, float w=0.0f)
{
_glVertexAttrib4f( location, x,y,z,w);
}
void setInterleavedArrays( GLenum format, GLsizei stride, const GLvoid* pointer) { _vas->setInterleavedArrays( *this, format, stride, pointer); }
inline void setVertexPointer(const Array* array) { _vas->setVertexArray(*this, array); }
inline void setVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE) { _vas->setVertexArray( *this, size, type, stride, ptr, normalized); }
inline void disableVertexPointer() { _vas->disableVertexArray(*this); }
inline void setNormalPointer(const Array* array) { _vas->setNormalArray(*this, array); }
inline void setNormalPointer( GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE ) { _vas->setNormalArray( *this, type, stride, ptr, normalized); }
inline void disableNormalPointer() { _vas->disableNormalArray(*this); }
inline void setColorPointer(const Array* array) { _vas->setColorArray(*this, array); }
inline void setColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_TRUE ) { _vas->setColorArray(*this, size, type, stride, ptr, normalized); }
inline void disableColorPointer() { _vas->disableColorArray(*this); }
inline bool isSecondaryColorSupported() const { return _isSecondaryColorSupported; }
inline void setSecondaryColorPointer(const Array* array) { _vas->setSecondaryColorArray(*this, array); }
inline void disableSecondaryColorPointer() { _vas->disableSecondaryColorArray(*this); }
inline bool isFogCoordSupported() const { return _isFogCoordSupported; }
inline void setFogCoordPointer(const Array* array) { _vas->setFogCoordArray(*this, array); }
inline void disableFogCoordPointer() { _vas->disableFogCoordArray(*this); }
inline void setTexCoordPointer(unsigned int unit, const Array* array) { _vas->setTexCoordArray(*this, unit, array); }
inline void setTexCoordPointer( unsigned int unit, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE ) { _vas->setTexCoordArray(*this, unit, size, type, stride, ptr, normalized); }
inline void disableTexCoordPointer( unsigned int unit ) { _vas->disableTexCoordArray(*this, unit); }
inline void disableTexCoordPointersAboveAndIncluding( unsigned int unit ) { _vas->disableTexCoordArrayAboveAndIncluding(*this, unit); }
inline GLint getMaxTextureCoords() const { return _glMaxTextureCoords; }
inline GLint getMaxTextureUnits() const { return _glMaxTextureUnits; }
inline bool setActiveTextureUnit( unsigned int unit );
unsigned int getActiveTextureUnit() const { return _currentActiveTextureUnit; }
bool setClientActiveTextureUnit( unsigned int unit );
unsigned int getClientActiveTextureUnit() const;
inline void setVertexAttribPointer(unsigned int unit, const Array* array) { _vas->setVertexAttribArray(*this, unit, array); }
inline void setVertexAttribLPointer(unsigned int unit, const Array* array) { _vas->setVertexAttribArray(*this, unit, array); }
inline void setVertexAttribIPointer(unsigned int unit, const Array* array) { _vas->setVertexAttribArray(*this, unit, array); }
inline void disableVertexAttribPointer( unsigned int index ) { _vas->disableVertexAttribArray(*this, index); }
inline void disableVertexAttribPointersAboveAndIncluding( unsigned int index ) { _vas->disableVertexAttribArray(*this, index); }
void dirtyAllVertexArrays();
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 void setLastAppliedProgramObject(const Program::PerContextProgram* program)
{
if (_lastAppliedProgramObject!=program)
{
_lastAppliedProgramObject = program;
}
}
inline const Program::PerContextProgram* getLastAppliedProgramObject() const { return _lastAppliedProgramObject; }
inline GLint getUniformLocation( unsigned int uniformNameID ) const { return _lastAppliedProgramObject ? _lastAppliedProgramObject->getUniformLocation(uniformNameID) : -1; }
inline GLint getUniformLocation( const std::string & uniformName ) const { return _lastAppliedProgramObject ? _lastAppliedProgramObject->getUniformLocation(uniformName) : -1; }
inline GLint getAttribLocation( const std::string& name ) const { return _lastAppliedProgramObject ? _lastAppliedProgramObject->getAttribLocation(name) : -1; }
typedef std::pair<const StateAttribute*,StateAttribute::OverrideValue> AttributePair;
typedef std::vector<AttributePair> AttributeVec;
AttributeVec& getAttributeVec( const osg::StateAttribute* attribute )
{
AttributeStack& as = _attributeMap[ attribute->getTypeMemberPair() ];
return as.attributeVec;
}
inline void setFrameStamp(FrameStamp* fs) { _frameStamp = fs; }
inline FrameStamp* getFrameStamp() { return _frameStamp.get(); }
inline const FrameStamp* getFrameStamp() const { return _frameStamp.get(); }
inline void setDisplaySettings(DisplaySettings* vs) { _displaySettings = vs; }
inline const DisplaySettings* getDisplaySettings() const { return _displaySettings.get(); }
inline DisplaySettings* getActiveDisplaySettings() { return _displaySettings.valid() ? _displaySettings.get() : osg::DisplaySettings::instance().get(); }
inline const DisplaySettings* getActiveDisplaySettings() const { return _displaySettings.valid() ? _displaySettings.get() : osg::DisplaySettings::instance().get(); }
void setAbortRenderingPtr(bool* abortPtr) { _abortRenderingPtr = abortPtr; }
bool getAbortRendering() const { return _abortRenderingPtr!=0?(*_abortRenderingPtr):false; }
struct DynamicObjectRenderingCompletedCallback : public osg::Referenced
{
virtual void completed(osg::State*) = 0;
};
void setDynamicObjectRenderingCompletedCallback(DynamicObjectRenderingCompletedCallback* cb){ _completeDynamicObjectRenderingCallback = cb; }
DynamicObjectRenderingCompletedCallback* getDynamicObjectRenderingCompletedCallback() { return _completeDynamicObjectRenderingCallback.get(); }
void setDynamicObjectCount(unsigned int count, bool callCallbackOnZero = false)
{
if (_dynamicObjectCount != count)
{
_dynamicObjectCount = count;
if (_dynamicObjectCount==0 && callCallbackOnZero && _completeDynamicObjectRenderingCallback.valid())
{
_completeDynamicObjectRenderingCallback->completed(this);
}
}
}
unsigned int getDynamicObjectCount() const { return _dynamicObjectCount; }
inline void decrementDynamicObjectCount()
{
--_dynamicObjectCount;
if (_dynamicObjectCount==0 && _completeDynamicObjectRenderingCallback.valid())
{
_completeDynamicObjectRenderingCallback->completed(this);
}
}
void setMaxTexturePoolSize(unsigned int size);
unsigned int getMaxTexturePoolSize() const { return _maxTexturePoolSize; }
void setMaxBufferObjectPoolSize(unsigned int size);
unsigned int getMaxBufferObjectPoolSize() const { return _maxBufferObjectPoolSize; }
enum CheckForGLErrors
{
NEVER_CHECK_GL_ERRORS,
ONCE_PER_FRAME,
ONCE_PER_ATTRIBUTE
};
void setCheckForGLErrors(CheckForGLErrors check) { _checkGLErrors = check; }
CheckForGLErrors getCheckForGLErrors() const { return _checkGLErrors; }
bool checkGLErrors(const char* str1=0, const char* str2=0) const;
bool checkGLErrors(StateAttribute::GLMode mode) const;
bool checkGLErrors(const StateAttribute* attribute) const;
void print(std::ostream& fout) const;
void initializeExtensionProcs();
inline AttributeDispatchers& getAttributeDispatchers() { return _arrayDispatchers; }
inline void setGraphicsCostEstimator(GraphicsCostEstimator* gce) { _graphicsCostEstimator = gce; }
inline GraphicsCostEstimator* getGraphicsCostEstimator() { return _graphicsCostEstimator.get(); }
inline const GraphicsCostEstimator* getGraphicsCostEstimator() const { return _graphicsCostEstimator.get(); }
Timer_t getStartTick() const { return _startTick; }
void setStartTick(Timer_t tick) { _startTick = tick; }
Timer_t getGpuTick() const { return _gpuTick; }
double getGpuTime() const
{
return osg::Timer::instance()->delta_s(_startTick, _gpuTick);
}
GLuint64 getGpuTimestamp() const { return _gpuTimestamp; }
void setGpuTimestamp(Timer_t tick, GLuint64 timestamp)
{
_gpuTick = tick;
_gpuTimestamp = timestamp;
}
int getTimestampBits() const { return _timestampBits; }
void setTimestampBits(int bits) { _timestampBits = bits; }
virtual void frameCompleted();
struct ModeStack
{
typedef std::vector<StateAttribute::GLModeValue> ValueVec;
ModeStack()
{
valid = true;
changed = false;
last_applied_value = false;
global_default_value = false;
}
void print(std::ostream& fout) const;
bool valid;
bool changed;
bool last_applied_value;
bool global_default_value;
ValueVec valueVec;
};
struct AttributeStack
{
AttributeStack()
{
changed = false;
last_applied_attribute = 0L;
last_applied_shadercomponent = 0L;
global_default_attribute = 0L;
}
void print(std::ostream& fout) const;
bool changed;
const StateAttribute* last_applied_attribute;
const ShaderComponent* last_applied_shadercomponent;
ref_ptr<const StateAttribute> global_default_attribute;
AttributeVec attributeVec;
};
struct UniformStack
{
typedef std::pair<const Uniform*,StateAttribute::OverrideValue> UniformPair;
typedef std::vector<UniformPair> UniformVec;
UniformStack() {}
void print(std::ostream& fout) const;
UniformVec uniformVec;
};
struct DefineStack
{
typedef std::vector<StateSet::DefinePair> DefineVec;
DefineStack():
changed(false) {}
void print(std::ostream& fout) const;
bool changed;
DefineVec defineVec;
};
struct DefineMap
{
DefineMap():
changed(false) {}
typedef std::map<std::string, DefineStack> DefineStackMap;
DefineStackMap map;
bool changed;
StateSet::DefineList currentDefines;
bool updateCurrentDefines();
};
typedef std::map<StateAttribute::GLMode,ModeStack> ModeMap;
typedef std::vector<ModeMap> TextureModeMapList;
typedef std::map<StateAttribute::TypeMemberPair,AttributeStack> AttributeMap;
typedef std::vector<AttributeMap> TextureAttributeMapList;
typedef std::map<std::string, UniformStack> UniformMap;
typedef std::vector< ref_ptr<const Matrix> > MatrixStack;
inline const ModeMap& getModeMap() const {return _modeMap;}
inline const AttributeMap& getAttributeMap() const {return _attributeMap;}
inline const UniformMap& getUniformMap() const {return _uniformMap;}
inline DefineMap& getDefineMap() {return _defineMap;}
inline const DefineMap& getDefineMap() const {return _defineMap;}
inline const TextureModeMapList& getTextureModeMapList() const {return _textureModeMapList;}
inline const TextureAttributeMapList& getTextureAttributeMapList() const {return _textureAttributeMapList;}
std::string getDefineString(const osg::ShaderDefines& shaderDefines);
bool supportsShaderRequirements(const osg::ShaderDefines& shaderRequirements);
bool supportsShaderRequirement(const std::string& shaderRequirement);
protected:
virtual ~State();
GraphicsContext* _graphicsContext;
unsigned int _contextID;
osg::ref_ptr<VertexArrayState> _globalVertexArrayState;
VertexArrayState* _vas;
bool _shaderCompositionEnabled;
bool _shaderCompositionDirty;
osg::ref_ptr<ShaderComposer> _shaderComposer;
osg::Program* _currentShaderCompositionProgram;
StateSet::UniformList _currentShaderCompositionUniformList;
ref_ptr<FrameStamp> _frameStamp;
GLenum _drawBuffer;
GLenum _readBuffer;
ref_ptr<const RefMatrix> _identity;
ref_ptr<const RefMatrix> _initialViewMatrix;
ref_ptr<const RefMatrix> _projection;
ref_ptr<const RefMatrix> _modelView;
ref_ptr<RefMatrix> _modelViewCache;
bool _useModelViewAndProjectionUniforms;
ref_ptr<Uniform> _modelViewMatrixUniform;
ref_ptr<Uniform> _projectionMatrixUniform;
ref_ptr<Uniform> _modelViewProjectionMatrixUniform;
ref_ptr<Uniform> _normalMatrixUniform;
Matrix _initialInverseViewMatrix;
ref_ptr<DisplaySettings> _displaySettings;
bool* _abortRenderingPtr;
CheckForGLErrors _checkGLErrors;
bool _useVertexAttributeAliasing;
VertexAttribAlias _vertexAlias;
VertexAttribAlias _normalAlias;
VertexAttribAlias _colorAlias;
VertexAttribAlias _secondaryColorAlias;
VertexAttribAlias _fogCoordAlias;
VertexAttribAliasList _texCoordAliasList;
Program::AttribBindingList _attributeBindingList;
void setUpVertexAttribAlias(VertexAttribAlias& alias, GLuint location, const std::string glName, const std::string osgName, const std::string& declaration);
inline bool applyMode(StateAttribute::GLMode mode,bool enabled,ModeStack& ms)
{
if (ms.valid && ms.last_applied_value != enabled)
{
ms.last_applied_value = enabled;
if (enabled) glEnable(mode);
else glDisable(mode);
if (_checkGLErrors==ONCE_PER_ATTRIBUTE) checkGLErrors(mode);
return true;
}
else
return false;
}
inline bool applyModeOnTexUnit(unsigned int unit,StateAttribute::GLMode mode,bool enabled,ModeStack& ms)
{
if (ms.valid && ms.last_applied_value != enabled)
{
if (setActiveTextureUnit(unit))
{
ms.last_applied_value = enabled;
if (enabled) glEnable(mode);
else glDisable(mode);
if (_checkGLErrors==ONCE_PER_ATTRIBUTE) checkGLErrors(mode);
return true;
}
else
return false;
}
else
return false;
}
inline bool applyAttribute(const StateAttribute* attribute,AttributeStack& as)
{
if (as.last_applied_attribute != attribute)
{
if (!as.global_default_attribute.valid()) as.global_default_attribute = attribute->cloneType()->asStateAttribute();
as.last_applied_attribute = attribute;
attribute->apply(*this);
const ShaderComponent* sc = attribute->getShaderComponent();
if (as.last_applied_shadercomponent != sc)
{
as.last_applied_shadercomponent = sc;
_shaderCompositionDirty = true;
}
if (_checkGLErrors==ONCE_PER_ATTRIBUTE) checkGLErrors(attribute);
return true;
}
else
return false;
}
inline bool applyAttributeOnTexUnit(unsigned int unit,const StateAttribute* attribute,AttributeStack& as)
{
if (as.last_applied_attribute != attribute)
{
if (setActiveTextureUnit(unit))
{
if (!as.global_default_attribute.valid()) as.global_default_attribute = attribute->cloneType()->asStateAttribute();
as.last_applied_attribute = attribute;
attribute->apply(*this);
const ShaderComponent* sc = attribute->getShaderComponent();
if (as.last_applied_shadercomponent != sc)
{
as.last_applied_shadercomponent = sc;
_shaderCompositionDirty = true;
}
if (_checkGLErrors==ONCE_PER_ATTRIBUTE) checkGLErrors(attribute);
return true;
}
else
return false;
}
else
return false;
}
inline bool applyGlobalDefaultAttribute(AttributeStack& as)
{
if (as.last_applied_attribute != as.global_default_attribute.get())
{
as.last_applied_attribute = as.global_default_attribute.get();
if (as.global_default_attribute.valid())
{
as.global_default_attribute->apply(*this);
const ShaderComponent* sc = as.global_default_attribute->getShaderComponent();
if (as.last_applied_shadercomponent != sc)
{
as.last_applied_shadercomponent = sc;
_shaderCompositionDirty = true;
}
if (_checkGLErrors==ONCE_PER_ATTRIBUTE) checkGLErrors(as.global_default_attribute.get());
}
return true;
}
else
return false;
}
inline bool applyGlobalDefaultAttributeOnTexUnit(unsigned int unit,AttributeStack& as)
{
if (as.last_applied_attribute != as.global_default_attribute.get())
{
if (setActiveTextureUnit(unit))
{
as.last_applied_attribute = as.global_default_attribute.get();
if (as.global_default_attribute.valid())
{
as.global_default_attribute->apply(*this);
const ShaderComponent* sc = as.global_default_attribute->getShaderComponent();
if (as.last_applied_shadercomponent != sc)
{
as.last_applied_shadercomponent = sc;
_shaderCompositionDirty = true;
}
if (_checkGLErrors==ONCE_PER_ATTRIBUTE) checkGLErrors(as.global_default_attribute.get());
}
return true;
}
else
return false;
}
else
return false;
}
ModeMap _modeMap;
AttributeMap _attributeMap;
UniformMap _uniformMap;
DefineMap _defineMap;
TextureModeMapList _textureModeMapList;
TextureAttributeMapList _textureAttributeMapList;
const Program::PerContextProgram* _lastAppliedProgramObject;
StateSetStack _stateStateStack;
unsigned int _maxTexturePoolSize;
unsigned int _maxBufferObjectPoolSize;
unsigned int _currentActiveTextureUnit;
unsigned int _currentClientActiveTextureUnit;
GLBufferObject* _currentPBO;
GLBufferObject* _currentDIBO;
GLuint _currentVAO;
inline ModeMap& getOrCreateTextureModeMap(unsigned int unit)
{
if (unit>=_textureModeMapList.size()) _textureModeMapList.resize(unit+1);
return _textureModeMapList[unit];
}
inline AttributeMap& getOrCreateTextureAttributeMap(unsigned int unit)
{
if (unit>=_textureAttributeMapList.size()) _textureAttributeMapList.resize(unit+1);
return _textureAttributeMapList[unit];
}
inline void pushModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
inline void pushAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
inline void pushUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
inline void pushDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList);
inline void popModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
inline void popAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
inline void popUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
inline void popDefineList(DefineMap& uniformMap,const StateSet::DefineList& defineList);
inline void applyModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
inline void applyAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
inline void applyUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
inline void applyDefineList(DefineMap& uniformMap,const StateSet::DefineList& defineList);
inline void applyModeMap(ModeMap& modeMap);
inline void applyAttributeMap(AttributeMap& attributeMap);
inline void applyUniformMap(UniformMap& uniformMap);
inline void applyModeListOnTexUnit(unsigned int unit,ModeMap& modeMap,const StateSet::ModeList& modeList);
inline void applyAttributeListOnTexUnit(unsigned int unit,AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
inline void applyModeMapOnTexUnit(unsigned int unit,ModeMap& modeMap);
inline void applyAttributeMapOnTexUnit(unsigned int unit,AttributeMap& attributeMap);
void haveAppliedMode(ModeMap& modeMap,StateAttribute::GLMode mode,StateAttribute::GLModeValue value);
void haveAppliedMode(ModeMap& modeMap,StateAttribute::GLMode mode);
void haveAppliedAttribute(AttributeMap& attributeMap,const StateAttribute* attribute);
void haveAppliedAttribute(AttributeMap& attributeMap,StateAttribute::Type type, unsigned int member);
bool getLastAppliedMode(const ModeMap& modeMap,StateAttribute::GLMode mode) const;
const StateAttribute* getLastAppliedAttribute(const AttributeMap& attributeMap,StateAttribute::Type type, unsigned int member) const;
void loadModelViewMatrix();
bool _isSecondaryColorSupported;
bool _isFogCoordSupported;
bool _isVertexBufferObjectSupported;
bool _isVertexArrayObjectSupported;
bool _forceVertexBufferObject;
bool _forceVertexArrayObject;
typedef void (GL_APIENTRY * ActiveTextureProc) (GLenum texture);
typedef void (GL_APIENTRY * FogCoordPointerProc) (GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (GL_APIENTRY * SecondaryColorPointerProc) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (GL_APIENTRY * MultiTexCoord4fProc) (GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GL_APIENTRY * VertexAttrib4fProc)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GL_APIENTRY * VertexAttrib4fvProc)(GLuint index, const GLfloat *v);
typedef void (GL_APIENTRY * VertexAttribPointerProc) (unsigned int, GLint, GLenum, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
typedef void (GL_APIENTRY * VertexAttribIPointerProc) (unsigned int, GLint, GLenum, GLsizei stride, const GLvoid *pointer);
typedef void (GL_APIENTRY * VertexAttribLPointerProc) (unsigned int, GLint, GLenum, GLsizei stride, const GLvoid *pointer);
typedef void (GL_APIENTRY * EnableVertexAttribProc) (unsigned int);
typedef void (GL_APIENTRY * DisableVertexAttribProc) (unsigned int);
typedef void (GL_APIENTRY * BindBufferProc) (GLenum target, GLuint buffer);
typedef void (GL_APIENTRY * DrawArraysInstancedProc)( GLenum mode, GLint first, GLsizei count, GLsizei primcount );
typedef void (GL_APIENTRY * DrawElementsInstancedProc)( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount );
bool _extensionProcsInitialized;
GLint _glMaxTextureCoords;
GLint _glMaxTextureUnits;
ActiveTextureProc _glClientActiveTexture;
ActiveTextureProc _glActiveTexture;
MultiTexCoord4fProc _glMultiTexCoord4f;
VertexAttrib4fProc _glVertexAttrib4f;
VertexAttrib4fvProc _glVertexAttrib4fv;
FogCoordPointerProc _glFogCoordPointer;
SecondaryColorPointerProc _glSecondaryColorPointer;
VertexAttribPointerProc _glVertexAttribPointer;
VertexAttribIPointerProc _glVertexAttribIPointer;
VertexAttribLPointerProc _glVertexAttribLPointer;
EnableVertexAttribProc _glEnableVertexAttribArray;
DisableVertexAttribProc _glDisableVertexAttribArray;
BindBufferProc _glBindBuffer;
DrawArraysInstancedProc _glDrawArraysInstanced;
DrawElementsInstancedProc _glDrawElementsInstanced;
osg::ref_ptr<GLExtensions> _glExtensions;
unsigned int _dynamicObjectCount;
osg::ref_ptr<DynamicObjectRenderingCompletedCallback> _completeDynamicObjectRenderingCallback;
AttributeDispatchers _arrayDispatchers;
osg::ref_ptr<GraphicsCostEstimator> _graphicsCostEstimator;
Timer_t _startTick;
Timer_t _gpuTick;
GLuint64 _gpuTimestamp;
int _timestampBits;
};
inline void State::pushModeList(ModeMap& modeMap,const StateSet::ModeList& modeList)
{
for(StateSet::ModeList::const_iterator mitr=modeList.begin();
mitr!=modeList.end();
++mitr)
{
// get the mode stack for incoming GLmode {mitr->first}.
ModeStack& ms = modeMap[mitr->first];
if (ms.valueVec.empty())
{
// first pair so simply push incoming pair to back.
ms.valueVec.push_back(mitr->second);
}
else if ((ms.valueVec.back() & StateAttribute::OVERRIDE) && !(mitr->second & StateAttribute::PROTECTED)) // check the existing override flag
{
// push existing back since override keeps the previous value.
ms.valueVec.push_back(ms.valueVec.back());
}
else
{
// no override on so simply push incoming pair to back.
ms.valueVec.push_back(mitr->second);
}
ms.changed = true;
}
}
inline void State::pushAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList)
{
for(StateSet::AttributeList::const_iterator aitr=attributeList.begin();
aitr!=attributeList.end();
++aitr)
{
// get the attribute stack for incoming type {aitr->first}.
AttributeStack& as = attributeMap[aitr->first];
if (as.attributeVec.empty())
{
// first pair so simply push incoming pair to back.
as.attributeVec.push_back(
AttributePair(aitr->second.first.get(),aitr->second.second));
}
else if ((as.attributeVec.back().second & StateAttribute::OVERRIDE) && !(aitr->second.second & StateAttribute::PROTECTED)) // check the existing override flag
{
// push existing back since override keeps the previous value.
as.attributeVec.push_back(as.attributeVec.back());
}
else
{
// no override on so simply push incoming pair to back.
as.attributeVec.push_back(
AttributePair(aitr->second.first.get(),aitr->second.second));
}
as.changed = true;
}
}
inline void State::pushUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList)
{
for(StateSet::UniformList::const_iterator aitr=uniformList.begin();
aitr!=uniformList.end();
++aitr)
{
// get the attribute stack for incoming type {aitr->first}.
UniformStack& us = uniformMap[aitr->first];
if (us.uniformVec.empty())
{
// first pair so simply push incoming pair to back.
us.uniformVec.push_back(
UniformStack::UniformPair(aitr->second.first.get(),aitr->second.second));
}
else if ((us.uniformVec.back().second & StateAttribute::OVERRIDE) && !(aitr->second.second & StateAttribute::PROTECTED)) // check the existing override flag
{
// push existing back since override keeps the previous value.
us.uniformVec.push_back(us.uniformVec.back());
}
else
{
// no override on so simply push incoming pair to back.
us.uniformVec.push_back(
UniformStack::UniformPair(aitr->second.first.get(),aitr->second.second));
}
}
}
inline void State::pushDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList)
{
for(StateSet::DefineList::const_iterator aitr=defineList.begin();
aitr!=defineList.end();
++aitr)
{
// get the attribute stack for incoming type {aitr->first}.
DefineStack& ds = defineMap.map[aitr->first];
DefineStack::DefineVec& dv = ds.defineVec;
if (dv.empty())
{
// first pair so simply push incoming pair to back.
dv.push_back(StateSet::DefinePair(aitr->second.first,aitr->second.second));
ds.changed = true;
defineMap.changed = true;
}
else if ((ds.defineVec.back().second & StateAttribute::OVERRIDE) && !(aitr->second.second & StateAttribute::PROTECTED)) // check the existing override flag
{
// push existing back since override keeps the previous value.
ds.defineVec.push_back(ds.defineVec.back());
}
else
{
// no override on so simply push incoming pair to back.
dv.push_back(StateSet::DefinePair(aitr->second.first,aitr->second.second));
// if the back of the stack has changed since the last then mark it as changed.
bool changed = (dv[dv.size()-2] != dv.back());
if (changed)
{
ds.changed = true;
defineMap.changed = true;
}
}
}
}
inline void State::popModeList(ModeMap& modeMap,const StateSet::ModeList& modeList)
{
for(StateSet::ModeList::const_iterator mitr=modeList.begin();
mitr!=modeList.end();
++mitr)
{
// get the mode stack for incoming GLmode {mitr->first}.
ModeStack& ms = modeMap[mitr->first];
if (!ms.valueVec.empty())
{
ms.valueVec.pop_back();
}
ms.changed = true;
}
}
inline void State::popAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList)
{
for(StateSet::AttributeList::const_iterator aitr=attributeList.begin();
aitr!=attributeList.end();
++aitr)
{
// get the attribute stack for incoming type {aitr->first}.
AttributeStack& as = attributeMap[aitr->first];
if (!as.attributeVec.empty())
{
as.attributeVec.pop_back();
}
as.changed = true;
}
}
inline void State::popUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList)
{
for(StateSet::UniformList::const_iterator aitr=uniformList.begin();
aitr!=uniformList.end();
++aitr)
{
// get the attribute stack for incoming type {aitr->first}.
UniformStack& us = uniformMap[aitr->first];
if (!us.uniformVec.empty())
{
us.uniformVec.pop_back();
}
}
}
inline void State::popDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList)
{
for(StateSet::DefineList::const_iterator aitr=defineList.begin();
aitr!=defineList.end();
++aitr)
{
// get the attribute stack for incoming type {aitr->first}.
DefineStack& ds = defineMap.map[aitr->first];
DefineStack::DefineVec& dv = ds.defineVec;
if (!dv.empty())
{
// if the stack has less than 2 entries or new back vs old back are different then mark the DefineStack as changed
if ((dv.size() < 2) || (dv[dv.size()-2] != dv.back()))
{
ds.changed = true;
defineMap.changed = true;
}
dv.pop_back();
}
}
}
inline void State::applyModeList(ModeMap& modeMap,const StateSet::ModeList& modeList)
{
StateSet::ModeList::const_iterator ds_mitr = modeList.begin();
ModeMap::iterator this_mitr=modeMap.begin();
while (this_mitr!=modeMap.end() && ds_mitr!=modeList.end())
{
if (this_mitr->first<ds_mitr->first)
{
// note GLMode = this_mitr->first
ModeStack& ms = this_mitr->second;
if (ms.changed)
{
ms.changed = false;
if (!ms.valueVec.empty())
{
bool new_value = ms.valueVec.back() & StateAttribute::ON;
applyMode(this_mitr->first,new_value,ms);
}
else
{
// assume default of disabled.
applyMode(this_mitr->first,ms.global_default_value,ms);
}
}
++this_mitr;
}
else if (ds_mitr->first<this_mitr->first)
{
// ds_mitr->first is a new mode, therefore
// need to insert a new mode entry for ds_mistr->first.
ModeStack& ms = modeMap[ds_mitr->first];
bool new_value = ds_mitr->second & StateAttribute::ON;
applyMode(ds_mitr->first,new_value,ms);
// will need to disable this mode on next apply so set it to changed.
ms.changed = true;
++ds_mitr;
}
else
{
// this_mitr & ds_mitr refer to the same mode, check the override
// if any otherwise just apply the incoming mode.
ModeStack& ms = this_mitr->second;
if (!ms.valueVec.empty() && (ms.valueVec.back() & StateAttribute::OVERRIDE) && !(ds_mitr->second & StateAttribute::PROTECTED))
{
// override is on, just treat as a normal apply on modes.
if (ms.changed)
{
ms.changed = false;
bool new_value = ms.valueVec.back() & StateAttribute::ON;
applyMode(this_mitr->first,new_value,ms);
}
}
else
{
// no override on or no previous entry, therefore consider incoming mode.
bool new_value = ds_mitr->second & StateAttribute::ON;
if (applyMode(ds_mitr->first,new_value,ms))
{
ms.changed = true;
}
}
++this_mitr;
++ds_mitr;
}
}
// iterator over the remaining state modes to apply any previous changes.
for(;
this_mitr!=modeMap.end();
++this_mitr)
{
// note GLMode = this_mitr->first
ModeStack& ms = this_mitr->second;
if (ms.changed)
{
ms.changed = false;
if (!ms.valueVec.empty())
{
bool new_value = ms.valueVec.back() & StateAttribute::ON;
applyMode(this_mitr->first,new_value,ms);
}
else
{
// assume default of disabled.
applyMode(this_mitr->first,ms.global_default_value,ms);
}
}
}
// iterator over the remaining incoming modes to apply any new mode.
for(;
ds_mitr!=modeList.end();
++ds_mitr)
{
ModeStack& ms = modeMap[ds_mitr->first];
bool new_value = ds_mitr->second & StateAttribute::ON;
applyMode(ds_mitr->first,new_value,ms);
// will need to disable this mode on next apply so set it to changed.
ms.changed = true;
}
}
inline void State::applyModeListOnTexUnit(unsigned int unit,ModeMap& modeMap,const StateSet::ModeList& modeList)
{
StateSet::ModeList::const_iterator ds_mitr = modeList.begin();
ModeMap::iterator this_mitr=modeMap.begin();
while (this_mitr!=modeMap.end() && ds_mitr!=modeList.end())
{
if (this_mitr->first<ds_mitr->first)
{
// note GLMode = this_mitr->first
ModeStack& ms = this_mitr->second;
if (ms.changed)
{
ms.changed = false;
if (!ms.valueVec.empty())
{
bool new_value = ms.valueVec.back() & StateAttribute::ON;
applyModeOnTexUnit(unit,this_mitr->first,new_value,ms);
}
else
{
// assume default of disabled.
applyModeOnTexUnit(unit,this_mitr->first,ms.global_default_value,ms);
}
}
++this_mitr;
}
else if (ds_mitr->first<this_mitr->first)
{
// ds_mitr->first is a new mode, therefore
// need to insert a new mode entry for ds_mistr->first.
ModeStack& ms = modeMap[ds_mitr->first];
bool new_value = ds_mitr->second & StateAttribute::ON;
applyModeOnTexUnit(unit,ds_mitr->first,new_value,ms);
// will need to disable this mode on next apply so set it to changed.
ms.changed = true;
++ds_mitr;
}
else
{
// this_mitr & ds_mitr refer to the same mode, check the override
// if any otherwise just apply the incoming mode.
ModeStack& ms = this_mitr->second;
if (!ms.valueVec.empty() && (ms.valueVec.back() & StateAttribute::OVERRIDE) && !(ds_mitr->second & StateAttribute::PROTECTED))
{
// override is on, just treat as a normal apply on modes.
if (ms.changed)
{
ms.changed = false;
bool new_value = ms.valueVec.back() & StateAttribute::ON;
applyModeOnTexUnit(unit,this_mitr->first,new_value,ms);
}
}
else
{
// no override on or no previous entry, therefore consider incoming mode.
bool new_value = ds_mitr->second & StateAttribute::ON;
if (applyModeOnTexUnit(unit,ds_mitr->first,new_value,ms))
{
ms.changed = true;
}
}
++this_mitr;
++ds_mitr;
}
}
// iterator over the remaining state modes to apply any previous changes.
for(;
this_mitr!=modeMap.end();
++this_mitr)
{
// note GLMode = this_mitr->first
ModeStack& ms = this_mitr->second;
if (ms.changed)
{
ms.changed = false;
if (!ms.valueVec.empty())
{
bool new_value = ms.valueVec.back() & StateAttribute::ON;
applyModeOnTexUnit(unit,this_mitr->first,new_value,ms);
}
else
{
// assume default of disabled.
applyModeOnTexUnit(unit,this_mitr->first,ms.global_default_value,ms);
}
}
}
// iterator over the remaining incoming modes to apply any new mode.
for(;
ds_mitr!=modeList.end();
++ds_mitr)
{
ModeStack& ms = modeMap[ds_mitr->first];
bool new_value = ds_mitr->second & StateAttribute::ON;
applyModeOnTexUnit(unit,ds_mitr->first,new_value,ms);
// will need to disable this mode on next apply so set it to changed.
ms.changed = true;
}
}
inline void State::applyAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList)
{
StateSet::AttributeList::const_iterator ds_aitr=attributeList.begin();
AttributeMap::iterator this_aitr=attributeMap.begin();
while (this_aitr!=attributeMap.end() && ds_aitr!=attributeList.end())
{
if (this_aitr->first<ds_aitr->first)
{
// note attribute type = this_aitr->first
AttributeStack& as = this_aitr->second;
if (as.changed)
{
as.changed = false;
if (!as.attributeVec.empty())
{
const StateAttribute* new_attr = as.attributeVec.back().first;
applyAttribute(new_attr,as);
}
else
{
applyGlobalDefaultAttribute(as);
}
}
++this_aitr;
}
else if (ds_aitr->first<this_aitr->first)
{
// ds_aitr->first is a new attribute, therefore
// need to insert a new attribute entry for ds_aitr->first.
AttributeStack& as = attributeMap[ds_aitr->first];
const StateAttribute* new_attr = ds_aitr->second.first.get();
applyAttribute(new_attr,as);
as.changed = true;
++ds_aitr;
}
else
{
// this_mitr & ds_mitr refer to the same attribute, check the override
// if any otherwise just apply the incoming attribute
AttributeStack& as = this_aitr->second;
if (!as.attributeVec.empty() && (as.attributeVec.back().second & StateAttribute::OVERRIDE) && !(ds_aitr->second.second & StateAttribute::PROTECTED))
{
// override is on, just treat as a normal apply on attribute.
if (as.changed)
{
as.changed = false;
const StateAttribute* new_attr = as.attributeVec.back().first;
applyAttribute(new_attr,as);
}
}
else
{
// no override on or no previous entry, therefore consider incoming attribute.
const StateAttribute* new_attr = ds_aitr->second.first.get();
if (applyAttribute(new_attr,as))
{
as.changed = true;
}
}
++this_aitr;
++ds_aitr;
}
}
// iterator over the remaining state attributes to apply any previous changes.
for(;
this_aitr!=attributeMap.end();
++this_aitr)
{
// note attribute type = this_aitr->first
AttributeStack& as = this_aitr->second;
if (as.changed)
{
as.changed = false;
if (!as.attributeVec.empty())
{
const StateAttribute* new_attr = as.attributeVec.back().first;
applyAttribute(new_attr,as);
}
else
{
applyGlobalDefaultAttribute(as);
}
}
}
// iterator over the remaining incoming attribute to apply any new attribute.
for(;
ds_aitr!=attributeList.end();
++ds_aitr)
{
// ds_aitr->first is a new attribute, therefore
// need to insert a new attribute entry for ds_aitr->first.
AttributeStack& as = attributeMap[ds_aitr->first];
const StateAttribute* new_attr = ds_aitr->second.first.get();
applyAttribute(new_attr,as);
// will need to update this attribute on next apply so set it to changed.
as.changed = true;
}
}
inline void State::applyAttributeListOnTexUnit(unsigned int unit,AttributeMap& attributeMap,const StateSet::AttributeList& attributeList)
{
StateSet::AttributeList::const_iterator ds_aitr=attributeList.begin();
AttributeMap::iterator this_aitr=attributeMap.begin();
while (this_aitr!=attributeMap.end() && ds_aitr!=attributeList.end())
{
if (this_aitr->first<ds_aitr->first)
{
// note attribute type = this_aitr->first
AttributeStack& as = this_aitr->second;
if (as.changed)
{
as.changed = false;
if (!as.attributeVec.empty())
{
const StateAttribute* new_attr = as.attributeVec.back().first;
applyAttributeOnTexUnit(unit,new_attr,as);
}
else
{
applyGlobalDefaultAttributeOnTexUnit(unit,as);
}
}
++this_aitr;
}
else if (ds_aitr->first<this_aitr->first)
{
// ds_aitr->first is a new attribute, therefore
// need to insert a new attribute entry for ds_aitr->first.
AttributeStack& as = attributeMap[ds_aitr->first];
const StateAttribute* new_attr = ds_aitr->second.first.get();
applyAttributeOnTexUnit(unit,new_attr,as);
as.changed = true;
++ds_aitr;
}
else
{
// this_mitr & ds_mitr refer to the same attribute, check the override
// if any otherwise just apply the incoming attribute
AttributeStack& as = this_aitr->second;
if (!as.attributeVec.empty() && (as.attributeVec.back().second & StateAttribute::OVERRIDE) && !(ds_aitr->second.second & StateAttribute::PROTECTED))
{
// override is on, just treat as a normal apply on attribute.
if (as.changed)
{
as.changed = false;
const StateAttribute* new_attr = as.attributeVec.back().first;
applyAttributeOnTexUnit(unit,new_attr,as);
}
}
else
{
// no override on or no previous entry, therefore consider incoming attribute.
const StateAttribute* new_attr = ds_aitr->second.first.get();
if (applyAttributeOnTexUnit(unit,new_attr,as))
{
as.changed = true;
}
}
++this_aitr;
++ds_aitr;
}
}
// iterator over the remaining state attributes to apply any previous changes.
for(;
this_aitr!=attributeMap.end();
++this_aitr)
{
// note attribute type = this_aitr->first
AttributeStack& as = this_aitr->second;
if (as.changed)
{
as.changed = false;
if (!as.attributeVec.empty())
{
const StateAttribute* new_attr = as.attributeVec.back().first;
applyAttributeOnTexUnit(unit,new_attr,as);
}
else
{
applyGlobalDefaultAttributeOnTexUnit(unit,as);
}
}
}
// iterator over the remaining incoming attribute to apply any new attribute.
for(;
ds_aitr!=attributeList.end();
++ds_aitr)
{
// ds_aitr->first is a new attribute, therefore
// need to insert a new attribute entry for ds_aitr->first.
AttributeStack& as = attributeMap[ds_aitr->first];
const StateAttribute* new_attr = ds_aitr->second.first.get();
applyAttributeOnTexUnit(unit,new_attr,as);
// will need to update this attribute on next apply so set it to changed.
as.changed = true;
}
}
inline void State::applyUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList)
{
if (!_lastAppliedProgramObject) return;
StateSet::UniformList::const_iterator ds_aitr=uniformList.begin();
UniformMap::iterator this_aitr=uniformMap.begin();
while (this_aitr!=uniformMap.end() && ds_aitr!=uniformList.end())
{
if (this_aitr->first<ds_aitr->first)
{
// note attribute type = this_aitr->first
UniformStack& as = this_aitr->second;
if (!as.uniformVec.empty())
{
_lastAppliedProgramObject->apply(*as.uniformVec.back().first);
}
++this_aitr;
}
else if (ds_aitr->first<this_aitr->first)
{
_lastAppliedProgramObject->apply(*(ds_aitr->second.first.get()));
++ds_aitr;
}
else
{
// this_mitr & ds_mitr refer to the same attribute, check the override
// if any otherwise just apply the incoming attribute
UniformStack& as = this_aitr->second;
if (!as.uniformVec.empty() && (as.uniformVec.back().second & StateAttribute::OVERRIDE) && !(ds_aitr->second.second & StateAttribute::PROTECTED))
{
// override is on, just treat as a normal apply on uniform.
_lastAppliedProgramObject->apply(*as.uniformVec.back().first);
}
else
{
// no override on or no previous entry, therefore consider incoming attribute.
_lastAppliedProgramObject->apply(*(ds_aitr->second.first.get()));
}
++this_aitr;
++ds_aitr;
}
}
// iterator over the remaining state attributes to apply any previous changes.
for(;
this_aitr!=uniformMap.end();
++this_aitr)
{
// note attribute type = this_aitr->first
UniformStack& as = this_aitr->second;
if (!as.uniformVec.empty())
{
_lastAppliedProgramObject->apply(*as.uniformVec.back().first);
}
}
// iterator over the remaining incoming attribute to apply any new attribute.
for(;
ds_aitr!=uniformList.end();
++ds_aitr)
{
_lastAppliedProgramObject->apply(*(ds_aitr->second.first.get()));
}
}
inline void State::applyDefineList(DefineMap& defineMap, const StateSet::DefineList& defineList)
{
StateSet::DefineList::const_iterator dl_itr = defineList.begin();
DefineMap::DefineStackMap::iterator dm_itr = defineMap.map.begin();
defineMap.changed = false;
defineMap.currentDefines.clear();
while (dm_itr!=defineMap.map.end() && dl_itr!=defineList.end())
{
if (dm_itr->first<dl_itr->first)
{
DefineStack& ds = dm_itr->second;
DefineStack::DefineVec& dv = ds.defineVec;
if (!dv.empty() && (dv.back().second & StateAttribute::ON)!=0) defineMap.currentDefines[dm_itr->first] = dv.back();
++dm_itr;
}
else if (dl_itr->first<dm_itr->first)
{
if ((dl_itr->second.second & StateAttribute::ON)!=0) defineMap.currentDefines[dl_itr->first] = dl_itr->second;
++dl_itr;
}
else
{
// this_mitr & ds_mitr refer to the same mode, check the override
// if any otherwise just apply the incoming mode.
DefineStack& ds = dm_itr->second;
DefineStack::DefineVec& dv = ds.defineVec;
if (!dv.empty() && (dv.back().second & StateAttribute::OVERRIDE)!=0 && !(dl_itr->second.second & StateAttribute::PROTECTED))
{
// override is on, just treat as a normal apply on modes.
if ((dv.back().second & StateAttribute::ON)!=0) defineMap.currentDefines[dm_itr->first] = dv.back();
}
else
{
// no override on or no previous entry, therefore consider incoming mode.
if ((dl_itr->second.second & StateAttribute::ON)!=0) defineMap.currentDefines[dl_itr->first] = dl_itr->second;
}
++dm_itr;
++dl_itr;
}
}
// iterator over the remaining state modes to apply any previous changes.
for(;
dm_itr!=defineMap.map.end();
++dm_itr)
{
// note GLMode = this_mitr->first
DefineStack& ds = dm_itr->second;
DefineStack::DefineVec& dv = ds.defineVec;
if (!dv.empty() && (dv.back().second & StateAttribute::ON)!=0) defineMap.currentDefines[dm_itr->first] = dv.back();
}
// iterator over the remaining incoming modes to apply any new mode.
for(;
dl_itr!=defineList.end();
++dl_itr)
{
if ((dl_itr->second.second & StateAttribute::ON)!=0) defineMap.currentDefines[dl_itr->first] = dl_itr->second;
}
}
inline void State::applyModeMap(ModeMap& modeMap)
{
for(ModeMap::iterator mitr=modeMap.begin();
mitr!=modeMap.end();
++mitr)
{
// note GLMode = mitr->first
ModeStack& ms = mitr->second;
if (ms.changed)
{
ms.changed = false;
if (!ms.valueVec.empty())
{
bool new_value = ms.valueVec.back() & StateAttribute::ON;
applyMode(mitr->first,new_value,ms);
}
else
{
// assume default of disabled.
applyMode(mitr->first,ms.global_default_value,ms);
}
}
}
}
inline void State::applyModeMapOnTexUnit(unsigned int unit,ModeMap& modeMap)
{
for(ModeMap::iterator mitr=modeMap.begin();
mitr!=modeMap.end();
++mitr)
{
// note GLMode = mitr->first
ModeStack& ms = mitr->second;
if (ms.changed)
{
ms.changed = false;
if (!ms.valueVec.empty())
{
bool new_value = ms.valueVec.back() & StateAttribute::ON;
applyModeOnTexUnit(unit,mitr->first,new_value,ms);
}
else
{
// assume default of disabled.
applyModeOnTexUnit(unit,mitr->first,ms.global_default_value,ms);
}
}
}
}
inline void State::applyAttributeMap(AttributeMap& attributeMap)
{
for(AttributeMap::iterator aitr=attributeMap.begin();
aitr!=attributeMap.end();
++aitr)
{
AttributeStack& as = aitr->second;
if (as.changed)
{
as.changed = false;
if (!as.attributeVec.empty())
{
const StateAttribute* new_attr = as.attributeVec.back().first;
applyAttribute(new_attr,as);
}
else
{
applyGlobalDefaultAttribute(as);
}
}
}
}
inline void State::applyAttributeMapOnTexUnit(unsigned int unit,AttributeMap& attributeMap)
{
for(AttributeMap::iterator aitr=attributeMap.begin();
aitr!=attributeMap.end();
++aitr)
{
AttributeStack& as = aitr->second;
if (as.changed)
{
as.changed = false;
if (!as.attributeVec.empty())
{
const StateAttribute* new_attr = as.attributeVec.back().first;
applyAttributeOnTexUnit(unit,new_attr,as);
}
else
{
applyGlobalDefaultAttributeOnTexUnit(unit,as);
}
}
}
}
inline void State::applyUniformMap(UniformMap& uniformMap)
{
if (!_lastAppliedProgramObject) return;
for(UniformMap::iterator aitr=uniformMap.begin();
aitr!=uniformMap.end();
++aitr)
{
UniformStack& as = aitr->second;
if (!as.uniformVec.empty())
{
_lastAppliedProgramObject->apply(*as.uniformVec.back().first);
}
}
}
inline bool State::setActiveTextureUnit( unsigned int unit )
{
if (unit!=_currentActiveTextureUnit)
{
if (_glActiveTexture && unit < (unsigned int)(maximum(_glMaxTextureCoords,_glMaxTextureUnits)) )
{
_glActiveTexture(GL_TEXTURE0+unit);
_currentActiveTextureUnit = unit;
}
else
{
return unit==0;
}
}
return true;
}
// forward declare speciailization of State::get() method
template<> inline GLExtensions* State::get<GLExtensions>() { return _glExtensions.get(); }
template<> inline const GLExtensions* State::get<GLExtensions>() const { return _glExtensions.get(); }
template<> inline void State::set<GLExtensions>(GLExtensions* ptr) { _glExtensions = ptr; }
}
#endif
AttributeDispatchers
BufferObject
GL_PIXEL_UNPACK_BUFFER_ARB
#define GL_PIXEL_UNPACK_BUFFER_ARB
Definition BufferObject:85
DisplaySettings
FrameStamp
GL_DRAW_INDIRECT_BUFFER
#define GL_DRAW_INDIRECT_BUFFER
Definition GLDefines:438
GLExtensions
GraphicsCostEstimator
Matrix
Observer
Polytope
ShaderComposer
StateSet
GL_TEXTURE0
#define GL_TEXTURE0
Definition State:42
Timer
Uniform
VertexArrayState
Viewport
osg::Array
Definition Array:61
osg::AttributeDispatchers
Definition AttributeDispatchers:35
osg::DisplaySettings
Definition DisplaySettings:34
osg::DisplaySettings::instance
static ref_ptr< DisplaySettings > & instance()
osg::FrameStamp
Definition FrameStamp:35
osg::GLBufferObject
Definition BufferObject:164
osg::GLBufferObject::compileBuffer
void compileBuffer()
osg::GLBufferObject::bindBuffer
void bindBuffer()
Definition BufferObject:771
osg::GLBufferObject::isDirty
bool isDirty() const
Definition BufferObject:222
osg::GLExtensions
Definition GLExtensions:169
osg::GraphicsContext
Definition GraphicsContext:30
osg::GraphicsCostEstimator
Definition GraphicsCostEstimator:108
osg::Object::asStateAttribute
virtual StateAttribute * asStateAttribute()
Definition Object:127
osg::Object::getName
const std::string & getName() const
Definition Object:213
osg::Polytope
Definition Polytope:26
osg::Program::PerContextProgram
Definition osg/Program:264
osg::Program
Definition osg/Program:52
osg::Program::AttribBindingList
std::map< std::string, GLuint > AttribBindingList
Definition osg/Program:217
osg::Referenced
Definition Referenced:44
osg::Referenced::Referenced
Referenced()
osg::ShaderComponent
Definition Shader:318
osg::ShaderComposer
deprecated
Definition ShaderComposer:30
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::GLMode
GLenum GLMode
Definition StateAttribute:81
osg::StateAttribute::OVERRIDE
@ OVERRIDE
Definition StateAttribute:105
osg::StateAttribute::PROTECTED
@ PROTECTED
Definition StateAttribute:107
osg::StateAttribute::ON
@ ON
Definition StateAttribute:103
osg::StateAttribute::getShaderComponent
ShaderComponent * getShaderComponent()
Definition StateAttribute:304
osg::StateAttribute::getTypeMemberPair
TypeMemberPair getTypeMemberPair() const
Definition StateAttribute:270
osg::StateAttribute::GLModeValue
unsigned int GLModeValue
Definition StateAttribute:85
osg::StateAttribute::apply
virtual void apply(State &) const
Definition StateAttribute:358
osg::StateAttribute::Type
Type
Definition StateAttribute:124
osg::StateAttribute::VIEWPORT
@ VIEWPORT
Definition StateAttribute:155
osg::StateAttribute::TypeMemberPair
std::pair< Type, unsigned int > TypeMemberPair
Definition StateAttribute:218
osg::StateAttribute::cloneType
virtual Object * cloneType() const =0
osg::StateAttribute::OverrideValue
unsigned int OverrideValue
Definition StateAttribute:89
osg::StateSet
Definition StateSet:46
osg::StateSet::RefUniformPair
std::pair< ref_ptr< Uniform >, StateAttribute::OverrideValue > RefUniformPair
Definition StateSet:302
osg::StateSet::UniformList
std::map< std::string, RefUniformPair > UniformList
Definition StateSet:305
osg::StateSet::AttributeList
std::map< StateAttribute::TypeMemberPair, RefAttributePair > AttributeList
Definition StateSet:166
osg::StateSet::DefinePair
std::pair< std::string, StateAttribute::OverrideValue > DefinePair
Definition StateSet:345
osg::StateSet::ModeList
std::map< StateAttribute::GLMode, StateAttribute::GLModeValue > ModeList
Definition StateSet:119
osg::StateSet::DefineList
std::map< std::string, DefinePair > DefineList
Definition StateSet:346
osg::State
Definition State:80
osg::State::getContextID
unsigned int getContextID() const
Definition State:114
osg::State::_currentDIBO
GLBufferObject * _currentDIBO
Definition State:1306
osg::State::releaseGLObjects
void releaseGLObjects()
osg::State::getMaxBufferObjectPoolSize
unsigned int getMaxBufferObjectPoolSize() const
Definition State:901
osg::State::getTextureModeMapList
const TextureModeMapList & getTextureModeMapList() const
Definition State:1074
osg::State::frameCompleted
virtual void frameCompleted()
osg::State::getDefineMap
DefineMap & getDefineMap()
Definition State:1072
osg::State::getLastAppliedMode
bool getLastAppliedMode(StateAttribute::GLMode mode) const
osg::State::applyAttributeMap
void applyAttributeMap(AttributeMap &attributeMap)
Definition State:2281
osg::State::setCheckForGLErrors
void setCheckForGLErrors(CheckForGLErrors check)
Definition State:920
osg::State::getFrameStamp
FrameStamp * getFrameStamp()
Definition State:830
osg::State::setContextID
void setContextID(unsigned int contextID)
Definition State:111
osg::State::checkGLErrors
bool checkGLErrors(const StateAttribute *attribute) const
osg::State::getGraphicsContext
GraphicsContext * getGraphicsContext()
Definition State:90
osg::State::VerteAttrib
void VerteAttrib(unsigned int location, float x, float y=0.0f, float z=0.0f, float w=0.0f)
Definition State:715
osg::State::_attributeMap
AttributeMap _attributeMap
Definition State:1288
osg::State::setVertexPointer
void setVertexPointer(const Array *array)
Definition State:727
osg::State::getAttributeDispatchers
AttributeDispatchers & getAttributeDispatchers()
Definition State:936
osg::State::_glDrawElementsInstanced
DrawElementsInstancedProc _glDrawElementsInstanced
Definition State:1398
osg::State::setGraphicsCostEstimator
void setGraphicsCostEstimator(GraphicsCostEstimator *gce)
Definition State:940
osg::State::setCurrentPixelBufferObject
void setCurrentPixelBufferObject(osg::GLBufferObject *pbo)
Definition State:580
osg::State::applyModeList
void applyModeList(ModeMap &modeMap, const StateSet::ModeList &modeList)
Definition State:1607
osg::State::_useModelViewAndProjectionUniforms
bool _useModelViewAndProjectionUniforms
Definition State:1108
osg::State::MultiTexCoord4fProc
void(GL_APIENTRY * MultiTexCoord4fProc)(GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
Definition State:1368
osg::State::DrawArraysInstancedProc
void(GL_APIENTRY * DrawArraysInstancedProc)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
Definition State:1378
osg::State::applyAttributeOnTexUnit
bool applyAttributeOnTexUnit(unsigned int unit, const StateAttribute *attribute, AttributeStack &as)
Definition State:1207
osg::State::_initialInverseViewMatrix
Matrix _initialInverseViewMatrix
Definition State:1114
osg::State::pushDefineList
void pushDefineList(DefineMap &defineMap, const StateSet::DefineList &defineList)
Definition State:1500
osg::State::_quadIndicesGLushort
IndicesGLushort _quadIndicesGLushort[4]
Definition State:641
osg::State::setColorAlias
void setColorAlias(const VertexAttribAlias &alias)
Definition State:272
osg::State::popDefineList
void popDefineList(DefineMap &uniformMap, const StateSet::DefineList &defineList)
Definition State:1585
osg::State::_isVertexBufferObjectSupported
bool _isVertexBufferObjectSupported
Definition State:1360
osg::State::_glBindBuffer
BindBufferProc _glBindBuffer
Definition State:1396
osg::State::getProjectionMatrix
const osg::Matrix & getProjectionMatrix() const
Definition State:232
osg::State::useVertexBufferObject
bool useVertexBufferObject(bool useVBO) const
Definition State:790
osg::State::MatrixStack
std::vector< ref_ptr< const Matrix > > MatrixStack
Definition State:1067
osg::State::_glVertexAttribPointer
VertexAttribPointerProc _glVertexAttribPointer
Definition State:1391
osg::State::applyShaderCompositionUniform
void applyShaderCompositionUniform(const osg::Uniform *uniform, StateAttribute::OverrideValue value=StateAttribute::ON)
Definition State:174
osg::State::unbindDrawIndirectBufferObject
void unbindDrawIndirectBufferObject()
Definition State:623
osg::State::applyModelViewAndProjectionUniformsIfRequired
void applyModelViewAndProjectionUniformsIfRequired()
osg::State::applyMode
bool applyMode(StateAttribute::GLMode mode, bool enabled, ModeStack &ms)
Definition State:1143
osg::State::getLastAppliedTextureAttribute
const StateAttribute * getLastAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type, unsigned int member=0) const
osg::State::disableFogCoordPointer
void disableFogCoordPointer()
Definition State:746
osg::State::getDefineString
std::string getDefineString(const osg::ShaderDefines &shaderDefines)
osg::State::setGlobalDefaultAttribute
void setGlobalDefaultAttribute(const StateAttribute *attribute)
Definition State:431
osg::State::applyUniformMap
void applyUniformMap(UniformMap &uniformMap)
Definition State:2329
osg::State::resetCurrentVertexArrayStateOnMatch
void resetCurrentVertexArrayStateOnMatch(VertexArrayState *vas)
Definition State:553
osg::State::setNormalPointer
void setNormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
Definition State:733
osg::State::VertexAttribPointerProc
void(GL_APIENTRY * VertexAttribPointerProc)(unsigned int, GLint, GLenum, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
Definition State:1371
osg::State::get
T * get()
Definition State:124
osg::State::_colorAlias
VertexAttribAlias _colorAlias
Definition State:1125
osg::State::VertexAttribIPointerProc
void(GL_APIENTRY * VertexAttribIPointerProc)(unsigned int, GLint, GLenum, GLsizei stride, const GLvoid *pointer)
Definition State:1372
osg::State::popModeList
void popModeList(ModeMap &modeMap, const StateSet::ModeList &modeList)
Definition State:1538
osg::State::decrementDynamicObjectCount
void decrementDynamicObjectCount()
Definition State:888
osg::State::_shaderCompositionDirty
bool _shaderCompositionDirty
Definition State:1092
osg::State::getShaderComposer
ShaderComposer * getShaderComposer()
Definition State:165
osg::State::getUseVertexAttributeAliasing
bool getUseVertexAttributeAliasing() const
Definition State:256
osg::State::setLastAppliedProgramObject
void setLastAppliedProgramObject(const Program::PerContextProgram *program)
Definition State:796
osg::State::getGlobalDefaultTextureModeValue
bool getGlobalDefaultTextureModeValue(unsigned int unit, StateAttribute::GLMode mode)
Definition State:409
osg::State::getNormalAlias
const VertexAttribAlias & getNormalAlias()
Definition State:269
osg::State::glReadBuffer
void glReadBuffer(GLenum buffer)
osg::State::haveAppliedTextureMode
void haveAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
osg::State::haveAppliedMode
void haveAppliedMode(StateAttribute::GLMode mode)
osg::State::setTexCoordPointer
void setTexCoordPointer(unsigned int unit, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
Definition State:750
osg::State::setCurrentToGlobalVertexArrayState
void setCurrentToGlobalVertexArrayState()
Definition State:550
osg::State::getDrawBuffer
GLenum getDrawBuffer() const
Definition State:308
osg::State::setMaxTexturePoolSize
void setMaxTexturePoolSize(unsigned int size)
osg::State::setVertexPointer
void setVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
Definition State:728
osg::State::EnableVertexAttribProc
void(GL_APIENTRY * EnableVertexAttribProc)(unsigned int)
Definition State:1374
osg::State::_timestampBits
int _timestampBits
Definition State:1412
osg::State::_glActiveTexture
ActiveTextureProc _glActiveTexture
Definition State:1385
osg::State::getOrCreateTextureAttributeMap
AttributeMap & getOrCreateTextureAttributeMap(unsigned int unit)
Definition State:1317
osg::State::setVertexAttribLPointer
void setVertexAttribLPointer(unsigned int unit, const Array *array)
Definition State:778
osg::State::setCurrentVertexArrayObject
void setCurrentVertexArrayObject(GLuint vao)
Definition State:630
osg::State::_projection
ref_ptr< const RefMatrix > _projection
Definition State:1104
osg::State::getGraphicsContext
const GraphicsContext * getGraphicsContext() const
Definition State:93
osg::State::getTimestampBits
int getTimestampBits() const
Definition State:969
osg::State::VertexAttribLPointerProc
void(GL_APIENTRY * VertexAttribLPointerProc)(unsigned int, GLint, GLenum, GLsizei stride, const GLvoid *pointer)
Definition State:1373
osg::State::getActiveDisplaySettings
DisplaySettings * getActiveDisplaySettings()
Definition State:845
osg::State::getModeValidity
bool getModeValidity(StateAttribute::GLMode mode)
Definition State:324
osg::State::applyUniformList
void applyUniformList(UniformMap &uniformMap, const StateSet::UniformList &uniformList)
Definition State:2087
osg::State::applyModelViewMatrix
void applyModelViewMatrix(const osg::Matrix &)
osg::State::getLastAppliedAttribute
const StateAttribute * getLastAppliedAttribute(StateAttribute::Type type, unsigned int member=0) const
osg::State::setGlobalDefaultTextureAttribute
void setGlobalDefaultTextureAttribute(unsigned int unit, const StateAttribute *attribute)
Definition State:451
osg::State::getCurrentVertexBufferObject
const GLBufferObject * getCurrentVertexBufferObject()
Definition State:568
osg::State::haveAppliedAttribute
void haveAppliedAttribute(AttributeMap &attributeMap, const StateAttribute *attribute)
osg::State::getGlobalDefaultModeValue
bool getGlobalDefaultModeValue(StateAttribute::GLMode mode)
Definition State:336
osg::State::_glVertexAttrib4fv
VertexAttrib4fvProc _glVertexAttrib4fv
Definition State:1388
osg::State::getCheckForGLErrors
CheckForGLErrors getCheckForGLErrors() const
Definition State:923
osg::State::getTextureAttributeMapList
const TextureAttributeMapList & getTextureAttributeMapList() const
Definition State:1075
osg::State::applyModelViewMatrix
void applyModelViewMatrix(const osg::RefMatrix *matrix)
osg::State::_glExtensions
osg::ref_ptr< GLExtensions > _glExtensions
Definition State:1400
osg::State::insertStateSet
void insertStateSet(unsigned int pos, const StateSet *dstate)
osg::State::getAbortRendering
bool getAbortRendering() const
Definition State:856
osg::State::getLastAppliedTextureModeValue
bool getLastAppliedTextureModeValue(unsigned int unit, StateAttribute::GLMode mode)
Definition State:424
osg::State::getActiveTextureUnit
unsigned int getActiveTextureUnit() const
Definition State:767
osg::State::getLastAppliedProgramObject
const Program::PerContextProgram * getLastAppliedProgramObject() const
Definition State:803
osg::State::_defineMap
DefineMap _defineMap
Definition State:1290
osg::State::_identity
ref_ptr< const RefMatrix > _identity
Definition State:1102
osg::State::bindVertexArrayObject
void bindVertexArrayObject(GLuint vao)
Definition State:635
osg::State::_isVertexArrayObjectSupported
bool _isVertexArrayObjectSupported
Definition State:1361
osg::State::setColorPointer
void setColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_TRUE)
Definition State:737
osg::State::getModelViewMatrix
const osg::Matrix & getModelViewMatrix() const
Definition State:237
osg::State::setUpVertexAttribAlias
void setUpVertexAttribAlias(VertexAttribAlias &alias, GLuint location, const std::string glName, const std::string osgName, const std::string &declaration)
osg::State::VertexAttrib4fvProc
void(GL_APIENTRY * VertexAttrib4fvProc)(GLuint index, const GLfloat *v)
Definition State:1370
osg::State::setGlobalDefaultTextureModeValue
void setGlobalDefaultTextureModeValue(unsigned int unit, StateAttribute::GLMode mode, bool enabled)
Definition State:402
osg::State::_useVertexAttributeAliasing
bool _useVertexAttributeAliasing
Definition State:1122
osg::State::DrawElementsInstancedProc
void(GL_APIENTRY * DrawElementsInstancedProc)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
Definition State:1379
osg::State::haveAppliedTextureAttribute
void haveAppliedTextureAttribute(unsigned int unit, const StateAttribute *attribute)
osg::State::popStateSet
void popStateSet()
osg::State::applyAttributeListOnTexUnit
void applyAttributeListOnTexUnit(unsigned int unit, AttributeMap &attributeMap, const StateSet::AttributeList &attributeList)
Definition State:1969
osg::State::Normal
void Normal(float x, float y, float z)
Definition State:681
osg::State::DisableVertexAttribProc
void(GL_APIENTRY * DisableVertexAttribProc)(unsigned int)
Definition State:1375
osg::State::TextureModeMapList
std::vector< ModeMap > TextureModeMapList
Definition State:1059
osg::State::_abortRenderingPtr
bool * _abortRenderingPtr
Definition State:1118
osg::State::getViewFrustum
Polytope getViewFrustum() const
osg::State::VertexAttribAliasList
std::vector< VertexAttribAlias > VertexAttribAliasList
Definition State:258
osg::State::checkGLErrors
bool checkGLErrors(StateAttribute::GLMode mode) const
osg::State::lazyDisablingOfVertexAttributes
void lazyDisablingOfVertexAttributes()
Definition State:564
osg::State::State
State()
osg::State::setClientActiveTextureUnit
bool setClientActiveTextureUnit(unsigned int unit)
osg::State::setAbortRenderingPtr
void setAbortRenderingPtr(bool *abortPtr)
Definition State:852
osg::State::getAttributeVec
AttributeVec & getAttributeVec(const osg::StateAttribute *attribute)
Definition State:820
osg::State::applyShaderComposition
void applyShaderComposition()
osg::State::_shaderComposer
osg::ref_ptr< ShaderComposer > _shaderComposer
Definition State:1093
osg::State::disableVertexAttribPointer
void disableVertexAttribPointer(unsigned int index)
Definition State:781
osg::State::getLastAppliedMode
bool getLastAppliedMode(const ModeMap &modeMap, StateAttribute::GLMode mode) const
osg::State::_secondaryColorAlias
VertexAttribAlias _secondaryColorAlias
Definition State:1126
osg::State::_shaderCompositionEnabled
bool _shaderCompositionEnabled
Definition State:1091
osg::State::_modelViewCache
ref_ptr< RefMatrix > _modelViewCache
Definition State:1106
osg::State::getAttribLocation
GLint getAttribLocation(const std::string &name) const
Definition State:815
osg::State::popAttributeList
void popAttributeList(AttributeMap &attributeMap, const StateSet::AttributeList &attributeList)
Definition State:1554
osg::State::setTimestampBits
void setTimestampBits(int bits)
Definition State:970
osg::State::getModelViewMatrixUniform
osg::Uniform * getModelViewMatrixUniform()
Definition State:246
osg::State::getGlobalDefaultTextureAttribute
const StateAttribute * getGlobalDefaultTextureAttribute(unsigned int unit, StateAttribute::Type type, unsigned int member=0)
Definition State:458
osg::State::supportsShaderRequirement
bool supportsShaderRequirement(const std::string &shaderRequirement)
osg::State::popAllStateSets
void popAllStateSets()
osg::State::TexCoord
void TexCoord(float x, float y=0.0f, float z=0.0f, float w=1.0f)
Definition State:691
osg::State::setVertexAttribIPointer
void setVertexAttribIPointer(unsigned int unit, const Array *array)
Definition State:779
osg::State::bindPixelBufferObject
void bindPixelBufferObject(osg::GLBufferObject *pbo)
Definition State:583
osg::State::getNormalMatrixUniform
osg::Uniform * getNormalMatrixUniform()
Definition State:249
osg::State::haveAppliedAttribute
void haveAppliedAttribute(AttributeMap &attributeMap, StateAttribute::Type type, unsigned int member)
osg::State::_attributeBindingList
Program::AttribBindingList _attributeBindingList
Definition State:1130
osg::State::AttributePair
std::pair< const StateAttribute *, StateAttribute::OverrideValue > AttributePair
Definition State:817
osg::State::applyAttributeMapOnTexUnit
void applyAttributeMapOnTexUnit(unsigned int unit, AttributeMap &attributeMap)
Definition State:2305
osg::State::popStateSetStackToSize
void popStateSetStackToSize(unsigned int size)
Definition State:202
osg::State::_stateStateStack
StateSetStack _stateStateStack
Definition State:1297
osg::State::_glMaxTextureUnits
GLint _glMaxTextureUnits
Definition State:1383
osg::State::removeStateSet
void removeStateSet(unsigned int pos)
osg::State::dirtyAllVertexArrays
void dirtyAllVertexArrays()
osg::State::_currentPBO
GLBufferObject * _currentPBO
Definition State:1305
osg::State::_modelViewProjectionMatrixUniform
ref_ptr< Uniform > _modelViewProjectionMatrixUniform
Definition State:1111
osg::State::_gpuTick
Timer_t _gpuTick
Definition State:1410
osg::State::applyGlobalDefaultAttributeOnTexUnit
bool applyGlobalDefaultAttributeOnTexUnit(unsigned int unit, AttributeStack &as)
Definition State:1260
osg::State::reset
void reset()
osg::State::getCurrentShaderCompositionUniformList
StateSet::UniformList & getCurrentShaderCompositionUniformList()
Definition State:171
osg::State::_fogCoordAlias
VertexAttribAlias _fogCoordAlias
Definition State:1127
osg::State::_glEnableVertexAttribArray
EnableVertexAttribProc _glEnableVertexAttribArray
Definition State:1394
osg::State::_modelView
ref_ptr< const RefMatrix > _modelView
Definition State:1105
osg::State::getMaxTextureUnits
GLint getMaxTextureUnits() const
For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS.
Definition State:758
osg::State::getOrCreateTextureModeMap
ModeMap & getOrCreateTextureModeMap(unsigned int unit)
Definition State:1310
osg::State::setVertexAlias
void setVertexAlias(const VertexAttribAlias &alias)
Definition State:264
osg::State::unbindVertexBufferObject
void unbindVertexBufferObject()
Definition State:571
osg::State::glDrawArraysInstanced
void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
Definition State:648
osg::State::_textureAttributeMapList
TextureAttributeMapList _textureAttributeMapList
Definition State:1293
osg::State::setTexCoordPointer
void setTexCoordPointer(unsigned int unit, const Array *array)
Definition State:749
osg::State::getCurrentElementBufferObject
const GLBufferObject * getCurrentElementBufferObject()
Definition State:574
osg::State::setCurrentVertexArrayState
void setCurrentVertexArrayState(VertexArrayState *vas)
Definition State:544
osg::State::getGpuTick
Timer_t getGpuTick() const
Definition State:956
osg::State::popUniformList
void popUniformList(UniformMap &uniformMap, const StateSet::UniformList &uniformList)
Definition State:1570
osg::State::getInitialInverseViewMatrix
const osg::Matrix & getInitialInverseViewMatrix() const
Definition State:228
osg::State::unbindElementBufferObject
void unbindElementBufferObject()
Definition State:577
osg::State::haveAppliedAttribute
void haveAppliedAttribute(StateAttribute::Type type, unsigned int member=0)
osg::State::supportsShaderRequirements
bool supportsShaderRequirements(const osg::ShaderDefines &shaderRequirements)
osg::State::haveAppliedMode
void haveAppliedMode(ModeMap &modeMap, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
osg::State::applyModeMap
void applyModeMap(ModeMap &modeMap)
Definition State:2229
osg::State::_glFogCoordPointer
FogCoordPointerProc _glFogCoordPointer
Definition State:1389
osg::State::IndicesGLushort
std::vector< GLushort > IndicesGLushort
Definition State:640
osg::State::_glClientActiveTexture
ActiveTextureProc _glClientActiveTexture
Definition State:1384
osg::State::unbindPixelBufferObject
void unbindPixelBufferObject()
Definition State:600
osg::State::loadModelViewMatrix
void loadModelViewMatrix()
osg::State::disableVertexAttribPointersAboveAndIncluding
void disableVertexAttribPointersAboveAndIncluding(unsigned int index)
Definition State:782
osg::State::_quadIndicesGLuint
IndicesGLuint _quadIndicesGLuint[4]
Definition State:644
osg::State::updateModelViewAndProjectionMatrixUniforms
void updateModelViewAndProjectionMatrixUniforms()
osg::State::setAttributeBindingList
void setAttributeBindingList(const Program::AttribBindingList &attribBindingList)
Definition State:288
osg::State::getReadBuffer
GLenum getReadBuffer() const
Definition State:311
osg::State::pushUniformList
void pushUniformList(UniformMap &uniformMap, const StateSet::UniformList &uniformList)
Definition State:1472
osg::State::getStartTick
Timer_t getStartTick() const
Definition State:954
osg::State::SecondaryColorPointerProc
void(GL_APIENTRY * SecondaryColorPointerProc)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
Definition State:1367
osg::State::setGraphicsContext
void setGraphicsContext(GraphicsContext *context)
Definition State:87
osg::State::_projectionMatrixUniform
ref_ptr< Uniform > _projectionMatrixUniform
Definition State:1110
osg::State::_lastAppliedProgramObject
const Program::PerContextProgram * _lastAppliedProgramObject
Definition State:1295
osg::State::_vertexAlias
VertexAttribAlias _vertexAlias
Definition State:1123
osg::State::bindVertexBufferObject
void bindVertexBufferObject(osg::GLBufferObject *vbo)
Definition State:570
osg::State::getLastAppliedAttribute
const StateAttribute * getLastAppliedAttribute(const AttributeMap &attributeMap, StateAttribute::Type type, unsigned int member) const
osg::State::getGpuTimestamp
GLuint64 getGpuTimestamp() const
Definition State:962
osg::State::haveAppliedAttribute
void haveAppliedAttribute(const StateAttribute *attribute)
osg::State::VertexAttrib4fProc
void(GL_APIENTRY * VertexAttrib4fProc)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
Definition State:1369
osg::State::getUseModelViewAndProjectionUniforms
bool getUseModelViewAndProjectionUniforms() const
Definition State:240
osg::State::MultiTexCoord
void MultiTexCoord(unsigned int unit, float x, float y=0.0f, float z=0.0f, float w=1.0f)
Definition State:703
osg::State::_frameStamp
ref_ptr< FrameStamp > _frameStamp
Definition State:1097
osg::State::IndicesGLuint
std::vector< GLuint > IndicesGLuint
Definition State:643
osg::State::setColorPointer
void setColorPointer(const Array *array)
Definition State:736
osg::State::applyAttribute
bool applyAttribute(const StateAttribute *attribute, AttributeStack &as)
Definition State:1183
osg::State::getDisplaySettings
const DisplaySettings * getDisplaySettings() const
Definition State:842
osg::State::_texCoordAliasList
VertexAttribAliasList _texCoordAliasList
Definition State:1128
osg::State::applyModeMapOnTexUnit
void applyModeMapOnTexUnit(unsigned int unit, ModeMap &modeMap)
Definition State:2255
osg::State::pushAttributeList
void pushAttributeList(AttributeMap &attributeMap, const StateSet::AttributeList &attributeList)
Definition State:1442
osg::State::isVertexBufferObjectSupported
bool isVertexBufferObjectSupported() const
Definition State:789
osg::State::disableAllVertexArrays
void disableAllVertexArrays()
osg::State::_readBuffer
GLenum _readBuffer
Definition State:1100
osg::State::setShaderCompositionEnabled
void setShaderCompositionEnabled(bool flag)
Definition State:156
osg::State::getUniformLocation
GLint getUniformLocation(unsigned int uniformNameID) const
Definition State:805
osg::State::setFrameStamp
void setFrameStamp(FrameStamp *fs)
Definition State:827
osg::State::AttributeMap
std::map< StateAttribute::TypeMemberPair, AttributeStack > AttributeMap
Definition State:1061
osg::State::getMaxTexturePoolSize
unsigned int getMaxTexturePoolSize() const
Definition State:898
osg::State::getAttributeBindingList
const Program::AttribBindingList & getAttributeBindingList()
Definition State:289
osg::State::haveAppliedMode
void haveAppliedMode(ModeMap &modeMap, StateAttribute::GLMode mode)
osg::State::captureCurrentState
void captureCurrentState(StateSet &stateset) const
osg::State::setVertexAttribPointer
void setVertexAttribPointer(unsigned int unit, const Array *array)
Definition State:777
osg::State::_glDisableVertexAttribArray
DisableVertexAttribProc _glDisableVertexAttribArray
Definition State:1395
osg::State::_initialViewMatrix
ref_ptr< const RefMatrix > _initialViewMatrix
Definition State:1103
osg::State::dirtyAllAttributes
void dirtyAllAttributes()
osg::State::getActiveDisplaySettings
const DisplaySettings * getActiveDisplaySettings() const
Definition State:848
osg::State::_graphicsContext
GraphicsContext * _graphicsContext
Definition State:1085
osg::State::getCurrentVertexArrayState
VertexArrayState * getCurrentVertexArrayState() const
Definition State:547
osg::State::getUniformLocation
GLint getUniformLocation(const std::string &uniformName) const
Definition State:814
osg::State::_startTick
Timer_t _startTick
Definition State:1409
osg::State::setTexCoordAliasList
void setTexCoordAliasList(const VertexAttribAliasList &aliasList)
Definition State:284
osg::State::_contextID
unsigned int _contextID
Definition State:1086
osg::State::_glSecondaryColorPointer
SecondaryColorPointerProc _glSecondaryColorPointer
Definition State:1390
osg::State::haveAppliedTextureMode
void haveAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode)
osg::State::_glMaxTextureCoords
GLint _glMaxTextureCoords
Definition State:1382
osg::State::disableSecondaryColorPointer
void disableSecondaryColorPointer()
Definition State:742
osg::State::useVertexArrayObject
bool useVertexArrayObject(bool useVAO) const
Definition State:793
osg::State::StateSetStack
std::vector< const StateSet * > StateSetStack
Definition State:204
osg::State::_isFogCoordSupported
bool _isFogCoordSupported
Definition State:1359
osg::State::ModeMap
std::map< StateAttribute::GLMode, ModeStack > ModeMap
Definition State:1058
osg::State::_modelViewMatrixUniform
ref_ptr< Uniform > _modelViewMatrixUniform
Definition State:1109
osg::State::ExtensionMap
std::map< const std::type_info *, osg::ref_ptr< osg::Referenced > > ExtensionMap
Definition State:118
osg::State::setInitialViewMatrix
void setInitialViewMatrix(const osg::RefMatrix *matrix)
osg::State::print
void print(std::ostream &fout) const
osg::State::getStateSetStackSize
unsigned int getStateSetStackSize()
Definition State:199
osg::State::_displaySettings
ref_ptr< DisplaySettings > _displaySettings
Definition State:1116
osg::State::_modeMap
ModeMap _modeMap
Definition State:1287
osg::State::unbindVertexArrayObject
void unbindVertexArrayObject()
Definition State:637
osg::State::~State
virtual ~State()
osg::State::_uniformMap
UniformMap _uniformMap
Definition State:1289
osg::State::apply
void apply(const StateSet *dstate)
osg::State::getClientActiveTextureUnit
unsigned int getClientActiveTextureUnit() const
osg::State::getUniformMap
const UniformMap & getUniformMap() const
Definition State:1071
osg::State::haveAppliedTextureAttribute
void haveAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type, unsigned int member=0)
osg::State::BindBufferProc
void(GL_APIENTRY * BindBufferProc)(GLenum target, GLuint buffer)
Definition State:1376
osg::State::getShaderComposer
const ShaderComposer * getShaderComposer() const
Definition State:168
osg::State::set
void set(T *ptr)
Definition State:149
osg::State::getCurrentPixelBufferObject
const GLBufferObject * getCurrentPixelBufferObject() const
Definition State:581
osg::State::UniformMap
std::map< std::string, UniformStack > UniformMap
Definition State:1064
osg::State::CheckForGLErrors
CheckForGLErrors
Definition State:905
osg::State::ONCE_PER_ATTRIBUTE
@ ONCE_PER_ATTRIBUTE
Definition State:916
osg::State::NEVER_CHECK_GL_ERRORS
@ NEVER_CHECK_GL_ERRORS
Definition State:908
osg::State::ONCE_PER_FRAME
@ ONCE_PER_FRAME
Definition State:912
osg::State::getTexCoordAliasList
const VertexAttribAliasList & getTexCoordAliasList()
Definition State:285
osg::State::pushStateSet
void pushStateSet(const StateSet *dstate)
osg::State::setNormalPointer
void setNormalPointer(const Array *array)
Definition State:732
osg::State::setGlobalDefaultModeValue
void setGlobalDefaultModeValue(StateAttribute::GLMode mode, bool enabled)
Definition State:330
osg::State::glDrawElementsInstanced
void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
Definition State:654
osg::State::getGraphicsCostEstimator
const GraphicsCostEstimator * getGraphicsCostEstimator() const
Definition State:946
osg::State::_forceVertexBufferObject
bool _forceVertexBufferObject
Definition State:1362
osg::State::_glVertexAttrib4f
VertexAttrib4fProc _glVertexAttrib4f
Definition State:1387
osg::State::setStartTick
void setStartTick(Timer_t tick)
Definition State:955
osg::State::applyModeListOnTexUnit
void applyModeListOnTexUnit(unsigned int unit, ModeMap &modeMap, const StateSet::ModeList &modeList)
Definition State:1729
osg::State::_glDrawArraysInstanced
DrawArraysInstancedProc _glDrawArraysInstanced
Definition State:1397
osg::State::_graphicsCostEstimator
osg::ref_ptr< GraphicsCostEstimator > _graphicsCostEstimator
Definition State:1407
osg::State::_checkGLErrors
CheckForGLErrors _checkGLErrors
Definition State:1119
osg::State::apply
void apply()
osg::State::_textureModeMapList
TextureModeMapList _textureModeMapList
Definition State:1292
osg::State::getFrameStamp
const FrameStamp * getFrameStamp() const
Definition State:833
osg::State::setModeValidity
void setModeValidity(StateAttribute::GLMode mode, bool valid)
Definition State:316
osg::State::ActiveTextureProc
void(GL_APIENTRY * ActiveTextureProc)(GLenum texture)
Definition State:1365
osg::State::getProjectionMatrixUniform
osg::Uniform * getProjectionMatrixUniform()
Definition State:247
osg::State::_gpuTimestamp
GLuint64 _gpuTimestamp
Definition State:1411
osg::State::_dynamicObjectCount
unsigned int _dynamicObjectCount
Definition State:1402
osg::State::setCurrentElementBufferObject
void setCurrentElementBufferObject(osg::GLBufferObject *ebo)
Definition State:573
osg::State::_globalVertexArrayState
osg::ref_ptr< VertexArrayState > _globalVertexArrayState
Definition State:1088
osg::State::TextureAttributeMapList
std::vector< AttributeMap > TextureAttributeMapList
Definition State:1062
osg::State::getDefineMap
const DefineMap & getDefineMap() const
Definition State:1073
osg::State::_drawBuffer
GLenum _drawBuffer
Definition State:1099
osg::State::disableColorPointer
void disableColorPointer()
Definition State:738
osg::State::_vas
VertexArrayState * _vas
Definition State:1089
osg::State::setSecondaryColorAlias
void setSecondaryColorAlias(const VertexAttribAlias &alias)
Definition State:276
osg::State::_isSecondaryColorSupported
bool _isSecondaryColorSupported
Definition State:1358
osg::State::_currentVAO
GLuint _currentVAO
Definition State:1307
osg::State::_arrayDispatchers
AttributeDispatchers _arrayDispatchers
Definition State:1405
osg::State::setFogCoordPointer
void setFogCoordPointer(const Array *array)
Definition State:745
osg::State::applyGlobalDefaultAttribute
bool applyGlobalDefaultAttribute(AttributeStack &as)
Definition State:1237
osg::State::getStateSetStack
StateSetStack & getStateSetStack()
Definition State:207
osg::State::setDisplaySettings
void setDisplaySettings(DisplaySettings *vs)
Definition State:839
osg::State::getShaderCompositionEnabled
bool getShaderCompositionEnabled() const
Definition State:159
osg::State::getLastAppliedModeValue
bool getLastAppliedModeValue(StateAttribute::GLMode mode)
Definition State:341
osg::State::getLastAppliedTextureMode
bool getLastAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode) const
osg::State::Color
void Color(float r, float g, float b, float a=1.0f)
Definition State:671
osg::State::applyModeOnTexUnit
bool applyModeOnTexUnit(unsigned int unit, StateAttribute::GLMode mode, bool enabled, ModeStack &ms)
Definition State:1160
osg::State::_extensionProcsInitialized
bool _extensionProcsInitialized
Definition State:1381
osg::State::_forceVertexArrayObject
bool _forceVertexArrayObject
Definition State:1363
osg::State::_maxBufferObjectPoolSize
unsigned int _maxBufferObjectPoolSize
Definition State:1300
osg::State::setMaxBufferObjectPoolSize
void setMaxBufferObjectPoolSize(unsigned int size)
osg::State::applyAttributeList
void applyAttributeList(AttributeMap &attributeMap, const StateSet::AttributeList &attributeList)
Definition State:1851
osg::State::disableTexCoordPointersAboveAndIncluding
void disableTexCoordPointersAboveAndIncluding(unsigned int unit)
Definition State:752
osg::State::getGraphicsCostEstimator
GraphicsCostEstimator * getGraphicsCostEstimator()
Definition State:943
osg::State::_normalMatrixUniform
ref_ptr< Uniform > _normalMatrixUniform
Definition State:1112
osg::State::bindDrawIndirectBufferObject
void bindDrawIndirectBufferObject(osg::GLBufferObject *ibo)
Definition State:609
osg::State::getVertexAlias
const VertexAttribAlias & getVertexAlias()
Definition State:265
osg::State::getSecondaryColorAlias
const VertexAttribAlias & getSecondaryColorAlias()
Definition State:277
osg::State::getCurrentVertexArrayObject
GLuint getCurrentVertexArrayObject() const
Definition State:631
osg::State::get
const T * get() const
Definition State:139
osg::State::dirtyAllModes
void dirtyAllModes()
osg::State::haveAppliedMode
void haveAppliedMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
osg::State::applyTextureAttribute
bool applyTextureAttribute(unsigned int unit, const StateAttribute *attribute)
Definition State:466
osg::State::_currentClientActiveTextureUnit
unsigned int _currentClientActiveTextureUnit
Definition State:1304
osg::State::_currentShaderCompositionProgram
osg::Program * _currentShaderCompositionProgram
Definition State:1094
osg::State::_glVertexAttribIPointer
VertexAttribIPointerProc _glVertexAttribIPointer
Definition State:1392
osg::State::disableTexCoordPointer
void disableTexCoordPointer(unsigned int unit)
Definition State:751
osg::State::drawQuads
void drawQuads(GLint first, GLsizei count, GLsizei primCount=0)
osg::State::getCurrentViewport
const Viewport * getCurrentViewport() const
Definition State:219
osg::State::isFogCoordSupported
bool isFogCoordSupported() const
Definition State:744
osg::State::Vertex
void Vertex(float x, float y, float z, float w=1.0f)
Definition State:661
osg::State::applyMode
bool applyMode(StateAttribute::GLMode mode, bool enabled)
Definition State:395
osg::State::isSecondaryColorSupported
bool isSecondaryColorSupported() const
Definition State:740
osg::State::setSecondaryColorPointer
void setSecondaryColorPointer(const Array *array)
Definition State:741
osg::State::getModeMap
const ModeMap & getModeMap() const
Definition State:1069
osg::State::_extensionMap
ExtensionMap _extensionMap
Definition State:119
osg::State::getDynamicObjectCount
unsigned int getDynamicObjectCount() const
Definition State:884
osg::State::AttributeVec
std::vector< AttributePair > AttributeVec
Definition State:818
osg::State::_normalAlias
VertexAttribAlias _normalAlias
Definition State:1124
osg::State::setFogCoordAlias
void setFogCoordAlias(const VertexAttribAlias &alias)
Definition State:280
osg::State::setUseModelViewAndProjectionUniforms
void setUseModelViewAndProjectionUniforms(bool flag)
Definition State:239
osg::State::applyAttribute
bool applyAttribute(const StateAttribute *attribute)
Definition State:444
osg::State::getFogCoordAlias
const VertexAttribAlias & getFogCoordAlias()
Definition State:281
osg::State::disableVertexPointer
void disableVertexPointer()
Definition State:729
osg::State::applyProjectionMatrix
void applyProjectionMatrix(const osg::RefMatrix *matrix)
osg::State::_completeDynamicObjectRenderingCallback
osg::ref_ptr< DynamicObjectRenderingCompletedCallback > _completeDynamicObjectRenderingCallback
Definition State:1403
osg::State::getDynamicObjectRenderingCompletedCallback
DynamicObjectRenderingCompletedCallback * getDynamicObjectRenderingCompletedCallback()
Definition State:868
osg::State::disableNormalPointer
void disableNormalPointer()
Definition State:734
osg::State::applyDefineList
void applyDefineList(DefineMap &uniformMap, const StateSet::DefineList &defineList)
Definition State:2161
osg::State::setActiveTextureUnit
bool setActiveTextureUnit(unsigned int unit)
Definition State:2345
osg::State::FogCoordPointerProc
void(GL_APIENTRY * FogCoordPointerProc)(GLenum type, GLsizei stride, const GLvoid *pointer)
Definition State:1366
osg::State::pushModeList
void pushModeList(ModeMap &modeMap, const StateSet::ModeList &modeList)
Definition State:1415
osg::State::getGlobalDefaultAttribute
const StateAttribute * getGlobalDefaultAttribute(StateAttribute::Type type, unsigned int member=0)
Definition State:437
osg::State::setShaderComposer
void setShaderComposer(ShaderComposer *sc)
Definition State:162
osg::State::getModelViewProjectionMatrixUniform
osg::Uniform * getModelViewProjectionMatrixUniform()
Definition State:248
osg::State::setGpuTimestamp
void setGpuTimestamp(Timer_t tick, GLuint64 timestamp)
Definition State:964
osg::State::setCurrentVertexBufferObject
void setCurrentVertexBufferObject(osg::GLBufferObject *vbo)
Definition State:567
osg::State::isVertexArrayObjectSupported
bool isVertexArrayObjectSupported() const
Definition State:792
osg::State::applyTextureMode
bool applyTextureMode(unsigned int unit, StateAttribute::GLMode mode, bool enabled)
Definition State:416
osg::State::getInitialViewMatrix
const osg::Matrix & getInitialViewMatrix() const
Definition State:227
osg::State::_currentActiveTextureUnit
unsigned int _currentActiveTextureUnit
Definition State:1303
osg::State::_glVertexAttribLPointer
VertexAttribLPointerProc _glVertexAttribLPointer
Definition State:1393
osg::State::setDynamicObjectRenderingCompletedCallback
void setDynamicObjectRenderingCompletedCallback(DynamicObjectRenderingCompletedCallback *cb)
Definition State:865
osg::State::getColorAlias
const VertexAttribAlias & getColorAlias()
Definition State:273
osg::State::getGpuTime
double getGpuTime() const
Definition State:958
osg::State::getAttributeMap
const AttributeMap & getAttributeMap() const
Definition State:1070
osg::State::initializeExtensionProcs
void initializeExtensionProcs()
osg::State::_glMultiTexCoord4f
MultiTexCoord4fProc _glMultiTexCoord4f
Definition State:1386
osg::State::_currentShaderCompositionUniformList
StateSet::UniformList _currentShaderCompositionUniformList
Definition State:1095
osg::State::bindVertexArrayObject
void bindVertexArrayObject(const VertexArrayState *vas)
Definition State:633
osg::State::getMaxTextureCoords
GLint getMaxTextureCoords() const
For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS.
Definition State:755
osg::State::setDynamicObjectCount
void setDynamicObjectCount(unsigned int count, bool callCallbackOnZero=false)
Definition State:871
osg::State::applyDisablingOfVertexAttributes
void applyDisablingOfVertexAttributes()
Definition State:565
osg::State::_maxTexturePoolSize
unsigned int _maxTexturePoolSize
Definition State:1299
osg::State::setNormalAlias
void setNormalAlias(const VertexAttribAlias &alias)
Definition State:268
osg::State::setUseVertexAttributeAliasing
void setUseVertexAttributeAliasing(bool flag)
osg::State::resetVertexAttributeAlias
void resetVertexAttributeAlias(bool compactAliasing=true, unsigned int numTextureUnits=8)
osg::State::checkGLErrors
bool checkGLErrors(const char *str1=0, const char *str2=0) const
osg::State::glDrawBuffer
void glDrawBuffer(GLenum buffer)
osg::State::bindElementBufferObject
void bindElementBufferObject(osg::GLBufferObject *ebo)
Definition State:576
osg::State::convertVertexShaderSourceToOsgBuiltIns
bool convertVertexShaderSourceToOsgBuiltIns(std::string &source) const
osg::State::setInterleavedArrays
void setInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer)
Definition State:724
osg::Timer::instance
static Timer * instance()
osg::Timer::delta_s
double delta_s(Timer_t t1, Timer_t t2) const
Definition Timer:59
osg::Uniform
Definition Uniform:414
osg::VertexArrayState
Definition VertexArrayState:25
osg::VertexArrayState::getVertexArrayObject
GLuint getVertexArrayObject() const
Definition VertexArrayState:173
osg::VertexAttribAlias
Definition GLExtensions:135
osg::Viewport
Definition Viewport:24
osg::ref_ptr
Definition ref_ptr:32
osg::ref_ptr::get
T * get() const
Definition ref_ptr:117
osg
Definition AlphaFunc:19
osg::Matrix
Matrixd Matrix
Definition Matrix:27
osg::maximum
T maximum(T lhs, T rhs)
Definition Math:85
osg::Timer_t
unsigned long long Timer_t
Definition Timer:24
osg::RefMatrix
RefMatrixd RefMatrix
Definition Matrix:28
osg::ShaderDefines
std::set< std::string > ShaderDefines
Definition Shader:37
Export
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39
osg::State::ApplyModeProxy::~ApplyModeProxy
~ApplyModeProxy()
Definition State:355
osg::State::ApplyModeProxy::ApplyModeProxy
ApplyModeProxy(osg::State &state, GLenum mode, bool value)
Definition State:349
osg::State::ApplyModeProxy::_need_to_apply_value
bool _need_to_apply_value
Definition State:363
osg::State::ApplyModeProxy::_state
osg::State & _state
Definition State:360
osg::State::ApplyModeProxy::_mode
GLenum _mode
Definition State:361
osg::State::ApplyModeProxy::_previous_value
bool _previous_value
Definition State:362
osg::State::ApplyTextureModeProxy::_previous_value
bool _previous_value
Definition State:382
osg::State::ApplyTextureModeProxy::_state
osg::State & _state
Definition State:379
osg::State::ApplyTextureModeProxy::_mode
GLenum _mode
Definition State:381
osg::State::ApplyTextureModeProxy::_need_to_apply_value
bool _need_to_apply_value
Definition State:383
osg::State::ApplyTextureModeProxy::ApplyTextureModeProxy
ApplyTextureModeProxy(osg::State &state, unsigned int unit, GLenum mode, bool value)
Definition State:368
osg::State::ApplyTextureModeProxy::~ApplyTextureModeProxy
~ApplyTextureModeProxy()
Definition State:374
osg::State::ApplyTextureModeProxy::_unit
unsigned int _unit
Definition State:380
osg::State::AttributeStack
Definition State:998
osg::State::AttributeStack::last_applied_shadercomponent
const ShaderComponent * last_applied_shadercomponent
Definition State:1013
osg::State::AttributeStack::AttributeStack
AttributeStack()
Definition State:999
osg::State::AttributeStack::changed
bool changed
Definition State:1011
osg::State::AttributeStack::attributeVec
AttributeVec attributeVec
Definition State:1015
osg::State::AttributeStack::last_applied_attribute
const StateAttribute * last_applied_attribute
Definition State:1012
osg::State::AttributeStack::print
void print(std::ostream &fout) const
osg::State::AttributeStack::global_default_attribute
ref_ptr< const StateAttribute > global_default_attribute
Definition State:1014
osg::State::DefineMap
Definition State:1045
osg::State::DefineMap::changed
bool changed
Definition State:1051
osg::State::DefineMap::updateCurrentDefines
bool updateCurrentDefines()
osg::State::DefineMap::DefineStackMap
std::map< std::string, DefineStack > DefineStackMap
Definition State:1049
osg::State::DefineMap::map
DefineStackMap map
Definition State:1050
osg::State::DefineMap::currentDefines
StateSet::DefineList currentDefines
Definition State:1052
osg::State::DefineMap::DefineMap
DefineMap()
Definition State:1046
osg::State::DefineStack
Definition State:1032
osg::State::DefineStack::DefineStack
DefineStack()
Definition State:1035
osg::State::DefineStack::print
void print(std::ostream &fout) const
osg::State::DefineStack::DefineVec
std::vector< StateSet::DefinePair > DefineVec
Definition State:1033
osg::State::DefineStack::defineVec
DefineVec defineVec
Definition State:1041
osg::State::DefineStack::changed
bool changed
Definition State:1040
osg::State::DynamicObjectRenderingCompletedCallback
Definition State:860
osg::State::DynamicObjectRenderingCompletedCallback::completed
virtual void completed(osg::State *)=0
osg::State::ModeStack
Definition State:977
osg::State::ModeStack::valid
bool valid
Definition State:990
osg::State::ModeStack::ValueVec
std::vector< StateAttribute::GLModeValue > ValueVec
Definition State:978
osg::State::ModeStack::changed
bool changed
Definition State:991
osg::State::ModeStack::valueVec
ValueVec valueVec
Definition State:994
osg::State::ModeStack::global_default_value
bool global_default_value
Definition State:993
osg::State::ModeStack::last_applied_value
bool last_applied_value
Definition State:992
osg::State::ModeStack::print
void print(std::ostream &fout) const
osg::State::ModeStack::ModeStack
ModeStack()
Definition State:980
osg::State::SetCurrentVertexArrayStateProxy::~SetCurrentVertexArrayStateProxy
~SetCurrentVertexArrayStateProxy()
Definition State:539
osg::State::SetCurrentVertexArrayStateProxy::SetCurrentVertexArrayStateProxy
SetCurrentVertexArrayStateProxy(osg::State &state, VertexArrayState *vas)
Definition State:538
osg::State::SetCurrentVertexArrayStateProxy::_state
osg::State & _state
Definition State:540
osg::State::UniformStack
Definition State:1020
osg::State::UniformStack::uniformVec
UniformVec uniformVec
Definition State:1028
osg::State::UniformStack::UniformStack
UniformStack()
Definition State:1024
osg::State::UniformStack::UniformVec
std::vector< UniformPair > UniformVec
Definition State:1022
osg::State::UniformStack::UniformPair
std::pair< const Uniform *, StateAttribute::OverrideValue > UniformPair
Definition State:1021
osg::State::UniformStack::print
void print(std::ostream &fout) const