SolidColorMaterialHandle Class Reference
 
 
 
SolidColorMaterialHandle Class Reference

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


#include <SolidColorMaterialHandle.h>

Inheritance diagram for SolidColorMaterialHandle:
BaseMaterialHandle SmartHandle Noncopyable MaxHeapOperators

Class Description

SolidColorMaterialHandle is a material class to support solid color.

This class is used for viewport display and Quicksilver. It's used by RenderItemHandle::SetCustomMaterial() to describe the solid color surface. How to use:

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

Public Member Functions

GraphicsDriverAPI  SolidColorMaterialHandle ()
GraphicsDriverAPI  SolidColorMaterialHandle (const SolidColorMaterialHandle &from)
GraphicsDriverAPI
SolidColorMaterialHandle
operator= (const SolidColorMaterialHandle &from)
virtual GraphicsDriverAPI  ~SolidColorMaterialHandle ()
GraphicsDriverAPI bool  Initialize ()
  Initialize the instance of solid color material.
virtual GraphicsDriverAPI
const MaterialRequiredStreams
GetRequiredStreams () const
  Returns the material required streams to tell how to setup mesh data.
GraphicsDriverAPI void  SetColor (const AColor &color)
  Set color for solid color material.
GraphicsDriverAPI const AColor GetColor () const
  Get the color for solid color material.

Constructor & Destructor Documentation

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

Member Function Documentation

GraphicsDriverAPI SolidColorMaterialHandle& operator= ( const SolidColorMaterialHandle from )
GraphicsDriverAPI bool Initialize ( )

Initialize the instance of solid color material.

A SolidColorMaterialHandle should be initialized before it's used.

Returns:
true if successfully initialized, false otherwise.
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 from BaseMaterialHandle.

GraphicsDriverAPI void SetColor ( const AColor color )

Set color for solid color material.

By default, the color of solid color material is AColor(1.0, 1.0, 1.0, 1.0). When a color is set, the solid color material will use this color.

Parameters:
color The color of solid color material.
GraphicsDriverAPI const AColor& GetColor ( ) const

Get the color for solid color material.

Returns:
the color for solid color material.