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.

Параметры

context (osg.GraphicsContext) –

:getGraphicsContext()

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

Тип результата

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.

Параметры

contextID (unsigned) –

:getContextID()

Get the current OpenGL context unique ID.

Тип результата

unsigned

:setShaderCompositionEnabled(bool flag)

Параметры

flag (bool) –

:getShaderCompositionEnabled()

Тип результата

bool

:pushStateSet(osg.StateSet dstate)

Push stateset onto state stack.

Параметры

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.

Параметры
:removeStateSet(unsigned pos)

Pop stateset off state stack.

Параметры

pos (unsigned) –

:getStateSetStackSize()

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

Тип результата

unsigned

:popStateSetStackToSize(unsigned size)

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

Параметры

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.

Параметры

vas (osg.VertexArrayState) –

:getCurrentVertexArrayState()

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

Тип результата

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.

Параметры

vas (osg.VertexArrayState) –