3ds Max C++ API Reference
BlendState Class Reference

This class holds the blend state for all render targets. More...

#include <RenderStates.h>

+ Inheritance diagram for BlendState:

Public Member Functions

 BlendState ()
 
virtual ~BlendState ()
 
virtual void SetAlphaToCoverageEnabled (bool value)
 Set the AlphaToCoverage state. More...
 
virtual bool GetAlphaToCoverageEnabled () const
 Get the AlphaToCoverage state. More...
 
virtual void SetIndependentBlendEnabled (bool value)
 Set independent blend state If independent blend is enabled, each target has its own blend state; Otherwise all targets share one blend state. More...
 
virtual bool GetIndependentBlendEnabled () const
 Get independent blend state /return true if independent blend is enabled, false if not. More...
 
virtual void SetBlendFactor (Point4 &factor)
 Set the color blending factor. More...
 
virtual Point4 GetBlendFactor () const
 Get the color blending factor. More...
 
virtual void SetMultiSampleMask (unsigned int mask)
 Set multi-sample mask. More...
 
virtual unsigned int GetMultiSampleMask () const
 Get multi-sample mask /return the mask. More...
 
virtual TargetBlendStateGetTargetBlendState (size_t index)
 Get individual target blend state. More...
 

Protected Attributes

bool mAlphaToCoverageEnabled
 The AlphaToCoverage state Note: "AlphaToCoverage" is only valid for multi-sampling. More...
 
bool mIndependentBlendEnabled
 Independent blend state If independent blend is enabled, each target has its own blend state; Otherwise all targets share one blend state. More...
 
Point4 mBlendFactor
 The color blending factor. More...
 
unsigned int mMultiSampleMask
 Multisample mask Default value is 0xffffffff. More...
 
TargetBlendState mBlendStates [MAX_TARGETS_SLOT]
 

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 holds the blend state for all render targets.

Constructor & Destructor Documentation

◆ BlendState()

◆ ~BlendState()

virtual ~BlendState ( )
inlinevirtual
356 {}

Member Function Documentation

◆ SetAlphaToCoverageEnabled()

virtual void SetAlphaToCoverageEnabled ( bool  value)
virtual

Set the AlphaToCoverage state.

Default value is false Note: "AlphaToCoverage" is only valid for multi-sampling. /param value true to enable alpha-to-coverage, false to disable.

◆ GetAlphaToCoverageEnabled()

virtual bool GetAlphaToCoverageEnabled ( ) const
virtual

Get the AlphaToCoverage state.

return true if alpha-to-coverage is enabled, false if not

◆ SetIndependentBlendEnabled()

virtual void SetIndependentBlendEnabled ( bool  value)
virtual

Set independent blend state If independent blend is enabled, each target has its own blend state; Otherwise all targets share one blend state.

Default value is false /param value true to enable independent blend, false to disable

◆ GetIndependentBlendEnabled()

virtual bool GetIndependentBlendEnabled ( ) const
virtual

Get independent blend state /return true if independent blend is enabled, false if not.

◆ SetBlendFactor()

virtual void SetBlendFactor ( Point4 factor)
virtual

Set the color blending factor.

Default value is Point4(1.0f, 1.0f , 1.0f, 1.0f); /param factor color blending factor

◆ GetBlendFactor()

virtual Point4 GetBlendFactor ( ) const
virtual

Get the color blending factor.

/return the factor

◆ SetMultiSampleMask()

virtual void SetMultiSampleMask ( unsigned int  mask)
virtual

Set multi-sample mask.

Default value is 0xffffffff /param value the mask

◆ GetMultiSampleMask()

virtual unsigned int GetMultiSampleMask ( ) const
virtual

Get multi-sample mask /return the mask.

◆ GetTargetBlendState()

virtual TargetBlendState& GetTargetBlendState ( size_t  index)
virtual

Get individual target blend state.

/param index index of the target. Max value is MAX_TARGETS_SLOT. /return target blend state handle

Member Data Documentation

◆ mAlphaToCoverageEnabled

bool mAlphaToCoverageEnabled
protected

The AlphaToCoverage state Note: "AlphaToCoverage" is only valid for multi-sampling.

Default value is false

◆ mIndependentBlendEnabled

bool mIndependentBlendEnabled
protected

Independent blend state If independent blend is enabled, each target has its own blend state; Otherwise all targets share one blend state.

Default value is false

◆ mBlendFactor

Point4 mBlendFactor
protected

The color blending factor.

◆ mMultiSampleMask

unsigned int mMultiSampleMask
protected

Multisample mask Default value is 0xffffffff.

◆ mBlendStates

TargetBlendState mBlendStates[MAX_TARGETS_SLOT]
protected