- Cal3D 0.11 API Reference -

corematerial.h
1//****************************************************************************//
2// corematerial.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_COREMATERIAL_H
12#define CAL_COREMATERIAL_H
13
14
15#include "cal3d/global.h"
16#include "cal3d/refcounted.h"
17#include "cal3d/refptr.h"
18
19
20 class CAL3D_API CalCoreMaterial : public cal3d::RefCounted
21{
22 public:
23 struct Color
24 {
25 unsigned char red;
26 unsigned char green;
27 unsigned char blue;
28 unsigned char alpha;
29 };
30
31 struct Map
32 {
33 std::string strFilename;
34 Cal::UserData userData;
35 };
36
37 CalCoreMaterial();
38
39 protected:
40 ~CalCoreMaterial() { }
41
42 public:
43 Color& getAmbientColor();
44 Color& getDiffuseColor();
45 int getMapCount();
46 const std::string& getMapFilename(int mapId);
47 Cal::UserData getMapUserData(int mapId);
48 float getShininess();
49 Color& getSpecularColor();
50 Cal::UserData getUserData();
51 std::vector<Map>& getVectorMap();
52 bool reserve(int mapCount);
53 void setAmbientColor(const Color& ambientColor);
54 void setDiffuseColor(const Color& diffuseColor);
55 bool setMap(int mapId, const Map& map);
56 bool setMapUserData(int mapId, Cal::UserData userData);
57 void setShininess(float shininess);
58 void setSpecularColor(const Color& specularColor);
59 void setFilename(const std::string& filename);
60 const std::string& getFilename(void);
61 void setName(const std::string& name);
62 const std::string& getName(void);
63 void setUserData(Cal::UserData userData);
64
65 private:
66 Color m_ambientColor;
67 Color m_diffuseColor;
68 Color m_specularColor;
69 float m_shininess;
70 std::vector<Map> m_vectorMap;
71 Cal::UserData m_userData;
72 std::string m_name;
73 std::string m_filename;
74};
75 typedef cal3d::RefPtr<CalCoreMaterial> CalCoreMaterialPtr;
76
77#endif
78
79//****************************************************************************//
cal3d::RefCounted
Derive from RefCounted to make your class have reference-counted lifetime semantics.
Definition refcounted.h:29
cal3d::RefPtr
A container-safe smart pointer used for refcounted classes.
Definition refptr.h:11
CalCoreMaterial::Color
Definition corematerial.h:24
CalCoreMaterial::Map
Definition corematerial.h:32

Generated by The Cal3D Team with Doxygen 1.15.0