Kinetic Visualization
 All Classes Functions Variables Pages
Texture.h
1 #pragma once
2 #include <glm\glm.hpp>
3 #include "Img.h"
4 #include <boost/shared_ptr.hpp>
5 
6 class Texture
7 {
8 public:
9  typedef boost::shared_ptr<Texture> TexturePtr;
10 
11  public:
12  static std::vector<Texture*> textures;
13 
14  enum //TextureTyp
15  {
16  TT_NORMAL,
17  TT_MIPMAP,
18  TT_ANISOTRPIC
19  };
20  int TextureTyp;
21 
22  enum // CorrectionMode
23  {
24  CM_AFFINE,
25  CM_PERSPECTIVE,
26  CM_QUANTITY = 2
27  };
28  int Correction; // default: CM_PERSPECTIVE
29 
30  enum // FilterMode
31  {
32  FM_NEAREST = 0x2600,
33  FM_LINEAR = 0x2601,
34  FM_QUANTITY = 2
35  };
36  int Filter; // default: FM_LINEAR
37 
38  enum // MipmapMode
39  {
40  MM_NEAREST = 0x2600,
41  MM_LINEAR = 0x2601,
42  MM_NEAREST_NEAREST = 0x2700,
43  MM_NEAREST_LINEAR = 0x2702,
44  MM_LINEAR_NEAREST = 0x2701,
45  MM_LINEAR_LINEAR = 0x2703,
46  MM_QUANTITY = 6
47  };
48  int Mipmap; // default: MM_LINEAR_LINEAR
49 
50  enum // CoordinateMode
51  {
52  WM_CLAMP = 0x2900,
53  WM_REPEAT = 0x2901,
54  WM_CLAMP_BORDER = 0x812D,
55  WM_CLAMP_EDGE = 0x812F,
56  WM_MIRRORED_REPEAT = 0x8370,
57  WM_QUANTITY = 5
58  };
59 
60  glm::vec4 BorderColor; // default: ColorRGBA(0,0,0,0)
61  int CoordU; // default: WM_CLAMP_EDGE
62  int CoordV; // default: WM_CLAMP_EDGE
63 
64  enum // TexGenMode
65  {
66  TG_NONE,
67  TG_ENVIRONMENT_MAP, /*IMPLEMENTIERT*/
68  TG_PROJECTED_TEXTURE,
69  TG_QUANTITY
70  };
71  int Texgen; // default: TG_NONE
72 
73  /********* MULTI TEXTURIERUNG *********/
74  enum // ApplyMode
75  {
76  AM_REPLACE = 0x1E01,
77  AM_DECAL = 0x2101,
78  AM_MODULATE = 0x2100,
79  AM_BLEND = 0x0BE2,
80  AM_ADD = 0x0104,
81  AM_COMBINE = 0x8570,
82  AM_QUANTITY = 6
83  };
84  glm::vec4 BlendColor; // default: ColorRGBA(0,0,0,1)
85  int Apply; // default: AM_REPLACE
86 
87  enum // ApplyCombineFunction
88  {
89  ACF_REPLACE = 0x1E01,
90  ACF_MODULATE = 0x2100,
91  ACF_ADD = 0x0104,
92  ACF_ADD_SIGNED = 0x8574,
93  ACF_SUBTRACT = 0x84E7,
94  ACF_INTERPOLATE = 0x8575,
95  ACF_DOT3_RGB = 0x86AE,
96  ACF_DOT3_RGBA = 0x86AF,
97  ACF_QUANTITY = 8
98  };
99  enum // ApplyCombineSrc
100  {
101  ACS_TEXTURE = 0x1702,
102  ACS_PRIMARY_COLOR = 0x8577,
103  ACS_CONSTANT = 0x8576,
104  ACS_PREVIOUS = 0x8578,
105  ACS_QUANTITY = 4
106  };
107 
108  enum // ApplyCombineOperand
109  {
110  ACO_SRC_COLOR = 0x0300,
111  ACO_ONE_MINUS_SRC_COLOR = 0x0301,
112  ACO_SRC_ALPHA = 0x0302,
113  ACO_ONE_MINUS_SRC_ALPHA = 0x0303,
114  ACO_QUANTITY = 4
115  };
116 
117  enum // ApplyCombineScale
118  {
119  ACSC_ONE,
120  ACSC_TWO,
121  ACSC_FOUR,
122  ACSC_QUANTITY
123  };
124 
125  int CombineFuncRGB; // default: ACF_REPLACE
126  int CombineFuncAlpha; // default: ACF_REPLACE
127 
128  int CombineSrc0RGB; // default: ACS_TEXTURE
129  int CombineSrc1RGB; // default: ACS_TEXTURE
130  int CombineSrc2RGB; // default: ACS_TEXTURE
131  int CombineSrc0Alpha; // default: ACS_TEXTURE
132  int CombineSrc1Alpha; // default: ACS_TEXTURE
133  int CombineSrc2Alpha; // default: ACS_TEXTURE
134  int CombineOp0RGB; // default: ACO_SRC_COLOR
135  int CombineOp1RGB; // default: ACO_SRC_COLOR
136  int CombineOp2RGB; // default: ACO_SRC_COLOR
137  int CombineOp0Alpha; // default: ACO_SRC_COLOR
138  int CombineOp1Alpha; // default: ACO_SRC_COLOR
139  int CombineOp2Alpha; // default: ACO_SRC_COLOR
140  int CombineScaleRGB; // default: ACSC_ONE
141  int CombineScaleAlpha; // default: ACSC_ONE
142 
143  /*********IMAGE*********/
147  Texture(): texname(0), m_dimension(2), texname2(0), m_pingbong(false), current_texture(0) {};
153  Texture(unsigned int dimensions, bool pingbong = false): texname(0), texname2(0), m_dimension(dimensions), m_pingbong(pingbong), current_texture(0) {};
159  Texture (Img* pkImage, bool pingbong = false) : texname(0), texname2(0), m_dimension(2), m_pingbong(pingbong), current_texture(0), BlendColor(0,0,0,1), BorderColor(0,0,0,0), m_pImage(pkImage), TextureTyp(0), Texgen(0){};
160  //virtual ~Texture ();
161 
166  void SetImage (Img* pImage);
171  Img* GetImage () const;
172 
173  bool m_pingbong;
174  unsigned int current_texture;
175 
176  unsigned int m_dimension;
177  std::string texturename;
178 
179  unsigned int GetTexName();
180  unsigned int GetTexName2();
181  void SetTexName(unsigned int tex);
182 
183  unsigned int m_width;
184  unsigned int m_height;
185  unsigned int m_depth;
186 
187  protected:
188  unsigned int texname;
189  unsigned int texname2;
190 
191  Img* m_pImage;
192 
193  private:
194 
195 };