BaseMaterialHandle Class Reference
 
 
 
BaseMaterialHandle Class Reference

This reference page is linked to from the following overview topics: Low-level Device API.


#include <BaseMaterialHandle.h>

Inheritance diagram for BaseMaterialHandle:
SmartHandle Noncopyable MaxHeapOperators HLSLMaterialHandle SolidColorMaterialHandle StandardMaterialHandle TextureMaterialHandle VertexColorMaterialHandle

Class Description

This is base graphics material class.

A material describes how to render the surface of an object. This class, and all its derived classes, are used for viewport display and Quicksilver. The difference between BaseMaterialHandle and ISimpleMaterial is that BaseMaterialHandle is used by RenderItemHandle::SetCustomMaterial() to describes the surface and ISimpleMaterial is used for Mtl and Texmap to display.

Public Member Functions

GraphicsDriverAPI  BaseMaterialHandle ()
GraphicsDriverAPI  BaseMaterialHandle (const BaseMaterialHandle &from)
GraphicsDriverAPI
BaseMaterialHandle
operator= (const BaseMaterialHandle &from)
virtual GraphicsDriverAPI  ~BaseMaterialHandle ()
virtual GraphicsDriverAPI
const MaterialRequiredStreams
GetRequiredStreams () const
  Returns the material required streams to tell how to setup mesh data.
GraphicsDriverAPI void  Activate (DrawContext &drawContext)
  Activates the material handle with the specified pipeline context.
GraphicsDriverAPI void  Terminate ()
  Terminates the material handle, performing any cleanup required by the material handle.
GraphicsDriverAPI unsigned int  GetPassCount (DrawContext &drawContext) const
  Retrieves the number of passes required to render the material handle.
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.
GraphicsDriverAPI void  PassesFinished (DrawContext &drawContext)
  Called after all of the passes for the material handle have been drawn.

Constructor & Destructor Documentation

GraphicsDriverAPI BaseMaterialHandle ( )
GraphicsDriverAPI BaseMaterialHandle ( const BaseMaterialHandle from )
virtual GraphicsDriverAPI ~BaseMaterialHandle ( ) [virtual]

Member Function Documentation

GraphicsDriverAPI BaseMaterialHandle& operator= ( const BaseMaterialHandle from )
virtual GraphicsDriverAPI const MaterialRequiredStreams* GetRequiredStreams ( ) const [virtual]

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

When a BaseMaterialHandle is used by RenderItemHandle::SetCustomMaterial(), it also needs to know about the material requirement streams to setup corresponding mesh data. It could be used by GenerateRenderItems::GenerateRenderItems() for RenderItemHandle.

Returns:
the material required streams.

Reimplemented in HLSLMaterialHandle, SolidColorMaterialHandle, StandardMaterialHandle, TextureMaterialHandle, and VertexColorMaterialHandle.

GraphicsDriverAPI void Activate ( DrawContext drawContext )

Activates the material handle with the specified pipeline context.

Parameters:
[in] drawContext The pipeline context.
GraphicsDriverAPI void Terminate ( )

Terminates the material handle, performing any cleanup required by the material handle.

GraphicsDriverAPI unsigned int GetPassCount ( DrawContext drawContext ) const

Retrieves the number of passes required to render the material handle.

Each geometry to be drawn with the effect must be drawn that number of times. This pass count can only be retrieved while the effect is active.

Parameters:
[in] drawContext The pipeline context.
Returns:
Returns pass count.
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.

Parameters:
[in] drawContext The pipeline context.
[in] pass The index of pass.
GraphicsDriverAPI void PassesFinished ( DrawContext drawContext )

Called after all of the passes for the material handle have been drawn.

Parameters:
[in] drawContext The pipeline context.