3ds Max C++ API Reference
TextureMaterialHandle Class Reference

This is material class to support material with texture. More...

#include <TextureMaterialHandle.h>

+ Inheritance diagram for TextureMaterialHandle:

Public Types

enum  FilterMode { FilterNone , FilterLinear }
 

Public Member Functions

GraphicsDriverAPI TextureMaterialHandle ()
 
GraphicsDriverAPI TextureMaterialHandle (const TextureMaterialHandle &from)
 
GraphicsDriverAPI TextureMaterialHandleoperator= (const TextureMaterialHandle &from)
 
virtual GraphicsDriverAPI ~TextureMaterialHandle ()
 
GraphicsDriverAPI bool Initialize ()
 Initialize an instance of texture material. More...
 
GraphicsDriverAPI void SetTexture (const BaseRasterHandle &hTexture)
 Specifies a texture handle. More...
 
GraphicsDriverAPI BaseRasterHandle GetTexture () const
 Returns the texture handle. More...
 
GraphicsDriverAPI void SetTextureMapChannel (int channelID)
 Specifies texture map channel ID. More...
 
GraphicsDriverAPI int GetTextureMapChannel ()
 Returns the texture map channel ID. More...
 
virtual GraphicsDriverAPI const MaterialRequiredStreamsGetRequiredStreams () const
 Returns the material required streams to tell how to setup mesh data. More...
 
GraphicsDriverAPI void SetFilters (const FilterMode filters)
 Specifies material filters. More...
 
- Public Member Functions inherited from BaseMaterialHandle
GraphicsDriverAPI BaseMaterialHandle ()
 
GraphicsDriverAPI BaseMaterialHandle (const BaseMaterialHandle &from)
 
GraphicsDriverAPI BaseMaterialHandleoperator= (const BaseMaterialHandle &from)
 
virtual GraphicsDriverAPI ~BaseMaterialHandle ()
 
GraphicsDriverAPI void Activate (DrawContext &drawContext)
 Activates the material handle with the specified pipeline context. More...
 
GraphicsDriverAPI void Terminate ()
 Terminates the material handle, performing any cleanup required by the material handle. More...
 
GraphicsDriverAPI unsigned int GetPassCount (DrawContext &drawContext) const
 Retrieves the number of passes required to render the material handle. More...
 
GraphicsDriverAPI void ActivatePass (DrawContext &drawContext, unsigned int pass)
 Activates the specified pass of the material handle, at which point it may render geometry as necessary for the pass. More...
 
GraphicsDriverAPI void PassesFinished (DrawContext &drawContext)
 Called after all of the passes for the material handle have been drawn. More...
 
- Public Member Functions inherited from SmartHandle
virtual GraphicsDriverAPI ~SmartHandle ()
 destructor More...
 
GraphicsDriverAPI bool IsValid () const
 Check if this handle is valid. More...
 
GraphicsDriverAPI void Release ()
 Release the underlying graphics objects. More...
 
GraphicsDriverAPI Identifier GetObjectID () const
 Get the underlying graphics object id. More...
 
GraphicsDriverAPI void SetPointer (IRefObject *pObject)
 
GraphicsDriverAPI IRefObjectGetPointer () const
 Get the underlying graphics object pointer. More...
 
bool operator== (const SmartHandle &rhs) const
 
bool operator!= (const SmartHandle &rhs) const
 
bool operator< (const SmartHandle &rhs) const
 
bool operator<= (const SmartHandle &rhs) const
 
bool operator> (const SmartHandle &rhs) const
 
bool operator>= (const SmartHandle &rhs) const
 
GraphicsDriverAPI SmartHandle (const SmartHandle &)
 
GraphicsDriverAPI SmartHandleoperator= (const SmartHandle &)
 

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...
 
- Protected Member Functions inherited from SmartHandle
GraphicsDriverAPI SmartHandle ()
 
- Protected Attributes inherited from SmartHandle
IRefObjectmpObject
 

Detailed Description

This is material class to support material with texture.

How to use:

hMaterial.Initialize();
hMaterial.SetTexture(hTexture); // hTexture is an instance of TextureHandle
pItem->SetCustomMaterial(hMaterial); // pItem is an instance of RenderItemHandle

Member Enumeration Documentation

◆ FilterMode

enum FilterMode
Enumerator
FilterNone 
FilterLinear 
@ FilterLinear
Definition: TextureMaterialHandle.h:31
@ FilterNone
Definition: TextureMaterialHandle.h:31

Constructor & Destructor Documentation

◆ TextureMaterialHandle() [1/2]

◆ TextureMaterialHandle() [2/2]

◆ ~TextureMaterialHandle()

Member Function Documentation

◆ operator=()

◆ Initialize()

GraphicsDriverAPI bool Initialize ( )

Initialize an instance of texture material.

A TextureMaterialHandle should be initialized before it's used.

Returns
true if successfully initialized, false otherwise.

◆ SetTexture()

GraphicsDriverAPI void SetTexture ( const BaseRasterHandle hTexture)

Specifies a texture handle.

Parameters
[in]hTexturethe texture handle.

◆ GetTexture()

GraphicsDriverAPI BaseRasterHandle GetTexture ( ) const

Returns the texture handle.

Returns
the texture handle.

◆ SetTextureMapChannel()

GraphicsDriverAPI void SetTextureMapChannel ( int  channelID)

Specifies texture map channel ID.

Change of texture map channel ID will change the MaterialRequiredStreams.

Parameters
[in]channelIDthe texture map channel ID.

◆ GetTextureMapChannel()

GraphicsDriverAPI int GetTextureMapChannel ( )

Returns the texture map channel ID.

Returns
the texture map channel ID.

◆ GetRequiredStreams()

virtual GraphicsDriverAPI const MaterialRequiredStreams* GetRequiredStreams ( ) const
virtual

Returns the material required streams to tell how to setup mesh data.

Returns
the material required streams.

Reimplemented from BaseMaterialHandle.

◆ SetFilters()

GraphicsDriverAPI void SetFilters ( const FilterMode  filters)

Specifies material filters.

Sets material filter.

Parameters
[in]filtersdescription.