Go to the documentation of this file.00001
00002
00003 #ifndef _TEXTURE_UNIT_H_
00004 #define _TEXTURE_UNIT_H_
00005
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <render/BlendMode.h>
00009 #include <render/Color.h>
00010
00011 #include <string>
00012
00013 namespace render
00014 {
00015
00016 class Texture;
00017
00024 class ENGINE_PUBLIC_EXPORT TextureUnit
00025 {
00026 public:
00027
00028 TextureUnit();
00029
00031 void setTexture(const std::string& filename);
00032 void setTexture(Texture* texture);
00033
00035 Texture* getTexture() const;
00036
00038 void setTextureCoordSet(u32 set);
00039
00041 u32 getTextureCoordSet() const;
00042
00043 void setColorOperation(LayerBlendOperation op, LayerBlendSource source1 = LBS_TEXTURE, LayerBlendSource source2 = LBS_CURRENT,
00044 const Color& arg1 = Color::White, const Color& arg2 = Color::White, f32 manualBlend = 0.0f);
00045
00046 void setAlphaOperation(LayerBlendOperation op, LayerBlendSource source1 = LBS_TEXTURE, LayerBlendSource source2 = LBS_CURRENT,
00047 f32 arg1 = 1.0f, f32 arg2 = 1.0f, f32 manualBlend = 0.0f);
00048
00050 LayerBlendMode getColorBlendMode() const;
00051
00053 LayerBlendMode getAlphaBlendMode() const;
00054
00055 protected:
00056
00057 Texture* mTexture;
00058
00063 u32 mTextureCoordSetIndex;
00064
00065 LayerBlendMode colorBlendMode;
00066
00067
00068
00069 LayerBlendMode alphaBlendMode;
00070 };
00071
00072 }
00073
00074 #endif