3ds Max C++ API Reference
IRenderStateManager Class Referenceabstract

IRenderStateManager controls primitive renderer's current render style. More...

#include <IRenderStateManager.h>

+ Inheritance diagram for IRenderStateManager:

Public Member Functions

Alpha blending methods

Methods for controlling the alpha blending algorithm

virtual GraphicsDriverAPI void SetBlendEnable (bool bEnable)=0
 
virtual GraphicsDriverAPI bool GetBlendEnable ()=0
 Get alpha blend status. More...
 
virtual GraphicsDriverAPI void SetSourceBlend (BlendSelector value)=0
 Set source element of alpha blend. More...
 
virtual GraphicsDriverAPI BlendSelector GetSourceBlend ()=0
 Get source element. More...
 
virtual GraphicsDriverAPI void SetDestinationBlend (BlendSelector value)=0
 Set destination element of alpha blend. More...
 
virtual GraphicsDriverAPI BlendSelector GetDestinationBlend ()=0
 Get destination element. More...
 
virtual GraphicsDriverAPI void SetBlendOperation (BlendOperation value)=0
 Set alpha blend method The alpha blend operations controls how to mix the alpha value with back-buffer's alpha. More...
 
virtual GraphicsDriverAPI BlendOperation GetBlendOperation ()=0
 Get alpha blend method. More...
 
virtual GraphicsDriverAPI void SetAlphaSourceBlend (BlendSelector value)=0
 Set source element of alpha value blend. More...
 
virtual GraphicsDriverAPI BlendSelector GetAlphaSourceBlend ()=0
 Get source element. More...
 
virtual GraphicsDriverAPI void SetAlphaDestBlend (BlendSelector value)=0
 Set destination element of alpha value blend. More...
 
virtual GraphicsDriverAPI BlendSelector GetAlphaDestBlend ()=0
 Get destination element. More...
 
virtual GraphicsDriverAPI void SetAlphaBlendOperation (BlendOperation value)=0
 Set alpha value blend method. More...
 
virtual GraphicsDriverAPI BlendOperation GetAlphaBlendOperation ()=0
 Get alpha blend method. More...
 
virtual GraphicsDriverAPI void SetBlendFactor (const Point4 &factor)=0
 Set alpha value blend factor. More...
 
virtual GraphicsDriverAPI Point4 GetBlendFactor ()=0
 Get blend factor. More...
 
Rasterizer state methods

Set basic rasterizing states such as culling

virtual GraphicsDriverAPI void SetCullMode (CullMode value)=0
 Set polygon cull method. More...
 
virtual GraphicsDriverAPI CullMode GetCullMode ()=0
 Get polygon cull method. More...
 
virtual GraphicsDriverAPI void SetFillMode (FillMode value)=0
 Set polygon fill mode. More...
 
virtual GraphicsDriverAPI FillMode GetFillMode ()=0
 Get current polygon fill method. More...
 
virtual GraphicsDriverAPI void SetPointSize (float value)=0
 Set point size when using point primitive. More...
 
virtual GraphicsDriverAPI float GetPointSize ()=0
 Get current point size. More...
 
Depth state methods

Enable and set depth based methods

virtual GraphicsDriverAPI void SetDepthEnable (bool bEnable)=0
 Set whether enable depth compare and culling. More...
 
virtual GraphicsDriverAPI bool GetDepthEnable ()=0
 Get current depth culling status. More...
 
virtual GraphicsDriverAPI void SetDepthFunction (CompareFunction value)=0
 Set depth compare function. More...
 
virtual GraphicsDriverAPI CompareFunction GetDepthFunction ()=0
 Get compare function. More...
 
virtual GraphicsDriverAPI void SetDepthWriteEnable (bool bEnable)=0
 Set whether write Z value when drawing primitives. More...
 
virtual GraphicsDriverAPI bool GetDepthWriteEnable ()=0
 Get current depth write status. More...
 
Render state management

Method for controlling the life time of render states

virtual GraphicsDriverAPI void PushRenderStates ()=0
 Push all render states into internal stack. More...
 
virtual GraphicsDriverAPI void PopRenderStates ()=0
 Restore render states to internal stack's topmost render states and pop it out of stack you can use this function to restore previous pushed states. More...
 
virtual GraphicsDriverAPI void ApplyRenderStates ()=0
 Apply current render states to real render device. More...
 

Protected Member Functions

virtual GraphicsDriverAPI ~IRenderStateManager ()
 

Friends

class IPrimitiveRenderer
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

IRenderStateManager controls primitive renderer's current render style.

It defines set-up states for all kinds of vertex and pixel processing. Some render states set up vertex processing, and some set up pixel processing. This interface is acquired from IPrimitiveRenderer::GetRenderStates()

Constructor & Destructor Documentation

◆ ~IRenderStateManager()

virtual GraphicsDriverAPI ~IRenderStateManager ( )
inlineprotectedvirtual
31 {}

Member Function Documentation

◆ SetBlendEnable()

virtual GraphicsDriverAPI void SetBlendEnable ( bool  bEnable)
pure virtual
Set alpha blend status
The blend state controls how a primitive mixing with current back-buffer.
When disabling blend, the primitive's pixel will write to back-buffer without
any additional operation. When enable it, the final color will be computed via
SourceBlend, DestintaionBlend and BlendOperation.
\remarks
An example, when SourceBlend is BlendSelector_SourceColor, DestinationBlend is
BlendSelector_DestinationColor and BlendOperation is BlendOperation_Add, then
the FinalColor = PrimitiveColor + BackBufferColor.
Parameters
bEnabletrue to enable alpha blend, false to disable alpha blend

◆ GetBlendEnable()

virtual GraphicsDriverAPI bool GetBlendEnable ( )
pure virtual

