00001 /* 00002 * Standard texture layer header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_TEXTURE_LAYER_STANDARD_H__ 00009 #define __SP_TEXTURE_LAYER_STANDARD_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 #include "Base/spMaterialConfigTypes.hpp" 00014 #include "RenderSystem/spTextureLayer.hpp" 00015 00016 00017 namespace sp 00018 { 00019 namespace video 00020 { 00021 00022 00028 class SP_EXPORT TextureLayerStandard : public TextureLayer 00029 { 00030 00031 public: 00032 00033 TextureLayerStandard(); 00034 virtual ~TextureLayerStandard(); 00035 00036 /* === Functions === */ 00037 00038 virtual void bind() const; 00039 virtual void unbind() const; 00040 00041 virtual void setupDefault() const; 00042 00043 virtual bool sortCompare(const TextureLayer* Other) const; 00044 virtual bool compare(const TextureLayer* Other) const; 00045 00056 void setMappingGen(const EMappingGenTypes Type, bool SetCoordsFlags = true); 00057 00058 /* === Inline functions === */ 00059 00065 inline void setMatrix(const dim::matrix4f &Matrix) 00066 { 00067 Matrix_ = Matrix; 00068 } 00070 inline const dim::matrix4f& getMatrix() const 00071 { 00072 return Matrix_; 00073 } 00075 inline dim::matrix4f& getMatrix() 00076 { 00077 return Matrix_; 00078 } 00079 00085 inline void setTextureEnv(const ETextureEnvTypes Type) 00086 { 00087 EnvType_ = Type; 00088 } 00090 inline ETextureEnvTypes getTextureEnv() const 00091 { 00092 return EnvType_; 00093 } 00094 00096 inline EMappingGenTypes getMappingGen() const 00097 { 00098 return MappingGen_; 00099 } 00100 00110 inline void setMappingGenCoords(s32 CoordsFlags) 00111 { 00112 MappingCoords_ = CoordsFlags; 00113 } 00115 inline s32 getMappingGenCoords() const 00116 { 00117 return MappingCoords_; 00118 } 00119 00120 protected: 00121 00122 /* === Members === */ 00123 00124 dim::matrix4f Matrix_; 00125 ETextureEnvTypes EnvType_; 00126 EMappingGenTypes MappingGen_; 00127 s32 MappingCoords_; 00128 00129 }; 00130 00131 00132 } // /namespace video 00133 00134 } // /namespace sp 00135 00136 00137 #endif 00138 00139 00140 00141 // ================================================================================