OpenSceneGraph
3.5.1
|
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings, implements lazy state updating and provides accessors for querying the current state. More...
Classes | |
struct | AttributeStack |
struct | DefineMap |
struct | DefineStack |
struct | DynamicObjectRenderingCompletedCallback |
struct | EnabledArrayPair |
struct | ModeStack |
struct | UniformStack |
Public Types | |
enum | CheckForGLErrors { NEVER_CHECK_GL_ERRORS, ONCE_PER_FRAME, ONCE_PER_ATTRIBUTE } |
typedef std::map< const std::type_info *, osg::ref_ptr< osg::Referenced > > | ExtensionMap |
typedef std::vector< const StateSet * > | StateSetStack |
typedef std::vector< VertexAttribAlias > | VertexAttribAliasList |
typedef std::vector< GLushort > | IndicesGLushort |
typedef std::vector< GLuint > | IndicesGLuint |
typedef std::pair< const StateAttribute *, StateAttribute::OverrideValue > | AttributePair |
typedef std::vector< AttributePair > | AttributeVec |
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 |
Public Member Functions | |
State () | |
void | setGraphicsContext (GraphicsContext *context) |
Set the graphics context associated with that owns this State object. More... | |
GraphicsContext * | getGraphicsContext () |
Get the graphics context associated with that owns this State object. More... | |
const GraphicsContext * | getGraphicsContext () const |
Get the const graphics context associated with that owns this State object. More... | |
void | setContextID (unsigned int contextID) |
Set the current OpenGL context uniqueID. More... | |
unsigned int | getContextID () const |
Get the current OpenGL context unique ID. More... | |
template<typename T > | |
T * | get () |
Get a specific GL extensions object or GraphicsObjectManager, initialize if not already present. More... | |
template<typename T > | |
const T * | get () const |
Get a specific GL extensions object or GraphicsObjectManager if it already exists in the extension map. More... | |
template<typename T > | |
void | set (T *ptr) |
Set a specific GL extensions object pr GraphicsObjectManager. More... | |
void | setShaderCompositionEnabled (bool flag) |
bool | getShaderCompositionEnabled () const |
void | setShaderComposer (ShaderComposer *sc) |
Set the ShaderComposor object that implements shader composition. More... | |
ShaderComposer * | getShaderComposer () |
Get the ShaderComposor object. More... | |
const ShaderComposer * | getShaderComposer () const |
Get the const ShaderComposor object. More... | |
StateSet::UniformList & | getCurrentShaderCompositionUniformList () |
Get the unform list in which to inject any uniforms that StateAttribute::apply(State&) methods provide. More... | |
void | applyShaderCompositionUniform (const osg::Uniform *uniform, StateAttribute::OverrideValue value=StateAttribute::ON) |
Convenience method for StateAttribute:::apply(State&) methods to pass on their uniforms to osg::State so it can apply them at the appropriate point. More... | |
void | pushStateSet (const StateSet *dstate) |
Push stateset onto state stack. More... | |
void | popStateSet () |
Pop stateset off state stack. More... | |
void | popAllStateSets () |
pop all statesets off state stack, ensuring it is empty ready for the next frame. More... | |
void | insertStateSet (unsigned int pos, const StateSet *dstate) |
Insert stateset onto state stack. More... | |
void | removeStateSet (unsigned int pos) |
Pop stateset off state stack. More... | |
unsigned int | getStateSetStackSize () |
Get the number of StateSet's on the StateSet stack. More... | |
void | popStateSetStackToSize (unsigned int size) |
Pop StateSet's for the StateSet stack till its size equals the specified size. More... | |
StateSetStack & | getStateSetStack () |
Get the StateSet stack. More... | |
void | captureCurrentState (StateSet &stateset) const |
Copy the modes and attributes which capture the current state. More... | |
void | releaseGLObjects () |
Release all OpenGL objects associated cached by this osg::State object. More... | |
void | reset () |
reset the state object to an empty stack. More... | |
const Viewport * | getCurrentViewport () const |
void | setInitialViewMatrix (const osg::RefMatrix *matrix) |
const osg::Matrix & | getInitialViewMatrix () const |
const osg::Matrix & | getInitialInverseViewMatrix () const |
void | applyProjectionMatrix (const osg::RefMatrix *matrix) |
const osg::Matrix & | getProjectionMatrix () const |
void | applyModelViewMatrix (const osg::RefMatrix *matrix) |
void | applyModelViewMatrix (const osg::Matrix &) |
const osg::Matrix & | getModelViewMatrix () const |
void | setUseModelViewAndProjectionUniforms (bool flag) |
bool | getUseModelViewAndProjectionUniforms () const |
void | updateModelViewAndProjectionMatrixUniforms () |
void | applyModelViewAndProjectionUniformsIfRequired () |
osg::Uniform * | getModelViewMatrixUniform () |
osg::Uniform * | getProjectionMatrixUniform () |
osg::Uniform * | getModelViewProjectionMatrixUniform () |
osg::Uniform * | getNormalMatrixUniform () |
Polytope | getViewFrustum () const |
void | setUseVertexAttributeAliasing (bool flag) |
bool | getUseVertexAttributeAliasing () const |
void | resetVertexAttributeAlias (bool compactAliasing=true, unsigned int numTextureUnits=8) |
Reset the vertex attribute aliasing to osg's default. More... | |
void | setVertexAlias (const VertexAttribAlias &alias) |
Set the vertex attribute aliasing for "vertex". More... | |
const VertexAttribAlias & | getVertexAlias () |
void | setNormalAlias (const VertexAttribAlias &alias) |
Set the vertex attribute aliasing for "normal". More... | |
const VertexAttribAlias & | getNormalAlias () |
void | setColorAlias (const VertexAttribAlias &alias) |
Set the vertex attribute aliasing for "color". More... | |
const VertexAttribAlias & | getColorAlias () |
void | setSecondaryColorAlias (const VertexAttribAlias &alias) |
Set the vertex attribute aliasing for "secondary color". More... | |
const VertexAttribAlias & | getSecondaryColorAlias () |
void | setFogCoordAlias (const VertexAttribAlias &alias) |
Set the vertex attribute aliasing for "fog coord". More... | |
const VertexAttribAlias & | getFogCoordAlias () |
void | setTexCoordAliasList (const VertexAttribAliasList &aliasList) |
Set the vertex attribute aliasing list for texture coordinates. More... | |
const VertexAttribAliasList & | getTexCoordAliasList () |
void | setAttributeBindingList (const Program::AttribBindingList &attribBindingList) |
Set the vertex attribute binding list. More... | |
const Program::AttribBindingList & | getAttributeBindingList () |
bool | convertVertexShaderSourceToOsgBuiltIns (std::string &source) const |
void | apply (const StateSet *dstate) |
Apply stateset. More... | |
void | apply () |
Updates the OpenGL state so that it matches the StateSet at the top of the stack of StateSet s maintained internally by a State . More... | |
void | applyShaderComposition () |
Apply any shader composed state. More... | |
void | setModeValidity (StateAttribute::GLMode mode, bool valid) |
Set whether a particular OpenGL mode is valid in the current graphics context. More... | |
bool | getModeValidity (StateAttribute::GLMode mode) |
Get whether a particular OpenGL mode is valid in the current graphics context. More... | |
void | setGlobalDefaultModeValue (StateAttribute::GLMode mode, bool enabled) |
bool | getGlobalDefaultModeValue (StateAttribute::GLMode mode) |
bool | applyMode (StateAttribute::GLMode mode, bool enabled) |
Apply an OpenGL mode if required. More... | |
void | setGlobalDefaultTextureModeValue (unsigned int unit, StateAttribute::GLMode mode, bool enabled) |
bool | getGlobalDefaultTextureModeValue (unsigned int unit, StateAttribute::GLMode mode) |
bool | applyTextureMode (unsigned int unit, StateAttribute::GLMode mode, bool enabled) |
void | setGlobalDefaultAttribute (const StateAttribute *attribute) |
const StateAttribute * | getGlobalDefaultAttribute (StateAttribute::Type type, unsigned int member=0) |
bool | applyAttribute (const StateAttribute *attribute) |
Apply an attribute if required. More... | |
void | setGlobalDefaultTextureAttribute (unsigned int unit, const StateAttribute *attribute) |
const StateAttribute * | getGlobalDefaultTextureAttribute (unsigned int unit, StateAttribute::Type type, unsigned int member=0) |
bool | applyTextureAttribute (unsigned int unit, const StateAttribute *attribute) |
void | haveAppliedMode (StateAttribute::GLMode mode, StateAttribute::GLModeValue value) |
Mode has been set externally, update state to reflect this setting. More... | |
void | haveAppliedMode (StateAttribute::GLMode mode) |
Mode has been set externally, therefore dirty the associated mode in osg::State so it is applied on next call to osg::State::apply(..) More... | |
void | haveAppliedAttribute (const StateAttribute *attribute) |
Attribute has been applied externally, update state to reflect this setting. More... | |
void | haveAppliedAttribute (StateAttribute::Type type, unsigned int member=0) |
Attribute has been applied externally, and therefore this attribute type has been dirtied and will need to be re-applied on next osg::State.apply(..). More... | |
bool | getLastAppliedMode (StateAttribute::GLMode mode) const |
Get whether the current specified mode is enabled (true) or disabled (false). More... | |
const StateAttribute * | getLastAppliedAttribute (StateAttribute::Type type, unsigned int member=0) const |
Get the current specified attribute, return NULL if one has not yet been applied. More... | |
void | haveAppliedTextureMode (unsigned int unit, StateAttribute::GLMode mode, StateAttribute::GLModeValue value) |
texture Mode has been set externally, update state to reflect this setting. More... | |
void | haveAppliedTextureMode (unsigned int unit, StateAttribute::GLMode mode) |
texture Mode has been set externally, therefore dirty the associated mode in osg::State so it is applied on next call to osg::State::apply(..) More... | |
void | haveAppliedTextureAttribute (unsigned int unit, const StateAttribute *attribute) |
texture Attribute has been applied externally, update state to reflect this setting. More... | |
void | haveAppliedTextureAttribute (unsigned int unit, StateAttribute::Type type, unsigned int member=0) |
texture Attribute has been applied externally, and therefore this attribute type has been dirtied and will need to be re-applied on next osg::State.apply(..). More... | |
bool | getLastAppliedTextureMode (unsigned int unit, StateAttribute::GLMode mode) const |
Get whether the current specified texture mode is enabled (true) or disabled (false). More... | |
const StateAttribute * | getLastAppliedTextureAttribute (unsigned int unit, StateAttribute::Type type, unsigned int member=0) const |
Get the current specified texture attribute, return NULL if one has not yet been applied. More... | |
void | dirtyAllModes () |
Dirty the modes previously applied in osg::State. More... | |
void | dirtyAllAttributes () |
Dirty the modes attributes previously applied in osg::State. More... | |
void | disableAllVertexArrays () |
disable the vertex, normal, color, tex coords, secondary color, fog coord and index arrays. More... | |
void | dirtyAllVertexArrays () |
dirty the vertex, normal, color, tex coords, secondary color, fog coord and index arrays. More... | |
void | setCurrentVertexBufferObject (osg::GLBufferObject *vbo) |
const GLBufferObject * | getCurrentVertexBufferObject () |
void | bindVertexBufferObject (osg::GLBufferObject *vbo) |
void | unbindVertexBufferObject () |
void | setCurrentElementBufferObject (osg::GLBufferObject *ebo) |
const GLBufferObject * | getCurrentElementBufferObject () |
void | bindElementBufferObject (osg::GLBufferObject *ebo) |
void | unbindElementBufferObject () |
void | setCurrentPixelBufferObject (osg::GLBufferObject *pbo) |
const GLBufferObject * | getCurrentPixelBufferObject () |
void | bindPixelBufferObject (osg::GLBufferObject *pbo) |
void | unbindPixelBufferObject () |
void | drawQuads (GLint first, GLsizei count, GLsizei primCount=0) |
void | glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount) |
void | glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount) |
void | Vertex (float x, float y, float z, float w=1.0f) |
void | Color (float r, float g, float b, float a=1.0f) |
void | Normal (float x, float y, float z) |
void | TexCoord (float x, float y=0.0f, float z=0.0f, float w=1.0f) |
void | MultiTexCoord (unsigned int unit, float x, float y=0.0f, float z=0.0f, float w=1.0f) |
void | VerteAttrib (unsigned int location, float x, float y=0.0f, float z=0.0f, float w=0.0f) |
void | lazyDisablingOfVertexAttributes () |
Mark all the vertex attributes as being disabled but leave the disabling till a later call to applyDisablingOfVertexAttributes. More... | |
void | applyDisablingOfVertexAttributes () |
Disable all the vertex attributes that have been marked as to be disabled. More... | |
void | setInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer) |
Wrapper around glInterleavedArrays(..). More... | |
void | setVertexPointer (const Array *array) |
Set the vertex pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE) |
wrapper around glEnableClientState(GL_VERTEX_ARRAY);glVertexPointer(..); note, only updates values that change. More... | |
void | disableVertexPointer () |
wrapper around glDisableClientState(GL_VERTEX_ARRAY). More... | |
void | dirtyVertexPointer () |
void | setNormalPointer (const Array *array) |
Set the normal pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setNormalPointer (GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE) |
wrapper around glEnableClientState(GL_NORMAL_ARRAY);glNormalPointer(..); note, only updates values that change. More... | |
void | disableNormalPointer () |
wrapper around glDisableClientState(GL_NORMAL_ARRAY); note, only updates values that change. More... | |
void | dirtyNormalPointer () |
void | setColorPointer (const Array *array) |
Set the color pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_TRUE) |
wrapper around glEnableClientState(GL_COLOR_ARRAY);glColorPointer(..); note, only updates values that change. More... | |
void | disableColorPointer () |
wrapper around glDisableClientState(GL_COLOR_ARRAY); note, only updates values that change. More... | |
void | dirtyColorPointer () |
bool | isSecondaryColorSupported () const |
void | setSecondaryColorPointer (const Array *array) |
Set the secondary color pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_TRUE) |
wrapper around glEnableClientState(GL_SECONDARY_COLOR_ARRAY);glSecondayColorPointer(..); note, only updates values that change. More... | |
void | disableSecondaryColorPointer () |
wrapper around glDisableClientState(GL_SECONDARY_COLOR_ARRAY); note, only updates values that change. More... | |
void | dirtySecondaryColorPointer () |
bool | isFogCoordSupported () const |
void | setFogCoordPointer (const Array *array) |
Set the fog coord pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE) |
wrapper around glEnableClientState(GL_FOG_COORDINATE_ARRAY);glFogCoordPointer(..); note, only updates values that change. More... | |
void | disableFogCoordPointer () |
wrapper around glDisableClientState(GL_FOG_COORDINATE_ARRAY); note, only updates values that change. More... | |
void | dirtyFogCoordPointer () |
void | setTexCoordPointer (unsigned int unit, const Array *array) |
Set the tex coord pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setTexCoordPointer (unsigned int unit, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE) |
wrapper around glEnableClientState(GL_TEXTURE_COORD_ARRAY);glTexCoordPointer(..); note, only updates values that change. More... | |
void | disableTexCoordPointer (unsigned int unit) |
wrapper around glDisableClientState(GL_TEXTURE_COORD_ARRAY); note, only updates values that change. More... | |
void | dirtyTexCoordPointer (unsigned int unit) |
void | disableTexCoordPointersAboveAndIncluding (unsigned int unit) |
void | dirtyTexCoordPointersAboveAndIncluding (unsigned int unit) |
GLint | getMaxTextureCoords () const |
For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS. More... | |
GLint | getMaxTextureUnits () const |
For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS. More... | |
bool | setActiveTextureUnit (unsigned int unit) |
Set the current texture unit, return true if selected, false if selection failed such as when multi texturing is not supported. More... | |
unsigned int | getActiveTextureUnit () const |
Get the current texture unit. More... | |
bool | setClientActiveTextureUnit (unsigned int unit) |
Set the current tex coord array texture unit, return true if selected, false if selection failed such as when multi texturing is not supported. More... | |
unsigned int | getClientActiveTextureUnit () const |
Get the current tex coord array texture unit. More... | |
void | setVertexAttribPointer (unsigned int unit, const Array *array) |
Set the vertex attrib pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setVertexAttribLPointer (unsigned int unit, const Array *array) |
Set the vertex attrib pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setVertexAttribIPointer (unsigned int unit, const Array *array) |
Set the vertex attrib pointer using an osg::Array, and manage any VBO that are required. More... | |
void | setVertexAttribPointer (unsigned int index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr) |
wrapper around glEnableVertexAttribArrayARB(index);glVertexAttribPointerARB(..); note, only updates values that change. More... | |
void | setVertexAttribIPointer (unsigned int index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) |
wrapper around glEnableVertexAttribArrayARB(index);glVertexAttribIPointer(..); note, only updates values that change. More... | |
void | setVertexAttribLPointer (unsigned int index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) |
wrapper around glEnableVertexAttribArrayARB(index);glVertexAttribLPointer(..); note, only updates values that change. More... | |
void | disableVertexAttribPointer (unsigned int index) |
wrapper around DisableVertexAttribArrayARB(index); note, only updates values that change. More... | |
void | disableVertexAttribPointersAboveAndIncluding (unsigned int index) |
void | dirtyVertexAttribPointer (unsigned int index) |
void | dirtyVertexAttribPointersAboveAndIncluding (unsigned int index) |
bool | isVertexBufferObjectSupported () const |
void | setLastAppliedProgramObject (const Program::PerContextProgram *program) |
const Program::PerContextProgram * | getLastAppliedProgramObject () const |
GLint | getUniformLocation (unsigned int uniformNameID) const |
GLint | getUniformLocation (const std::string &uniformName) const |
Alternative version of getUniformLocation( unsigned int uniformNameID ) retrofited into OSG for backward compatibility with osgCal, after uniform ids were refactored from std::strings to GLints in OSG version 2.9.10. More... | |
GLint | getAttribLocation (const std::string &name) const |
AttributeVec & | getAttributeVec (const osg::StateAttribute *attribute) |
void | setFrameStamp (FrameStamp *fs) |
Set the frame stamp for the current frame. More... | |
FrameStamp * | getFrameStamp () |
Get the frame stamp for the current frame. More... | |
const FrameStamp * | getFrameStamp () const |
Get the const frame stamp for the current frame. More... | |
void | setDisplaySettings (DisplaySettings *vs) |
Set the DisplaySettings. More... | |
const DisplaySettings * | getDisplaySettings () const |
Get the DisplaySettings. More... | |
void | setAbortRenderingPtr (bool *abortPtr) |
Set flag for early termination of the draw traversal. More... | |
bool | getAbortRendering () const |
Get flag for early termination of the draw traversal, if true steps should be taken to complete rendering early. More... | |
void | setDynamicObjectRenderingCompletedCallback (DynamicObjectRenderingCompletedCallback *cb) |
Set the callback to be called when the dynamic object count hits 0. More... | |
DynamicObjectRenderingCompletedCallback * | getDynamicObjectRenderingCompletedCallback () |
Get the callback to be called when the dynamic object count hits 0. More... | |
void | setDynamicObjectCount (unsigned int count, bool callCallbackOnZero=false) |
Set the number of dynamic objects that will be rendered in this graphics context this frame. More... | |
unsigned int | getDynamicObjectCount () const |
Get the number of dynamic objects that will be rendered in this graphics context this frame. More... | |
void | decrementDynamicObjectCount () |
Decrement the number of dynamic objects left to render this frame, and once the count goes to zero call the DynamicObjectRenderingCompletedCallback to inform of completion. More... | |
void | setMaxTexturePoolSize (unsigned int size) |
unsigned int | getMaxTexturePoolSize () const |
void | setMaxBufferObjectPoolSize (unsigned int size) |
unsigned int | getMaxBufferObjectPoolSize () const |
void | setCheckForGLErrors (CheckForGLErrors check) |
Set whether and how often OpenGL errors should be checked for. More... | |
CheckForGLErrors | getCheckForGLErrors () const |
Get whether and how often OpenGL errors should be checked for. More... | |
bool | checkGLErrors (const char *str) const |
bool | checkGLErrors (StateAttribute::GLMode mode) const |
bool | checkGLErrors (const StateAttribute *attribute) const |
void | print (std::ostream &fout) const |
print out the internal details of osg::State - useful for debugging. More... | |
void | initializeExtensionProcs () |
Initialize extension used by osg:::State. More... | |
GLBeginEndAdapter & | getGLBeginEndAdapter () |
Get the GL adapter object used to map OpenGL 1.0 glBegin/glEnd usage to vertex arrays. More... | |
ArrayDispatchers & | getArrayDispatchers () |
Get the helper class for dispatching osg::Arrays as OpenGL attribute data. More... | |
void | setGraphicsCostEstimator (GraphicsCostEstimator *gce) |
Set the helper class that provides applications with estimate on how much different graphics operations will cost. More... | |
GraphicsCostEstimator * | getGraphicsCostEstimator () |
Get the helper class that provides applications with estimate on how much different graphics operations will cost. More... | |
const GraphicsCostEstimator * | getGraphicsCostEstimator () const |
Get the cont helper class that provides applications with estimate on how much different graphics operations will cost. More... | |
Timer_t | getStartTick () const |
Support for synchronizing the system time and the timestamp counter available with ARB_timer_query. More... | |
void | setStartTick (Timer_t tick) |
Timer_t | getGpuTick () const |
double | getGpuTime () const |
GLuint64 | getGpuTimestamp () const |
void | setGpuTimestamp (Timer_t tick, GLuint64 timestamp) |
int | getTimestampBits () const |
void | setTimestampBits (int bits) |
virtual void | frameCompleted () |
called by the GraphicsContext just before GraphicsContext::swapBuffersImplementation(). More... | |
const ModeMap & | getModeMap () const |
const AttributeMap & | getAttributeMap () const |
const UniformMap & | getUniformMap () const |
DefineMap & | getDefineMap () |
const DefineMap & | getDefineMap () const |
const TextureModeMapList & | getTextureModeMapList () const |
const TextureAttributeMapList & | getTextureAttributeMapList () const |
std::string | getDefineString (const osg::ShaderDefines &shaderDefines) |
bool | supportsShaderRequirements (const osg::ShaderDefines &shaderRequirements) |
bool | supportsShaderRequirement (const std::string &shaderRequirement) |
template<> | |
GLExtensions * | get () |
template<> | |
const GLExtensions * | get () const |
template<> | |
void | set (GLExtensions *ptr) |
Public Member Functions inherited from osg::Referenced | |
Referenced () | |
Referenced (bool threadSafeRefUnref) | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
Set whether to use a mutex to ensure ref() and unref() are thread safe. More... | |
bool | getThreadSafeRefUnref () const |
Get whether a mutex is used to ensure ref() and unref() are thread safe. More... | |
OpenThreads::Mutex * | getRefMutex () const |
Get the mutex used to ensure thread safety of ref()/unref(). More... | |
int | ref () const |
Increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
int | unref () const |
Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
int | unref_nodelete () const |
Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
int | referenceCount () const |
Return the number of pointers currently referencing this object. More... | |
ObserverSet * | getObserverSet () const |
Get the ObserverSet if one is attached, otherwise return NULL. More... | |
ObserverSet * | getOrCreateObserverSet () const |
Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More... | |
void | addObserver (Observer *observer) const |
Add a Observer that is observing this object, notify the Observer when this object gets deleted. More... | |
void | removeObserver (Observer *observer) const |
Remove Observer that is observing this object. More... | |
Public Attributes | |
ExtensionMap | _extensionMap |
IndicesGLushort | _quadIndicesGLushort [4] |
IndicesGLuint | _quadIndicesGLuint [4] |
Protected Types | |
typedef std::vector< EnabledArrayPair > | EnabledTexCoordArrayList |
typedef std::vector< EnabledArrayPair > | EnabledVertexAttribArrayList |
typedef GLsizei | stride |
typedef GLsizei const GLvoid * | pointer |
typedef GLenum | type |
typedef GLenum GLsizei | stride |
typedef GLenum GLsizei const GLvoid * | pointer |
typedef GLfloat | x |
typedef GLfloat GLfloat | y |
typedef GLfloat GLfloat GLfloat | z |
typedef GLfloat GLfloat GLfloat 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 GLboolean | normalized |
typedef GLboolean GLsizei | stride |
typedef GLboolean GLsizei const GLvoid * | pointer |
typedef GLsizei | stride |
typedef GLsizei const GLvoid * | pointer |
typedef GLsizei | stride |
typedef GLsizei const GLvoid * | pointer |
typedef 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) |
Protected Member Functions | |
virtual | ~State () |
void | setUpVertexAttribAlias (VertexAttribAlias &alias, GLuint location, const std::string glName, const std::string osgName, const std::string &declaration) |
bool | applyMode (StateAttribute::GLMode mode, bool enabled, ModeStack &ms) |
Apply an OpenGL mode if required, passing in mode, enable flag and appropriate mode stack. More... | |
bool | applyModeOnTexUnit (unsigned int unit, StateAttribute::GLMode mode, bool enabled, ModeStack &ms) |
bool | applyAttribute (const StateAttribute *attribute, AttributeStack &as) |
apply an attribute if required, passing in attribute and appropriate attribute stack More... | |
bool | applyAttributeOnTexUnit (unsigned int unit, const StateAttribute *attribute, AttributeStack &as) |
bool | applyGlobalDefaultAttribute (AttributeStack &as) |
bool | applyGlobalDefaultAttributeOnTexUnit (unsigned int unit, AttributeStack &as) |
ModeMap & | getOrCreateTextureModeMap (unsigned int unit) |
AttributeMap & | getOrCreateTextureAttributeMap (unsigned int unit) |
void | pushModeList (ModeMap &modeMap, const StateSet::ModeList &modeList) |
void | pushAttributeList (AttributeMap &attributeMap, const StateSet::AttributeList &attributeList) |
void | pushUniformList (UniformMap &uniformMap, const StateSet::UniformList &uniformList) |
void | pushDefineList (DefineMap &defineMap, const StateSet::DefineList &defineList) |
void | popModeList (ModeMap &modeMap, const StateSet::ModeList &modeList) |
void | popAttributeList (AttributeMap &attributeMap, const StateSet::AttributeList &attributeList) |
void | popUniformList (UniformMap &uniformMap, const StateSet::UniformList &uniformList) |
void | popDefineList (DefineMap &uniformMap, const StateSet::DefineList &defineList) |
void | applyModeList (ModeMap &modeMap, const StateSet::ModeList &modeList) |
void | applyAttributeList (AttributeMap &attributeMap, const StateSet::AttributeList &attributeList) |
void | applyUniformList (UniformMap &uniformMap, const StateSet::UniformList &uniformList) |
void | applyDefineList (DefineMap &uniformMap, const StateSet::DefineList &defineList) |
void | applyModeMap (ModeMap &modeMap) |
void | applyAttributeMap (AttributeMap &attributeMap) |
void | applyUniformMap (UniformMap &uniformMap) |
void | applyModeListOnTexUnit (unsigned int unit, ModeMap &modeMap, const StateSet::ModeList &modeList) |
void | applyAttributeListOnTexUnit (unsigned int unit, AttributeMap &attributeMap, const StateSet::AttributeList &attributeList) |
void | applyModeMapOnTexUnit (unsigned int unit, ModeMap &modeMap) |
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 | computeSecondaryColorSupported () const |
bool | computeFogCoordSupported () const |
bool | computeVertexBufferObjectSupported () const |
typedef | void (GL_APIENTRY *ActiveTextureProc)(GLenum texture) |
typedef | void (GL_APIENTRY *FogCoordPointerProc)(GLenum type |
typedef | void (GL_APIENTRY *SecondaryColorPointerProc)(GLint size |
typedef | void (GL_APIENTRY *MultiTexCoord4fProc)(GLenum target |
typedef | void (GL_APIENTRY *VertexAttribPointerProc)(unsigned int |
typedef | void (GL_APIENTRY *VertexAttribIPointerProc)(unsigned int |
typedef | void (GL_APIENTRY *VertexAttribLPointerProc)(unsigned int |
typedef | void (GL_APIENTRY *EnableVertexAttribProc)(unsigned int) |
typedef | void (GL_APIENTRY *DisableVertexAttribProc)(unsigned int) |
typedef | void (GL_APIENTRY *BindBufferProc)(GLenum target |
Protected Member Functions inherited from osg::Referenced | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Additional Inherited Members | |
Static Public Member Functions inherited from osg::Referenced | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More... | |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
Set whether reference counting should use a mutex for thread safe reference counting. More... | |
static bool | getThreadSafeReferenceCounting () |
Get whether reference counting is active. More... | |
static void | setDeleteHandler (DeleteHandler *handler) |
Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More... | |
static DeleteHandler * | getDeleteHandler () |
Get a DeleteHandler. More... | |
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings, implements lazy state updating and provides accessors for querying the current state.
The venerable Red Book says that "OpenGL is a state machine", and this class represents the OpenGL state in OSG. Furthermore, State
also has other important features:
pushStateSet()
and popStateSet()
). Manipulating this stack of OpenGL states manually is seldom needed, since OSG does this in the most common situations.glGet*
(), which typically stall the graphics pipeline (see, for instance, captureCurrentState()
and getModelViewMatrix()
). typedef std::map<StateAttribute::TypeMemberPair,AttributeStack> osg::State::AttributeMap |
typedef std::pair<const StateAttribute*,StateAttribute::OverrideValue> osg::State::AttributePair |
typedef std::vector<AttributePair> osg::State::AttributeVec |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
typedef std::map<const std::type_info*, osg::ref_ptr<osg::Referenced> > osg::State::ExtensionMap |
typedef std::vector<GLuint> osg::State::IndicesGLuint |
typedef std::vector<GLushort> osg::State::IndicesGLushort |
typedef std::vector< ref_ptr<const Matrix> > osg::State::MatrixStack |
typedef std::map<StateAttribute::GLMode,ModeStack> osg::State::ModeMap |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
typedef std::vector<const StateSet*> osg::State::StateSetStack |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
typedef std::vector<AttributeMap> osg::State::TextureAttributeMapList |
typedef std::vector<ModeMap> osg::State::TextureModeMapList |
|
protected |
typedef std::map<std::string, UniformStack> osg::State::UniformMap |
|
protected |
|
protected |
typedef std::vector<VertexAttribAlias> osg::State::VertexAttribAliasList |
|
protected |
|
protected |
|
protected |
|
protected |
osg::State::State | ( | ) |
|
protectedvirtual |
void osg::State::apply | ( | ) |
|
inline |
Apply an attribute if required.
|
inlineprotected |
apply an attribute if required, passing in attribute and appropriate attribute stack
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
void osg::State::applyDisablingOfVertexAttributes | ( | ) |
Disable all the vertex attributes that have been marked as to be disabled.
|
inlineprotected |
|
inlineprotected |
|
inline |
Apply an OpenGL mode if required.
This is a wrapper around glEnable()
and glDisable()
, that just actually calls these functions if the enabled
flag is different than the current state.
true
if the state was actually changed. false
otherwise. Notice that a false
return does not indicate an error, it just means that the mode was already set to the same value as the enabled
parameter.
|
inlineprotected |
Apply an OpenGL mode if required, passing in mode, enable flag and appropriate mode stack.
This is a wrapper around glEnable()
and glDisable()
, that just actually calls these functions if the enabled
flag is different than the current state.
true
if the state was actually changed. false
otherwise. Notice that a false
return does not indicate an error, it just means that the mode was already set to the same value as the enabled
parameter.
|
inlineprotected |
|
inlineprotected |
void osg::State::applyModelViewAndProjectionUniformsIfRequired | ( | ) |
void osg::State::applyModelViewMatrix | ( | const osg::RefMatrix * | matrix | ) |
void osg::State::applyModelViewMatrix | ( | const osg::Matrix & | ) |
|
inlineprotected |
void osg::State::applyProjectionMatrix | ( | const osg::RefMatrix * | matrix | ) |
void osg::State::applyShaderComposition | ( | ) |
Apply any shader composed state.
|
inline |
Convenience method for StateAttribute:::apply(State&) methods to pass on their uniforms to osg::State so it can apply them at the appropriate point.
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
Copy the modes and attributes which capture the current state.
bool osg::State::checkGLErrors | ( | const char * | str | ) | const |
bool osg::State::checkGLErrors | ( | StateAttribute::GLMode | mode | ) | const |
bool osg::State::checkGLErrors | ( | const StateAttribute * | attribute | ) | const |
|
inline |
|
protected |
|
protected |
|
protected |
bool osg::State::convertVertexShaderSourceToOsgBuiltIns | ( | std::string & | source | ) | const |
|
inline |
Decrement the number of dynamic objects left to render this frame, and once the count goes to zero call the DynamicObjectRenderingCompletedCallback to inform of completion.
void osg::State::dirtyAllAttributes | ( | ) |
Dirty the modes attributes previously applied in osg::State.
void osg::State::dirtyAllModes | ( | ) |
Dirty the modes previously applied in osg::State.
void osg::State::dirtyAllVertexArrays | ( | ) |
dirty the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void osg::State::disableAllVertexArrays | ( | ) |
disable the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.
|
inline |
wrapper around glDisableClientState(GL_COLOR_ARRAY); note, only updates values that change.
|
inline |
wrapper around glDisableClientState(GL_FOG_COORDINATE_ARRAY); note, only updates values that change.
|
inline |
wrapper around glDisableClientState(GL_NORMAL_ARRAY); note, only updates values that change.
|
inline |
wrapper around glDisableClientState(GL_SECONDARY_COLOR_ARRAY); note, only updates values that change.
|
inline |
wrapper around glDisableClientState(GL_TEXTURE_COORD_ARRAY); note, only updates values that change.
|
inline |
void osg::State::disableVertexAttribPointer | ( | unsigned int | index | ) |
wrapper around DisableVertexAttribArrayARB(index); note, only updates values that change.
void osg::State::disableVertexAttribPointersAboveAndIncluding | ( | unsigned int | index | ) |
|
inline |
wrapper around glDisableClientState(GL_VERTEX_ARRAY).
note, only updates values that change.
|
virtual |
called by the GraphicsContext just before GraphicsContext::swapBuffersImplementation().
|
inline |
Get a specific GL extensions object or GraphicsObjectManager, initialize if not already present.
Note, must only be called from a the graphics context thread associated with this osg::State.
|
inline |
Get a specific GL extensions object or GraphicsObjectManager if it already exists in the extension map.
Note, safe to call outwith a the graphics context thread associated with this osg::State. Returns NULL if the desired extension object has not been created yet.
|
inline |
|
inline |
|
inline |
Get flag for early termination of the draw traversal, if true steps should be taken to complete rendering early.
|
inline |
Get the current texture unit.
|
inline |
Get the helper class for dispatching osg::Arrays as OpenGL attribute data.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get whether and how often OpenGL errors should be checked for.
|
inline |
Get the current tex coord array texture unit.
|
inline |
|
inline |
Get the current OpenGL context unique ID.
|
inline |
|
inline |
|
inline |
Get the unform list in which to inject any uniforms that StateAttribute::apply(State&) methods provide.
|
inline |
|
inline |
|
inline |
|
inline |
std::string osg::State::getDefineString | ( | const osg::ShaderDefines & | shaderDefines | ) |
|
inline |
Get the DisplaySettings.
|
inline |
Get the number of dynamic objects that will be rendered in this graphics context this frame.
|
inline |
Get the callback to be called when the dynamic object count hits 0.
|
inline |
|
inline |
Get the frame stamp for the current frame.
|
inline |
Get the const frame stamp for the current frame.
|
inline |
Get the GL adapter object used to map OpenGL 1.0 glBegin/glEnd usage to vertex arrays.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the graphics context associated with that owns this State object.
|
inline |
Get the const graphics context associated with that owns this State object.
|
inline |
Get the helper class that provides applications with estimate on how much different graphics operations will cost.
|
inline |
Get the cont helper class that provides applications with estimate on how much different graphics operations will cost.
|
inline |
|
inline |
const StateAttribute* osg::State::getLastAppliedAttribute | ( | StateAttribute::Type | type, |
unsigned int | member = 0 |
||
) | const |
Get the current specified attribute, return NULL if one has not yet been applied.
|
protected |
bool osg::State::getLastAppliedMode | ( | StateAttribute::GLMode | mode | ) | const |
Get whether the current specified mode is enabled (true) or disabled (false).
|
protected |
|
inline |
const StateAttribute* osg::State::getLastAppliedTextureAttribute | ( | unsigned int | unit, |
StateAttribute::Type | type, | ||
unsigned int | member = 0 |
||
) | const |
Get the current specified texture attribute, return NULL if one has not yet been applied.
bool osg::State::getLastAppliedTextureMode | ( | unsigned int | unit, |
StateAttribute::GLMode | mode | ||
) | const |
Get whether the current specified texture mode is enabled (true) or disabled (false).
|
inline |
|
inline |
For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS.
|
inline |
|
inline |
For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get whether a particular OpenGL mode is valid in the current graphics context.
Use to disable OpenGL modes that are not supported by current graphics drivers/context.
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
Get the ShaderComposor object.
|
inline |
Get the const ShaderComposor object.
|
inline |
|
inline |
Support for synchronizing the system time and the timestamp counter available with ARB_timer_query.
Note that State doesn't update these values itself.
|
inline |
Get the StateSet stack.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Alternative version of getUniformLocation( unsigned int uniformNameID ) retrofited into OSG for backward compatibility with osgCal, after uniform ids were refactored from std::strings to GLints in OSG version 2.9.10.
Drawbacks: This method is not particularly fast. It has to access mutexed static map of uniform ids. So don't overuse it or your app performance will suffer.
|
inline |
|
inline |
|
inline |
|
inline |
Polytope osg::State::getViewFrustum | ( | ) | const |
|
inline |
|
inline |
void osg::State::haveAppliedAttribute | ( | const StateAttribute * | attribute | ) |
Attribute has been applied externally, update state to reflect this setting.
void osg::State::haveAppliedAttribute | ( | StateAttribute::Type | type, |
unsigned int | member = 0 |
||
) |
Attribute has been applied externally, and therefore this attribute type has been dirtied and will need to be re-applied on next osg::State.apply(..).
note, if you have an osg::StateAttribute which you have applied externally then use the have_applied(attribute) method as this will cause the osg::State to track the current state more accurately and enable lazy state updating such that only changed state will be applied.
|
protected |
|
protected |
void osg::State::haveAppliedMode | ( | StateAttribute::GLMode | mode, |
StateAttribute::GLModeValue | value | ||
) |
Mode has been set externally, update state to reflect this setting.
void osg::State::haveAppliedMode | ( | StateAttribute::GLMode | mode | ) |
Mode has been set externally, therefore dirty the associated mode in osg::State so it is applied on next call to osg::State::apply(..)
|
protected |
|
protected |
void osg::State::haveAppliedTextureAttribute | ( | unsigned int | unit, |
const StateAttribute * | attribute | ||
) |
texture Attribute has been applied externally, update state to reflect this setting.
void osg::State::haveAppliedTextureAttribute | ( | unsigned int | unit, |
StateAttribute::Type | type, | ||
unsigned int | member = 0 |
||
) |
texture Attribute has been applied externally, and therefore this attribute type has been dirtied and will need to be re-applied on next osg::State.apply(..).
note, if you have an osg::StateAttribute which you have applied externally then use the have_applied(attribute) method as this will the osg::State to track the current state more accurately and enable lazy state updating such that only changed state will be applied.
void osg::State::haveAppliedTextureMode | ( | unsigned int | unit, |
StateAttribute::GLMode | mode, | ||
StateAttribute::GLModeValue | value | ||
) |
texture Mode has been set externally, update state to reflect this setting.
void osg::State::haveAppliedTextureMode | ( | unsigned int | unit, |
StateAttribute::GLMode | mode | ||
) |
texture Mode has been set externally, therefore dirty the associated mode in osg::State so it is applied on next call to osg::State::apply(..)
void osg::State::initializeExtensionProcs | ( | ) |
Initialize extension used by osg:::State.
Insert stateset onto state stack.
|
inline |
|
inline |
|
inline |
void osg::State::lazyDisablingOfVertexAttributes | ( | ) |
Mark all the vertex attributes as being disabled but leave the disabling till a later call to applyDisablingOfVertexAttributes.
|
protected |
|
inline |
|
inline |
void osg::State::popAllStateSets | ( | ) |
pop all statesets off state stack, ensuring it is empty ready for the next frame.
Note, to return OpenGL to default state, one should do any state.popAllStatSets(); state.apply().
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
void osg::State::popStateSet | ( | ) |
Pop stateset off state stack.
|
inline |
|
inlineprotected |
void osg::State::print | ( | std::ostream & | fout | ) | const |
print out the internal details of osg::State - useful for debugging.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
void osg::State::releaseGLObjects | ( | ) |
Release all OpenGL objects associated cached by this osg::State object.
void osg::State::removeStateSet | ( | unsigned int | pos | ) |
Pop stateset off state stack.
void osg::State::reset | ( | ) |
reset the state object to an empty stack.
void osg::State::resetVertexAttributeAlias | ( | bool | compactAliasing = true , |
unsigned int | numTextureUnits = 8 |
||
) |
Reset the vertex attribute aliasing to osg's default.
This method needs to be called before render anything unless you really know what you're doing !
|
inline |
Set a specific GL extensions object pr GraphicsObjectManager.
|
inline |
|
inline |
Set flag for early termination of the draw traversal.
|
inline |
Set the current texture unit, return true if selected, false if selection failed such as when multi texturing is not supported.
note, only updates values that change.
|
inline |
Set the vertex attribute binding list.
This method needs to be called before render anything unless you really know what you're doing !
|
inline |
Set whether and how often OpenGL errors should be checked for.
bool osg::State::setClientActiveTextureUnit | ( | unsigned int | unit | ) |
Set the current tex coord array texture unit, return true if selected, false if selection failed such as when multi texturing is not supported.
note, only updates values that change.
|
inline |
Set the vertex attribute aliasing for "color".
This method needs to be called before render anything unless you really know what you're doing !
Set the color pointer using an osg::Array, and manage any VBO that are required.
|
inline |
wrapper around glEnableClientState(GL_COLOR_ARRAY);glColorPointer(..); note, only updates values that change.
|
inline |
Set the current OpenGL context uniqueID.
The ContextID is used by classes like osg::StateAttribute's and osg::Drawable's to help manage separate OpenGL objects, such as display lists, vertex buffer objects and texture object for each graphics context. The ContextID simply acts as an index into arrays that these classes maintain for the purpose of storing GL object handles.
Note, osgViewer::GraphicsWindow will automatically set up the ContextID for you, so you will rearely need to set this yourself.
The exception is when creating your own graphics context, where you should set the ContextID uniquely for each graphics context.
Typical settings for ContextID are 0,1,2,3... up to the maximum number of graphics contexts you have set up. By default contextID is 0.
|
inline |
|
inline |
|
inline |
|
inline |
Set the DisplaySettings.
Note, nothing is applied, the visual settings are just used in the State object to pass the current visual settings to Drawables during rendering.
|
inline |
Set the number of dynamic objects that will be rendered in this graphics context this frame.
|
inline |
Set the callback to be called when the dynamic object count hits 0.
|
inline |
Set the vertex attribute aliasing for "fog coord".
This method needs to be called before render anything unless you really know what you're doing !
Set the fog coord pointer using an osg::Array, and manage any VBO that are required.
void osg::State::setFogCoordPointer | ( | GLenum | type, |
GLsizei | stride, | ||
const GLvoid * | ptr, | ||
GLboolean | normalized = GL_FALSE |
||
) |
wrapper around glEnableClientState(GL_FOG_COORDINATE_ARRAY);glFogCoordPointer(..); note, only updates values that change.
|
inline |
Set the frame stamp for the current frame.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the graphics context associated with that owns this State object.
|
inline |
Set the helper class that provides applications with estimate on how much different graphics operations will cost.
void osg::State::setInitialViewMatrix | ( | const osg::RefMatrix * | matrix | ) |
Wrapper around glInterleavedArrays(..).
also resets the internal array points and modes within osg::State to keep the other vertex array operations consistent.
|
inline |
void osg::State::setMaxBufferObjectPoolSize | ( | unsigned int | size | ) |
void osg::State::setMaxTexturePoolSize | ( | unsigned int | size | ) |
|
inline |
Set whether a particular OpenGL mode is valid in the current graphics context.
Use to disable OpenGL modes that are not supported by current graphics drivers/context.
|
inline |
Set the vertex attribute aliasing for "normal".
This method needs to be called before render anything unless you really know what you're doing !
Set the normal pointer using an osg::Array, and manage any VBO that are required.
|
inline |
wrapper around glEnableClientState(GL_NORMAL_ARRAY);glNormalPointer(..); note, only updates values that change.
|
inline |
Set the vertex attribute aliasing for "secondary color".
This method needs to be called before render anything unless you really know what you're doing !
Set the secondary color pointer using an osg::Array, and manage any VBO that are required.
void osg::State::setSecondaryColorPointer | ( | GLint | size, |
GLenum | type, | ||
GLsizei | stride, | ||
const GLvoid * | ptr, | ||
GLboolean | normalized = GL_TRUE |
||
) |
wrapper around glEnableClientState(GL_SECONDARY_COLOR_ARRAY);glSecondayColorPointer(..); note, only updates values that change.
|
inline |
Set the ShaderComposor object that implements shader composition.
|
inline |
|
inline |
Set the vertex attribute aliasing list for texture coordinates.
This method needs to be called before render anything unless you really know what you're doing !
Set the tex coord pointer using an osg::Array, and manage any VBO that are required.
|
inline |
wrapper around glEnableClientState(GL_TEXTURE_COORD_ARRAY);glTexCoordPointer(..); note, only updates values that change.
|
inline |
|
protected |
|
inline |
|
inline |
|
inline |
Set the vertex attribute aliasing for "vertex".
This method needs to be called before render anything unless you really know what you're doing !
Set the vertex attrib pointer using an osg::Array, and manage any VBO that are required.
void osg::State::setVertexAttribIPointer | ( | unsigned int | index, |
GLint | size, | ||
GLenum | type, | ||
GLsizei | stride, | ||
const GLvoid * | ptr | ||
) |
wrapper around glEnableVertexAttribArrayARB(index);glVertexAttribIPointer(..); note, only updates values that change.
Set the vertex attrib pointer using an osg::Array, and manage any VBO that are required.
void osg::State::setVertexAttribLPointer | ( | unsigned int | index, |
GLint | size, | ||
GLenum | type, | ||
GLsizei | stride, | ||
const GLvoid * | ptr | ||
) |
wrapper around glEnableVertexAttribArrayARB(index);glVertexAttribLPointer(..); note, only updates values that change.
Set the vertex attrib pointer using an osg::Array, and manage any VBO that are required.
void osg::State::setVertexAttribPointer | ( | unsigned int | index, |
GLint | size, | ||
GLenum | type, | ||
GLboolean | normalized, | ||
GLsizei | stride, | ||
const GLvoid * | ptr | ||
) |
wrapper around glEnableVertexAttribArrayARB(index);glVertexAttribPointerARB(..); note, only updates values that change.
Set the vertex pointer using an osg::Array, and manage any VBO that are required.
|
inline |
wrapper around glEnableClientState(GL_VERTEX_ARRAY);glVertexPointer(..); note, only updates values that change.
bool osg::State::supportsShaderRequirement | ( | const std::string & | shaderRequirement | ) |
bool osg::State::supportsShaderRequirements | ( | const osg::ShaderDefines & | shaderRequirements | ) |
|
inline |
|
inline |
|
inline |
|
inline |
void osg::State::updateModelViewAndProjectionMatrixUniforms | ( | ) |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
ExtensionMap osg::State::_extensionMap |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
IndicesGLuint osg::State::_quadIndicesGLuint[4] |
IndicesGLushort osg::State::_quadIndicesGLushort[4] |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Generated at Wed Nov 11 2015 22:14:42 for the OpenSceneGraph by doxygen 1.8.10. |