osg.State

class osg.State
Represents:c++ class
Wraps:osg::State
Bases:osg.Referenced

Constructors:

osg.State()

Methods:

:setGraphicsContext(osg.GraphicsContext context)

Set the graphics context associated with that owns this State object.

Parameters:context (osg.GraphicsContext) –
:getGraphicsContext()

Get the graphics context associated with that owns this State object.

Return type:osg.GraphicsContext
:setContextID(unsigned contextID)

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.

Parameters:contextID (unsigned) –
:getContextID()

Get the current OpenGL context unique ID.

Return type:unsigned
:setShaderCompositionEnabled(bool flag)

Parameters:flag (bool) –
:getShaderCompositionEnabled()

Return type:bool
:pushStateSet(osg.StateSet dstate)

Push stateset onto state stack.

Parameters:dstate (osg.StateSet) –
:popStateSet()

Pop stateset off state stack.

: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 osg.State.popAllStatSets(); osg.State.apply().

:insertStateSet(unsigned pos, osg.StateSet dstate)

Insert stateset onto state stack.

Parameters:
:removeStateSet(unsigned pos)

Pop stateset off state stack.

Parameters:pos (unsigned) –
:getStateSetStackSize()

Get the number of StateSet’s on the StateSet stack.

Return type:unsigned
:popStateSetStackToSize(unsigned size)

Pop StateSet’s for the StateSet stack till its size equals the specified size.

Parameters:size (unsigned) –
:releaseGLObjects()

Release all OpenGL objects associated cached by this osg::State object.

:reset()

Reset the state object to an empty stack.

:setCurrentVertexArrayState(osg.VertexArrayState vas)

Set the CurrentVetexArrayState object that take which vertex arrays are bound.

Parameters:vas (osg.VertexArrayState) –
:getCurrentVertexArrayState()

Get the CurrentVetexArrayState object that take which vertex arrays are bound.

Return type:osg.VertexArrayState
:setCurrentToGlobalVertexArrayState()

Set the CurrentVetexArrayState to the GlobalVertexArrayState.

:resetCurrentVertexArrayStateOnMatch(osg.VertexArrayState vas)

Reset the CurrentVertexArrayState/VertexArrayObject if it’s value matches the specificied vas - use when deleting a vas.

Parameters:vas (osg.VertexArrayState) –