00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #if !defined(AFX_SHADER_H__FF91240C_EB1B_463E_8FC1_11FF08D6743C__INCLUDED_)
00020 #define AFX_SHADER_H__FF91240C_EB1B_463E_8FC1_11FF08D6743C__INCLUDED_
00021
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025
00026 #include "stateGLI.h"
00027 #include "progShader.h"
00028 #include "../texture/texture.h"
00029 #include "../texture/subTex.h"
00030 #include "../texture/multiTex.h"
00031 #include "../texCoordGen/texCoordGen.h"
00032 #include "../texCoordGen/texCoordPerturb.h"
00033
00034 #include <vector>
00035
00036 namespace glift {
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 class _export_ Shader : public StateGLI,
00051 public MultiTexCoordGen
00052 {
00053 public:
00054 Shader( GenState* genState );
00055 Shader( const VecStateP& genAttribs );
00056 Shader( Texture* tex, GenState* genState=NULL );
00057 Shader( Texture* tex, const VecStateP& genAttribs );
00058 Shader( Texture* tex, ProgShader* progShader, GenState* genState=NULL );
00059 Shader( Texture* tex, ProgShader* progShader, const VecStateP& genAttribs );
00060
00061 Shader( const Shader& rhs );
00062 Shader& operator=( const Shader& rhs );
00063
00064 virtual ~Shader();
00065
00066
00067
00068
00069 virtual MultiTexCoord* genTexCoords( const gutz::arrayw2f& rawTexCoord, const gutz::vec3f& primScale ) const;
00070
00071
00072 int numTexUnits() const {return (m_texture ? m_texture->numTexUnits() : 0); }
00073
00074 protected:
00075 virtual void bindDef();
00076 virtual void releaseDef();
00077
00078 private:
00079 Texture* m_texture;
00080 ProgShader* m_progShader;
00081 VecStateP m_genAttribs;
00082
00083 Shader();
00084 void initMembers( Texture* texturePtr, ProgShader* progShader, const VecStateP& genAttribs );
00085 void initMembers( const Shader& rhs );
00086 void checkTexture();
00087 };
00088
00089 }
00090
00091 #endif