00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _OSGSHADERPARAMETER_H_
00040 #define _OSGSHADERPARAMETER_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044
00045 #include <OSGConfig.h>
00046
00047 #include <OSGShaderParameterBase.h>
00048
00049 OSG_BEGIN_NAMESPACE
00050
00055 class OSG_SYSTEMLIB_DLLMAPPING ShaderParameter : public ShaderParameterBase
00056 {
00057 private:
00058
00059 typedef ShaderParameterBase Inherited;
00060
00061
00062 public:
00063
00064
00068 virtual void changed(BitVector whichField,
00069 UInt32 origin );
00070
00072
00076 virtual void dump( UInt32 uiIndent = 0,
00077 const BitVector bvFlags = 0) const;
00078
00079 inline bool hasChanged(void);
00080 inline void resetChanged(void);
00081
00083
00087 enum SHPType
00088 {
00089 SHPTypeUnknown = 0,
00090 SHPTypeBool,
00091 SHPTypeInt,
00092 SHPTypeReal,
00093 SHPTypeVec2s,
00094 SHPTypeVec3s,
00095 SHPTypeVec4s,
00096 SHPTypeVec2f,
00097 SHPTypeVec3f,
00098 SHPTypeVec4f,
00099 SHPTypeMatrix,
00100 SHPTypeString,
00101 SHPTypeMBool,
00102 SHPTypeMInt,
00103 SHPTypeMReal,
00104 SHPTypeMVec2s,
00105 SHPTypeMVec3s,
00106 SHPTypeMVec4s,
00107 SHPTypeMVec2f,
00108 SHPTypeMVec3f,
00109 SHPTypeMVec4f,
00110 SHPTypeMMatrix,
00111 SHPTypeMString
00112 };
00113
00114 enum SHPFlags
00115 {
00116 SHPFlagNone = 0,
00117 SHPFlagUpdate = 1
00118 };
00119
00120 inline SHPType getTypeId(void);
00121
00122 inline GLint getLocation(void);
00123 inline void setLocation(GLint location);
00124
00125 inline UInt32 getFlags(void);
00126 inline void setFlags(UInt32 flags);
00127
00129
00130 protected:
00131
00132
00133
00134
00138 ShaderParameter(void);
00139 ShaderParameter(const ShaderParameter &source);
00140
00142
00146 virtual ~ShaderParameter(void);
00147
00148 inline void setTypeId(SHPType type);
00149 inline void setChanged(void);
00150
00153
00154 private:
00155
00156 bool _changed;
00157 SHPType _typeid;
00158 GLint _location;
00159 UInt32 _flags;
00160
00161 friend class FieldContainer;
00162 friend class ShaderParameterBase;
00163
00164 static void initMethod(void);
00165
00166
00167
00168 void operator =(const ShaderParameter &source);
00169 };
00170
00171 typedef ShaderParameter *ShaderParameterP;
00172
00173 OSG_END_NAMESPACE
00174
00175 #include <OSGShaderParameterBase.inl>
00176 #include <OSGShaderParameter.inl>
00177
00178 #define OSGSHADERPARAMETER_HEADER_CVSID "@(#)$Id: OSGShaderParameter.h,v 1.7 2007/03/09 18:11:48 a-m-z Exp $"
00179
00180 #endif