Unigine::State Class
Unigine state interface.
To use this class, include the UnigineState.h file.
Unigine::State Class
Members
virtual ~State ()
Virtual destructor.static State * get ()
Return a pointer to the existing state.Return value
Pointer to the existing state.virtual void clearStates () const =0
Clear all states.virtual void clearTextures () const =0
Clear all textures.virtual void clearBuffer (int buffer, const vec4 & color, float depth, int stencil) const =0
Clear currently atteched buffer.Arguments
- int buffer - Buffer mask.
- const vec4 & color - Color value to clear.
- float depth - Depth value to clear.
- int stencil - Stencil value to clear.
virtual void flushStates () const =0
Flush states.virtual void flushRender () const =0
Flush render.virtual void setViewport (int x, int y, int width, int height) const =0
Set viewport.Arguments
- int x - X coordinate.
- int y - Y coordinate.
- int width - Viewport width.
- int height - Viewport height.
virtual int getWidth () const =0
Get viewport width.Return value
Viewport width.virtual int getHeight () const =0
Get viewport height.Return value
Viewport height.virtual void setScissorTest (float x, float y, float width, float height) const =0
Set scissor.Arguments
- float x - X coordinate.
- float y - Y coordinate.
- float width - Viewport width.
- float height - Viewport height.
virtual int getScissorTest () const =0
Get scissor test status.Return value
Scissor test status.virtual void setBufferMask (int num, int mask) const =0
Set buffer mask.Arguments
- int num - Buffer number.
- int mask - Buffer mask.
virtual int getBufferMask (int num) const =0
Get buffer mask.Arguments
- int num - Buffer number.
Return value
Buffer mask.virtual void setDepthFunc (int func) const =0
Set depth function.Arguments
- int func - Depth function.
virtual int getDepthFunc () const =0
Get depth function.Return value
Depth function.virtual void setStencilFunc (int func, int pass, int ref) const =0
Set stencil function.Arguments
- int func - Stencil function.
- int pass - Stencil Operation when depth and stencil test pass.
- int ref - Stencil reference value.
virtual int getStencilFunc () const =0
Get stencil function.Return value
Stencil function.virtual int getStencilPass () const =0
Get stencil pass operation.Return value
Stencil pass operation.virtual int getStencilRef () const =0
Get stencil reference value.Return value
Stencil reference value.virtual void setBlendFunc (int src, int dest) const =0
Set blending function.Arguments
- int src - Source blending function.
- int dest - Destination blending function.
virtual int getBlendSrcFunc () const =0
Get source blending function.Return value
Source blending function.virtual int getBlendDestFunc () const =0
Get destination blending function.Return value
Destination blending function.virtual void setAlphaFunc (int func) const =0
Set alpha function.Arguments
- int func - Alpha function.
virtual int getAlphaFunc () const =0
Get alpha function.Return value
Alpha function.virtual void setPolygonFront (int front) const =0
Set polygon front mode.Arguments
- int front - Polygon front mode.
virtual int getPolygonFront () const =0
Get polygon front mode.Return value
Polygon front mode.virtual void setPolygonCull (int cull) const =0
Set polygon cull mode.Arguments
- int cull - Polygon cull mode.
virtual int getPolygonCull () const =0
Get polygon cull mode.Return value
Polygon cull mode.virtual void setPolygonFill (int fill) const =0
Set polygon fill mode.Arguments
- int fill - Polygon fill mode.
virtual int getPolygonFill () const =0
Get polygon fill mode.Return value
Polygon fill mode.virtual void setPolygonOffset (float bias, float offset) const =0
Set polygon offset value.Arguments
- float bias - Polygon bias offset.
- float offset - Polygon slope offset.
virtual float getPolygonBias () const =0
Get polygon bias offset.Return value
Polygon bias offset.virtual float getPolygonSlope () const =0
Get polygon slope offset.Return value
Polygon slope offset.virtual void setShader (const ShaderPtr & shader) const =0
Set current shader.Arguments
- const ShaderPtr & shader - Shader smart pointer.
virtual ShaderPtr getShader () const =0
Get current shader.Return value
Shader smart pointer.virtual void setMaterial (const MaterialPtr & material) const =0
Set current material.Arguments
- const MaterialPtr & material - Material smart pointer.
virtual MaterialPtr getMaterial () const =0
Get current material.Return value
Material smart pointer.virtual void setTexture (int shader, int num, const TexturePtr & texture) const =0
Set current texture.Arguments
- int shader - Shader type.
- int num - Texture unit number.
- const TexturePtr & texture - Texture smart pointer.
virtual TexturePtr getTexture (int shader, int num) const =0
Get current texture.Arguments
- int shader - Shader type.
- int num - Texture unit number.
Return value
Texture smart pointer.virtual TexturePtr getDeferredDepthTexture () const =0
Get current deferred depth texture.Return value
Current deferred depth texture.virtual TexturePtr getDeferredColorTexture () const =0
Get current deferred color texture.Return value
Current deferred color texture.virtual TexturePtr getDeferredNormalTexture () const =0
Get current deferred normal texture.Return value
Current deferred normal texture.virtual TexturePtr getDeferredParallaxTexture () const =0
Get current deferred parallax texture.Return value
Current deferred parallax texture.virtual TexturePtr getDeferredOcclusionTexture () const =0
Get current deferred occlusion texture.Return value
Current deferred occlusion texture.virtual TexturePtr getDeferredLightTexture () const =0
Get current deferred light texture.Return value
Current deferred light texture.virtual TextureRenderPtr getDeferredTextureRender () const =0
Get current deferred texture render.Return value
Current deferred texture render.virtual TexturePtr getScreenDepthTexture () const =0
Get current screen depth texture.Return value
Current screen depth texture.virtual TexturePtr getScreenColorTexture () const =0
Get current screen color texture.Return value
Current screen color texture.virtual TextureRenderPtr getScreenTextureRender () const =0
Get current screen texture render.Return value
Current screen texture render.Unigine::State::anonymous_95 Enumeration
BUFFER_NONE
= 0
BUFFER_RED
= 1 << 0
BUFFER_GREEN
= 1 << 1
BUFFER_BLUE
= 1 << 2
BUFFER_ALPHA
= 1 << 3
BUFFER_DEPTH
= 1 << 4
BUFFER_STENCIL
= 1 << 5
BUFFER_COLOR
= (BUFFER_RED | BUFFER_GREEN | BUFFER_BLUE | BUFFER_ALPHA)
BUFFER_DEPTH_STENCIL
= (BUFFER_DEPTH | BUFFER_STENCIL)
BUFFER_ALL
= (BUFFER_COLOR | BUFFER_DEPTH_STENCIL)
Unigine::State::anonymous_96 Enumeration
DEPTH_NONE
= 0
DEPTH_EQUAL
DEPTH_LEQUAL
DEPTH_GEQUAL
DEPTH_ALWAYS
Unigine::State::anonymous_97 Enumeration
STENCIL_NONE
= 0
STENCIL_EQUAL
STENCIL_ALWAYS
Unigine::State::anonymous_98 Enumeration
STENCIL_KEEP
= 0
STENCIL_INCR
STENCIL_REPLACE
Unigine::State::anonymous_99 Enumeration
BLEND_NONE
= 0
BLEND_ZERO
BLEND_ONE
BLEND_SRC_COLOR
BLEND_ONE_MINUS_SRC_COLOR
BLEND_SRC_ALPHA
BLEND_ONE_MINUS_SRC_ALPHA
BLEND_DEST_COLOR
BLEND_ONE_MINUS_DEST_COLOR
BLEND_DEST_ALPHA
BLEND_ONE_MINUS_DEST_ALPHA
BLEND_SRC1_COLOR
BLEND_ONE_MINUS_SRC1_COLOR
BLEND_SRC1_ALPHA
BLEND_ONE_MINUS_SRC1_ALPHA
Unigine::State::anonymous_100 Enumeration
ALPHA_NONE
= 0
ALPHA_COVERAGE
Unigine::State::anonymous_101 Enumeration
FRONT_CCW
= 0
FRONT_CW
FRONT_INVERT
Unigine::State::anonymous_102 Enumeration
CULL_NONE
= 0
CULL_BACK
CULL_FRONT
Unigine::State::anonymous_103 Enumeration
FILL_SOLID
= 0
FILL_WIREFRAME
Unigine::State::anonymous_104 Enumeration
SHADER_VERTEX
= 0
SHADER_CONTROL
SHADER_EVALUATE
SHADER_GEOMETRY
SHADER_FRAGMENT
SHADER_COMPUTE
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)