00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CIvfTexture_h_
00026 #define _CIvfTexture_h_
00027
00028 #include <ivf/IvfObject.h>
00029 #include <ivf/IvfImage.h>
00030
00031 IvfSmartPointer(CIvfTexture);
00032
00062 class IVF_API CIvfTexture : public CIvfObject {
00063 public:
00065 CIvfTexture ();
00066
00068 virtual ~CIvfTexture ();
00069
00070 IvfClassInfo("CIvfTexture",CIvfObject);
00071
00080 void setTextureEnvColor(float red, float green, float blue, float alfa);
00081
00090 void setEnvColor(float red, float green, float blue, float alfa);
00091
00093 void getTextureEnvColor(float &red, float &green, float &blue, float &alfa);
00094
00096 void getEnvColor(float &red, float &green, float &blue, float &alfa);
00097
00099 void setGenerateMipmaps(bool flag);
00100
00108 void setTextureMode(GLenum mode);
00109
00117 void setMode(GLenum mode);
00118
00132 void setFilters(GLenum minFilter, GLenum magFilter);
00133
00144 void setTextureRepeat(GLenum repeatS, GLenum repeatT);
00145
00156 void setRepeat(GLenum repeatS, GLenum repeatT);
00157
00164 void setTextureModifier(double scaleX, double scaleY, double rotate);
00165
00172 void setModifier(double scaleX, double scaleY, double rotate);
00173
00180 void setTextureTranslate(double x, double y);
00181
00188 void setTranslate(double x, double y);
00189
00196 void setImage(CIvfImage* image);
00197
00204 void setImageMap(void* imageMap);
00205
00212 void setSize(int width, int height);
00213
00215 void getSize(int &width, int &height);
00216
00218 bool isBound();
00219
00227 void apply();
00228
00235 void bind();
00236
00244 GLuint getName();
00245
00252 void setLoadImages(bool flag);
00253
00261 void setGenerateName(bool flag);
00262
00269 void setName(GLuint name);
00270
00277 void activate();
00278
00285 void deactivate();
00286
00288 bool isActive();
00289
00290 private:
00291 GLenum m_wrapT;
00292 GLenum m_wrapS;
00293 GLenum m_textureMode;
00294 GLenum m_magFilter;
00295 GLenum m_minFilter;
00296 GLuint m_textureName;
00297 float m_textureEnvColor[4];
00298 bool m_generateMipmaps;
00299 bool m_bound;
00300 bool m_generateName;
00301 bool m_loadImages;
00302 CIvfImagePtr m_ivfImage;
00303 void* m_imageMap;
00304 int m_width;
00305 int m_height;
00306 double m_texScaleX;
00307 double m_texScaleY;
00308 double m_texRotate;
00309 double m_texTransX;
00310 double m_texTransY;
00311 bool m_active;
00312 };
00317 #endif