3ds Max C++ API Reference
DepthStencilState Class Reference

This class encapsulates a complete depth buffer and stencil buffer state. More...

#include <RenderStates.h>

+ Inheritance diagram for DepthStencilState:

Public Member Functions

 DepthStencilState ()
 
virtual ~DepthStencilState ()
 
virtual void SetDepthEnabled (bool value)
 Set depth test state. More...
 
virtual bool GetDepthEnabled () const
 Get depth test state. More...
 
virtual void SetDepthWriteEnabled (bool value)
 Set whether depth write is allowed. More...
 
virtual bool GetDepthWriteEnabled () const
 Get whether depth write is allowed. More...
 
virtual void SetDepthFunction (CompareFunction value)
 Set depth buffer compare function. More...
 
virtual CompareFunction GetDepthFunction () const
 Get depth buffer compare function. More...
 
virtual void SetStencilEnabled (bool value)
 Set stencil buffer state. More...
 
virtual bool GetStencilEnabled () const
 Get stencil buffer state /return stencil buffer state. More...
 
virtual void SetStencilReadMask (unsigned char mask)
 Set stencil buffer read mask. More...
 
virtual unsigned char GetStencilReadMask () const
 Get stencil buffer read mask. More...
 
virtual void SetStencilWriteMask (unsigned char mask)
 Set stencil buffer write mask. More...
 
virtual unsigned char GetStencilWriteMask () const
 Get stencil buffer write mask. More...
 
virtual StencilOperationGetFrontFaceOperation ()
 Get front face stencil operation /return front face stencil operation. More...
 
virtual StencilOperationGetBackFaceOperation ()
 Get front back stencil operation /return front back stencil operation. More...
 
virtual void SetStencilReference (int value)
 Set stencil reference value. More...
 
virtual int GetStencilReference () const
 Get stencil reference value. More...
 

Protected Attributes

bool mDepthEnabled
 Depth test state Default value is true. More...
 
bool mDepthWriteEnabled
 Indicates whether depth write is allowed Default value is true. More...
 
CompareFunction mDepthFunction
 Depth buffer compare function. More...
 
bool mStencilEnable
 Stencil buffer state Default value is false. More...
 
unsigned char mStencilReadMask
 Stencil buffer read mask Default value is 0xFF. More...
 
unsigned char mStencilWriteMask
 Stencil buffer write mask Default value is 0xFF. More...
 
StencilOperation mFrontFaceOp
 Front face stencil operation. More...
 
StencilOperation mBackFaceOp
 Back face stencil operation. More...
 
int mReferenceStencil
 Stencil reference value Default value is 0. More...
 

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

This class encapsulates a complete depth buffer and stencil buffer state.

Constructor & Destructor Documentation

◆ DepthStencilState()

◆ ~DepthStencilState()

virtual ~DepthStencilState ( )
inlinevirtual
513 {}

Member Function Documentation

◆ SetDepthEnabled()

virtual void SetDepthEnabled ( bool  value)
virtual

Set depth test state.

Default value is true /param value true to enable depth test, false to disable

◆ GetDepthEnabled()

virtual bool GetDepthEnabled ( ) const
virtual

Get depth test state.

/return true if enabled, false if not.

◆ SetDepthWriteEnabled()

virtual void SetDepthWriteEnabled ( bool  value)
virtual

Set whether depth write is allowed.

Default value is true /param value true to allow depth write, false to turn off

◆ GetDepthWriteEnabled()

virtual bool GetDepthWriteEnabled ( ) const
virtual

Get whether depth write is allowed.

Default value is true /return true if depth write is enabled, false if not

◆ SetDepthFunction()

virtual void SetDepthFunction ( CompareFunction  value)
virtual

Set depth buffer compare function.

Default value is CompareFunctionLess /param value depth compare function

◆ GetDepthFunction()

virtual CompareFunction GetDepthFunction ( ) const
virtual

Get depth buffer compare function.

/return current depth compare function

◆ SetStencilEnabled()

virtual void SetStencilEnabled ( bool  value)
virtual

Set stencil buffer state.

Default value is false /param value true to enable stencil buffer, false to disable

◆ GetStencilEnabled()

virtual bool GetStencilEnabled ( ) const
virtual

Get stencil buffer state /return stencil buffer state.

◆ SetStencilReadMask()

virtual void SetStencilReadMask ( unsigned char  mask)
virtual

Set stencil buffer read mask.

Default value is 0xFF /param value stencil read mask

◆ GetStencilReadMask()

virtual unsigned char GetStencilReadMask ( ) const
virtual

Get stencil buffer read mask.

/return current stencil read mask

◆ SetStencilWriteMask()

virtual void SetStencilWriteMask ( unsigned char  mask)
virtual

Set stencil buffer write mask.

Default value is 0xFF /param value stencil write mask

◆ GetStencilWriteMask()

virtual unsigned char GetStencilWriteMask ( ) const
virtual

Get stencil buffer write mask.

/return current stencil write mask

◆ GetFrontFaceOperation()

virtual StencilOperation& GetFrontFaceOperation ( )
virtual

Get front face stencil operation /return front face stencil operation.

◆ GetBackFaceOperation()

virtual StencilOperation& GetBackFaceOperation ( )
virtual

Get front back stencil operation /return front back stencil operation.

◆ SetStencilReference()

virtual void SetStencilReference ( int  value)
virtual

Set stencil reference value.

Default value is 0. /param value stencil reference value

◆ GetStencilReference()

virtual int GetStencilReference ( ) const
virtual

Get stencil reference value.

/return stencil reference value

Member Data Documentation

◆ mDepthEnabled

bool mDepthEnabled
protected

Depth test state Default value is true.

◆ mDepthWriteEnabled

bool mDepthWriteEnabled
protected

Indicates whether depth write is allowed Default value is true.

◆ mDepthFunction

CompareFunction mDepthFunction
protected

Depth buffer compare function.

Default value is CompareFunctionLess

◆ mStencilEnable

bool mStencilEnable
protected

Stencil buffer state Default value is false.

◆ mStencilReadMask

unsigned char mStencilReadMask
protected

Stencil buffer read mask Default value is 0xFF.

◆ mStencilWriteMask

unsigned char mStencilWriteMask
protected

Stencil buffer write mask Default value is 0xFF.

◆ mFrontFaceOp

StencilOperation mFrontFaceOp
protected

Front face stencil operation.

◆ mBackFaceOp

StencilOperation mBackFaceOp
protected

Back face stencil operation.

◆ mReferenceStencil

int mReferenceStencil
protected

Stencil reference value Default value is 0.