00001
00045
00046
#ifndef _CMATERIALBANK_H_
00047
#define _CMATERIALBANK_H_
00048
00049
00050
#define RGBA_BLACK 0.0f,0.0f,0.0f,0.0f
00051
#define RGBA50_WHITE 1.0f,1.0f,1.0f,5.0f
00052
#define RGBA_WHITE 0.0f,1.0f,1.0f,1.0f
00053
00054
00055
00059
00060 typedef struct GL_COLOR_RGBA
00061 {
00062 float R;
00063 float G;
00064 float B;
00065 float A;
00066 };
00067
00068
00069
00073
00074 typedef struct GL_MATERIAL
00075 {
00076 GL_COLOR_RGBA Diffuse;
00077 GL_COLOR_RGBA Ambient;
00078 GL_COLOR_RGBA Specular;
00079 GL_COLOR_RGBA Emissive;
00080 float Shininess;
00081 };
00082
00083
00084
00094
00095 class CMaterialBank
00096 {
00097
00098
public:
00099
00100
enum{
00101 CUSTOM_MATERIAL_BLOCK_SIZE = 32,
00102 };
00103
00104 enum MATERIALBANK_MATERIALS{
00105
DEFAULT_MATERIAL,
00108
MENU_UNAVAILABLE,
00109
MENU_NORMAL,
00110
MENU_OUTSIDE,
00111
MENU_INSIDE,
00113
00114 MAX_MATERIALS
00115 };
00116
00117
public:
00118
00119
CMaterialBank(
void);
00120
~CMaterialBank(
void);
00121
00122
void GLSetMaterial(
const GL_MATERIAL* pMaterial);
00123
00124
bool SetMaterial(
int iMaterial);
00125
bool GetMaterial(
int iMaterial,
GL_MATERIAL* pMaterial);
00126
00127
void AddCustomMaterial(
GL_MATERIAL* pMaterial);
00128
bool SetCustomMaterial(
int iMaterial);
00129
bool GetCustomMaterial(
int iMaterial,
GL_MATERIAL* pMaterial);
00130
00131
private:
00132
00133
static const GL_MATERIAL m_DefaultMaterials[];
00134 std::vector<GL_MATERIAL*> m_CustomMaterials;
00135
00136 };
00137
00138
00139
00150
00151
extern CMaterialBank *g_pMaterialBank;
00152
00153
00154
#endif
00155