00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GLIFT_MULTI_TEXSTATE_H_
00020 #define GLIFT_MULTI_TEXSTATE_H_
00021
00022 #include "texState.h"
00023 #include <vector>
00024
00025 namespace glift {
00026
00027
00028 class MultiTexOState;
00029 class MultiTexUState;
00030 typedef std::vector<MultiTexOState> VecMultiTexOState;
00031 typedef std::vector<MultiTexOState*> VecMultiTexOStateP;
00032 typedef std::vector<MultiTexUState> VecMultiTexUState;
00033 typedef std::vector<MultiTexUState*> VecMultiTexUStateP;
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 class _export_ MultiTexOState : public TexObjState
00053 {
00054 public:
00055 MultiTexOState( const VecTexOStateP& state = VecTexOStateP() );
00056
00057
00058 virtual void bind( GLenum texType ) const;
00059 virtual void release() const;
00060
00061
00062 TexObjState*& operator[] (int i) { return m_state[i]; }
00063 friend inline MultiTexOState& operator<< (MultiTexOState& rhs, TexObjState* state);
00064 friend inline MultiTexOState& operator<< (MultiTexOState& rhs, const TexObjState* state);
00065
00066
00067 int size() const {return m_state.size();}
00068 bool empty() const {return m_state.empty();}
00069
00070 private:
00071 VecTexOStateP m_state;
00072 };
00073
00074
00075
00076
00077 class _export_ MultiTexUState : public TexUnitState
00078 {
00079 public:
00080 MultiTexUState( const VecTexUStateP& state = VecTexUStateP() );
00081 virtual ~MultiTexUState() {}
00082
00083
00084 virtual void bind( GLenum texType ) const;
00085 virtual void release() const;
00086
00087
00088 TexUnitState*& operator[] (int i) { return m_state[i]; }
00089 friend inline MultiTexUState& operator<< (MultiTexUState& rhs, TexUnitState* state);
00090 friend inline MultiTexUState& operator<< (MultiTexUState& rhs, const TexUnitState* state);
00091
00092
00093 int size() const {return m_state.size();}
00094 bool empty() const {return m_state.empty();}
00095
00096 private:
00097 VecTexUStateP m_state;
00098 };
00099
00100 inline MultiTexOState& operator<<( MultiTexOState& rhs, TexObjState* state )
00101 {
00102 rhs.m_state.push_back(state);
00103 return rhs;
00104 }
00105
00106 inline MultiTexOState& operator<<( MultiTexOState& rhs, const TexObjState* state )
00107 {
00108 rhs.m_state.push_back((TexObjState*)state);
00109 return rhs;
00110 }
00111
00112 inline MultiTexUState& operator<<( MultiTexUState& rhs, TexUnitState* state )
00113 {
00114 rhs.m_state.push_back(state);
00115 return rhs;
00116 }
00117
00118 inline MultiTexUState& operator<<( MultiTexUState& rhs, const TexUnitState* state )
00119 {
00120 rhs.m_state.push_back((TexUnitState*)state);
00121 return rhs;
00122 }
00123
00124 }
00125
00126 #endif
00127