Main Page | Class List | File List | Class Members

CMaterialBank Class Reference

Simple OpenGL materials class. More...

#include <CMaterialBank.h>

Collaboration diagram for CMaterialBank:

Collaboration graph
[legend]
List of all members.

Public Types

enum  MATERIALBANK_MATERIALS {
  DEFAULT_MATERIAL, MENU_UNAVAILABLE, MENU_NORMAL, MENU_OUTSIDE,
  MENU_INSIDE
}

Public Member Functions

 CMaterialBank (void)
 ~CMaterialBank (void)
void GLSetMaterial (const GL_MATERIAL *pMaterial)
bool SetMaterial (int iMaterial)
bool GetMaterial (int iMaterial, GL_MATERIAL *pMaterial)
void AddCustomMaterial (GL_MATERIAL *pMaterial)
bool SetCustomMaterial (int iMaterial)
bool GetCustomMaterial (int iMaterial, GL_MATERIAL *pMaterial)

Detailed Description

Simple OpenGL materials class.

A simple materials class with default materials for menus and methods for managing custom materials. Uses OpenGL calls to set materials. Use SetMaterial() and SetCustomMaterial() to set class-managed materials with OpenGL and GLSetMaterial() to set materials when providing a material you do not want "managed" by the materials class.

Definition at line 95 of file CMaterialBank.h.


Member Enumeration Documentation

enum CMaterialBank::MATERIALBANK_MATERIALS
 

Enumeration values:
DEFAULT_MATERIAL  Default white material.
MENU_UNAVAILABLE  Colour of segment if the segment function is unavailable.
MENU_NORMAL  Colour of segment when availabla but cursor is not over it.
MENU_OUTSIDE  Colour of segment when cursor is outside the menu disc.
MENU_INSIDE  Colour of segment when cursor is over it, inside the menu circle.
Definition at line 104 of file CMaterialBank.h.


Constructor & Destructor Documentation

CMaterialBank::CMaterialBank void   ) 
 

Constructor, inititalise custom materials vector. Definition at line 104 of file CMaterialBank.cpp.

CMaterialBank::~CMaterialBank void   ) 
 

Destructor, remove custom materials vector. Definition at line 115 of file CMaterialBank.cpp.


Member Function Documentation

void CMaterialBank::AddCustomMaterial GL_MATERIAL pMaterial  ) 
 

Add a custom material to our custom material array.

Parameters:
pMaterial A GL_MATERIAL to put into our custom material array.
Definition at line 240 of file CMaterialBank.cpp.

bool CMaterialBank::GetCustomMaterial int  iMaterial,
GL_MATERIAL pMaterial
 

Get the custom material at the passed index and put it at pMaterial.

Parameters:
iMaterial The material number to get.
pMaterial A GL_MATERIAL to point at our material.
Returns:
True if successful, false if not.
Definition at line 222 of file CMaterialBank.cpp.

bool CMaterialBank::GetMaterial int  iMaterial,
GL_MATERIAL pMaterial
 

Get the default material at the passed index and put it at pMaterial.

Parameters:
iMaterial The material number to get.
pMaterial A GL_MATERIAL to point at our material.
Returns:
True if successful, false if not.
Definition at line 201 of file CMaterialBank.cpp.

void CMaterialBank::GLSetMaterial const GL_MATERIAL pMaterial  ) 
 

Sets the passed material with OpenGL. Can also be used to set a material that is not "registered" by the CMaterialBank object.

Parameters:
pMaterial The GL_MATERIAL to set.
Definition at line 156 of file CMaterialBank.cpp.

References GL_MATERIAL::Ambient, GL_MATERIAL::Diffuse, GL_MATERIAL::Shininess, and GL_MATERIAL::Specular.

Referenced by SetCustomMaterial(), and SetMaterial().

bool CMaterialBank::SetCustomMaterial int  iMaterial  ) 
 

Sets the passed custom material number. Performs some range checking before setting material, if material is not in range then the default (white) material is set.

Parameters:
iMaterial The number of the custom material to set.
Returns:
True if successful, false if not.
Definition at line 177 of file CMaterialBank.cpp.

References GLSetMaterial().

Here is the call graph for this function:

bool CMaterialBank::SetMaterial int  iMaterial  ) 
 

Sets the passed default material number. Performs some range checking before setting material, if material is not in range then the default (white) material is set.

Parameters:
iMaterial The number of the default material to set.
Returns:
True if successful, false if not.
Definition at line 136 of file CMaterialBank.cpp.

References GLSetMaterial().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sun Sep 26 15:31:24 2004 for CMaterialBank by doxygen 1.3.8