Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLRENDERER_MATERIAL_PARAMETER_H__
00024 #define __PLRENDERER_MATERIAL_PARAMETER_H__
00025 #pragma once
00026
00027
00028
00029
00030
00031 #include "PLRenderer/Renderer/Parameters.h"
00032
00033
00034
00035
00036
00037 namespace PLRenderer {
00038
00039
00040
00041
00042
00043 class Texture;
00044 class Program;
00045 class TextureHandler;
00046 class ParameterManager;
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 class Parameter {
00060
00061
00062
00063
00064
00065 friend class ParameterManager;
00066
00067
00068
00069
00070
00071 public:
00072
00073
00074
00075
00076
00077
00078
00079 inline ParameterManager &GetManager() const;
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 PLRENDERER_API bool SetManagerParameterValue(Parameters &cManager, const PLCore::String &sName) const;
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 PLRENDERER_API bool SetManagerParameterValue(Program &cProgram, const PLCore::String &sName) const;
00108
00109
00110
00111
00112
00113
00114
00115
00116 inline Parameters::EDataType GetType() const;
00117
00118
00119
00120
00121
00122
00123
00124
00125 inline PLCore::String GetName() const;
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 PLRENDERER_API bool SetName(const PLCore::String &sName);
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 PLRENDERER_API PLCore::String GetParameterString() const;
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169 PLRENDERER_API bool SetParameterString(const PLCore::String &sValue);
00170
00171
00172 inline bool GetValue1i(int &nX) const;
00173 inline int GetValue1i() const;
00174 PLRENDERER_API bool SetValue1i(int nX);
00175
00176
00177 inline bool GetValue2i(int &nX, int &nY) const;
00178 inline const int *GetValue2iv() const;
00179 PLRENDERER_API bool SetValue2i(int nX, int nY);
00180 PLRENDERER_API bool SetValue2iv(const int nValue[]);
00181
00182
00183 inline bool GetValue3i(int &nX, int &nY, int &nZ) const;
00184 inline const int *GetValue3iv() const;
00185 PLRENDERER_API bool SetValue3i(int nX, int nY, int nZ);
00186 PLRENDERER_API bool SetValue3iv(const int nValue[]);
00187
00188
00189 inline bool GetValue4i(int &nX, int &nY, int &nZ, int &nW) const;
00190 inline const int *GetValue4iv() const;
00191 PLRENDERER_API bool SetValue4i(int nX, int nY, int nZ, int nW);
00192 PLRENDERER_API bool SetValue4iv(const int nValue[]);
00193
00194
00195 inline bool GetValue1f(float &fX) const;
00196 inline float GetValue1f() const;
00197 PLRENDERER_API bool SetValue1f(float fX);
00198
00199
00200 inline bool GetValue2f(float &fX, float &fY) const;
00201 inline const float *GetValue2fv() const;
00202 PLRENDERER_API bool SetValue2f(float fX, float fY);
00203 PLRENDERER_API bool SetValue2fv(const float fValue[]);
00204
00205
00206 inline bool GetValue3f(float &fX, float &fY, float &fZ) const;
00207 inline const float *GetValue3fv() const;
00208 PLRENDERER_API bool SetValue3f(float fX, float fY, float fZ);
00209 PLRENDERER_API bool SetValue3fv(const float fValue[]);
00210
00211
00212 inline bool GetValue4f(float &fX, float &fY, float &fZ, float &fW) const;
00213 inline const float *GetValue4fv() const;
00214 PLRENDERER_API bool SetValue4f(float fX, float fY, float fZ, float fW);
00215 PLRENDERER_API bool SetValue4fv(const float fValue[]);
00216
00217
00218 inline bool GetValue1d(double &fW) const;
00219 PLRENDERER_API bool SetValue1d(double fW);
00220
00221
00222 inline bool GetValue2d(double &fX, double &fY) const;
00223 inline const double *GetValue2dv() const;
00224 PLRENDERER_API bool SetValue2d(double fX, double fY);
00225 PLRENDERER_API bool SetValue2dv(const double fValue[]);
00226
00227
00228 inline bool GetValue3d(double &fX, double &fY, double &fZ) const;
00229 inline const double *GetValue3dv() const;
00230 PLRENDERER_API bool SetValue3d(double fX, double fY, double fZ);
00231 PLRENDERER_API bool SetValue3dv(const double fValue[]);
00232
00233
00234 inline bool GetValue4d(double &fX, double &fY, double &fZ, double &fW) const;
00235 inline const double *GetValue4dv() const;
00236 PLRENDERER_API bool SetValue4d(double fX, double fY, double fZ, double fW);
00237 PLRENDERER_API bool SetValue4dv(const double fValue[]);
00238
00239
00240 inline const float *GetValueFloat3x3() const;
00241 PLRENDERER_API bool SetValueFloat3x3(const float fValue[]);
00242
00243
00244 inline const float *GetValueFloat3x4() const;
00245 PLRENDERER_API bool SetValueFloat3x4(const float fValue[]);
00246
00247
00248 inline const float *GetValueMatrixfv() const;
00249 PLRENDERER_API bool SetValueMatrixfv(const float fValue[]);
00250
00251
00252 inline const double *GetValueMatrixdv() const;
00253 PLRENDERER_API bool SetValueMatrixdv(const double fValue[]);
00254
00255
00256 PLRENDERER_API Texture *GetValueTexture() const;
00257 PLRENDERER_API TextureBuffer *GetValueTextureBuffer() const;
00258 inline TextureHandler *GetValueTextureHandler() const;
00259 PLRENDERER_API bool SetValueTexture(Texture *pTexture);
00260 PLRENDERER_API bool SetValueTexture(const PLCore::String &sFilename);
00261
00262
00263
00264
00265
00266 private:
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278 Parameter(ParameterManager &cManager, Parameters::EDataType nType, const PLCore::String &sName);
00279
00280
00281
00282
00283
00284 ~Parameter();
00285
00286
00287
00288
00289
00290 private:
00291 ParameterManager *m_pManager;
00292 Parameters::EDataType m_nType;
00293 PLCore::String m_sName;
00294 void *m_pValue;
00295
00296
00297 };
00298
00299
00300
00301
00302
00303 }
00304
00305
00306
00307
00308
00309 #include "PLRenderer/Material/Parameter.inl"
00310
00311
00312 #endif // __PLRENDERER_MATERIAL_PARAMETER_H__