Get alpha blend status.

◆ SetSourceBlend()

virtual GraphicsDriverAPI void SetSourceBlend ( BlendSelector  value)
pure virtual

Set source element of alpha blend.

Parameters
valuesource element

◆ GetSourceBlend()

virtual GraphicsDriverAPI BlendSelector GetSourceBlend ( )
pure virtual

Get source element.

◆ SetDestinationBlend()

virtual GraphicsDriverAPI void SetDestinationBlend ( BlendSelector  value)
pure virtual

Set destination element of alpha blend.

Parameters
valuedestination element

◆ GetDestinationBlend()

virtual GraphicsDriverAPI BlendSelector GetDestinationBlend ( )
pure virtual

Get destination element.

◆ SetBlendOperation()

virtual GraphicsDriverAPI void SetBlendOperation ( BlendOperation  value)
pure virtual

Set alpha blend method The alpha blend operations controls how to mix the alpha value with back-buffer's alpha.

Parameters
valuetype of alpha operation

◆ GetBlendOperation()

virtual GraphicsDriverAPI BlendOperation GetBlendOperation ( )
pure virtual

Get alpha blend method.

◆ SetAlphaSourceBlend()

virtual GraphicsDriverAPI void SetAlphaSourceBlend ( BlendSelector  value)
pure virtual

Set source element of alpha value blend.

Parameters
valuesource element

◆ GetAlphaSourceBlend()

virtual GraphicsDriverAPI BlendSelector GetAlphaSourceBlend ( )
pure virtual

Get source element.

◆ SetAlphaDestBlend()

virtual GraphicsDriverAPI void SetAlphaDestBlend ( BlendSelector  value)
pure virtual

Set destination element of alpha value blend.

Parameters
valuedestination element

◆ GetAlphaDestBlend()

virtual GraphicsDriverAPI BlendSelector GetAlphaDestBlend ( )
pure virtual

Get destination element.

◆ SetAlphaBlendOperation()

virtual GraphicsDriverAPI void SetAlphaBlendOperation ( BlendOperation  value)
pure virtual

Set alpha value blend method.

Parameters
valuetype of alpha operation

◆ GetAlphaBlendOperation()

virtual GraphicsDriverAPI BlendOperation GetAlphaBlendOperation ( )
pure virtual

Get alpha blend method.

◆ SetBlendFactor()

virtual GraphicsDriverAPI void SetBlendFactor ( const Point4 factor)
pure virtual

Set alpha value blend factor.

Parameters
factorblend factor

◆ GetBlendFactor()

virtual GraphicsDriverAPI Point4 GetBlendFactor ( )
pure virtual

Get blend factor.

◆ SetCullMode()

virtual GraphicsDriverAPI void SetCullMode ( CullMode  value)
pure virtual

Set polygon cull method.

Parameters
valuethe cull mode

◆ GetCullMode()

virtual GraphicsDriverAPI CullMode GetCullMode ( )
pure virtual

Get polygon cull method.

◆ SetFillMode()

virtual GraphicsDriverAPI void SetFillMode ( FillMode  value)
pure virtual

Set polygon fill mode.

Parameters
valuethe fill mode

◆ GetFillMode()

virtual GraphicsDriverAPI FillMode GetFillMode ( )
pure virtual

Get current polygon fill method.

◆ SetPointSize()

virtual GraphicsDriverAPI void SetPointSize ( float  value)
pure virtual

Set point size when using point primitive.

Parameters
valuesize of the point in pixel.

◆ GetPointSize()

virtual GraphicsDriverAPI float GetPointSize ( )
pure virtual

Get current point size.

◆ SetDepthEnable()

virtual GraphicsDriverAPI void SetDepthEnable ( bool  bEnable)
pure virtual

Set whether enable depth compare and culling.

Parameters
bEnabletrue to enable Z buffer function, false to disable Z buffer.

◆ GetDepthEnable()

virtual GraphicsDriverAPI bool GetDepthEnable ( )
pure virtual

Get current depth culling status.

◆ SetDepthFunction()

virtual GraphicsDriverAPI void SetDepthFunction ( CompareFunction  value)
pure virtual

Set depth compare function.

Parameters
valuecompare function

◆ GetDepthFunction()

virtual GraphicsDriverAPI CompareFunction GetDepthFunction ( )
pure virtual

Get compare function.

◆ SetDepthWriteEnable()

virtual GraphicsDriverAPI void SetDepthWriteEnable ( bool  bEnable)
pure virtual

Set whether write Z value when drawing primitives.

Parameters
bEnabletrue to allow writing z values. false to disable it.

◆ GetDepthWriteEnable()

virtual GraphicsDriverAPI bool GetDepthWriteEnable ( )
pure virtual

Get current depth write status.

◆ PushRenderStates()

virtual GraphicsDriverAPI void PushRenderStates ( )
pure virtual

Push all render states into internal stack.

You can then change the states and restore them by calling PopRenderStates. If there's only a few states to change, it's better to manage them by yourself.

◆ PopRenderStates()

virtual GraphicsDriverAPI void PopRenderStates ( )
pure virtual

Restore render states to internal stack's topmost render states and pop it out of stack you can use this function to restore previous pushed states.

◆ ApplyRenderStates()

virtual GraphicsDriverAPI void ApplyRenderStates ( )
pure virtual

Apply current render states to real render device.

A typical usage of render stack may like this:
SetRenderState()
...
ApplyRenderStates()
DrawPrimitive()...
DrawPrimitive()...
PopRenderStates()...
virtual GraphicsDriverAPI void PushRenderStates()=0
Push all render states into internal stack.

Friends And Related Function Documentation

◆ IPrimitiveRenderer

friend class IPrimitiveRenderer
friend