Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __SP_TEXTURE_LAYER_H__
00009 #define __SP_TEXTURE_LAYER_H__
00010
00011
00012 #include "Base/spStandard.hpp"
00013
00014
00015 namespace sp
00016 {
00017 namespace video
00018 {
00019
00020
00021 class Texture;
00022
00024 enum ETextureLayerTypes
00025 {
00026 TEXLAYER_BASE,
00027 TEXLAYER_STANDARD,
00028 TEXLAYER_RELIEF,
00029
00030 TEXLAYER_CUSTOM,
00031
00032 TEXLAYER_DEFAULT = 0xFFFFFFFF,
00033 };
00034
00040 enum ETexLayerVisibleFlags
00041 {
00042 TEXLAYERFLAG_DIFFUSE = 0x00000001,
00043 TEXLAYERFLAG_NORMAL = 0x00000002,
00044 TEXLAYERFLAG_SPECULAR = 0x00000004,
00045 TEXLAYERFLAG_HEIGHT = 0x00000008,
00046
00047 TEXLAYERFLAG_DEFAULT = 0xFFFFFFFF,
00048 };
00049
00050
00056 class SP_EXPORT TextureLayer
00057 {
00058
00059 public:
00060
00061 TextureLayer();
00062 virtual ~TextureLayer();
00063
00064
00065
00066 virtual void bind() const;
00067 virtual void unbind() const;
00068
00074 virtual void setupDefault() const;
00075
00084 virtual bool active() const;
00085
00091 virtual bool sortCompare(const TextureLayer* Other) const;
00092
00099 virtual bool compare(const TextureLayer* Other) const;
00100
00102 void setTexture(Texture* Tex);
00103
00104
00105
00118 static void setDefaultLayerType(const ETextureLayerTypes Type);
00120 static ETextureLayerTypes getDefaultLayerType();
00121
00122
00123
00124 inline ETextureLayerTypes getType() const
00125 {
00126 return Type_;
00127 }
00128
00130 inline Texture* getTexture() const
00131 {
00132 return Texture_;
00133 }
00134
00140 inline void setIndex(u8 LayerIndex)
00141 {
00142 LayerIndex_ = LayerIndex;
00143 }
00145 inline u8 getIndex() const
00146 {
00147 return LayerIndex_;
00148 }
00149
00154 inline void setEnable(bool Enable)
00155 {
00156 Enabled_ = Enable;
00157 }
00159 inline bool getEnable() const
00160 {
00161 return Enabled_;
00162 }
00163
00169 inline void setVisibleMask(s32 Mask)
00170 {
00171 VisibleMask_ = Mask;
00172 }
00178 inline s32 getVisibleMask() const
00179 {
00180 return VisibleMask_;
00181 }
00182
00183 protected:
00184
00185 TextureLayer(const ETextureLayerTypes Type);
00186
00187
00188
00189 ETextureLayerTypes Type_;
00190
00191 Texture* Texture_;
00192 u8 LayerIndex_;
00193
00194 bool Enabled_;
00195 s32 VisibleMask_;
00196
00197 static ETextureLayerTypes DefaultLayerType_;
00198
00199 };
00200
00201
00202 }
00203
00204 }
00205
00206
00207 #endif
00208
00209
00210
00211