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_PARAMETERS_H__
00024 #define __PLRENDERER_PARAMETERS_H__
00025 #pragma once
00026
00027
00028
00029
00030
00031 #include <PLCore/String/String.h>
00032 #include <PLCore/Container/Array.h>
00033 #include <PLCore/Container/HashMap.h>
00034 #include "PLRenderer/PLRenderer.h"
00035
00036
00037
00038
00039
00040 namespace PLRenderer {
00041
00042
00043
00044
00045
00046 class Texture;
00047 class TextureBuffer;
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 class Parameters {
00062
00063
00064
00065
00066
00067 public:
00068
00069
00070
00071
00072 enum EDataType {
00073 String = 0,
00074 Integer = 1,
00075 Integer2 = 2,
00076 Integer3 = 3,
00077 Integer4 = 4,
00078 Float = 5,
00079 Float2 = 6,
00080 Float3 = 7,
00081 Float4 = 8,
00082 Double = 9,
00083 Double2 = 10,
00084 Double3 = 11,
00085 Double4 = 12,
00086 Float3x3 = 13,
00087 Float3x4 = 14,
00088 Float4x4 = 15,
00089 Double4x4 = 16,
00090 TextureBuffer = 17,
00091 UnknownDataType = 18
00092 };
00093
00094
00095
00096
00097
00098 public:
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 static PLRENDERER_API PLCore::String DataTypeToString(EDataType nDataType);
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 static PLRENDERER_API EDataType DataTypeFromString(const PLCore::String &sDataType);
00122
00123
00124
00125
00126
00127 public:
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 virtual bool IsParameter(const PLCore::String &sName) const = 0;
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153 virtual PLCore::String GetParameterString(const PLCore::String &sName) const = 0;
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167 virtual bool SetParameterString(const PLCore::String &sName, const PLCore::String &sValue) = 0;
00168
00169
00170 virtual bool GetParameter1i(const PLCore::String &sName, int &nX) const = 0;
00171 virtual bool SetParameter1i(const PLCore::String &sName, int nX) = 0;
00172
00173 virtual bool GetParameter2i(const PLCore::String &sName, int &nX, int &nY) const = 0;
00174 virtual bool GetParameter2iv(const PLCore::String &sName, int nValue[]) const = 0;
00175 virtual bool SetParameter2i(const PLCore::String &sName, int nX, int nY) = 0;
00176 virtual bool SetParameter2iv(const PLCore::String &sName, const int nValue[]) = 0;
00177
00178 virtual bool GetParameter3i(const PLCore::String &sName, int &nX, int &nY, int &nZ) const = 0;
00179 virtual bool GetParameter3iv(const PLCore::String &sName, int nValue[]) const = 0;
00180 virtual bool SetParameter3i(const PLCore::String &sName, int nX, int nY, int nZ) = 0;
00181 virtual bool SetParameter3iv(const PLCore::String &sName, const int nValue[]) = 0;
00182
00183 virtual bool GetParameter4i(const PLCore::String &sName, int &nX, int &nY, int &nZ, int &nW) const = 0;
00184 virtual bool GetParameter4iv(const PLCore::String &sName, int nValue[]) const = 0;
00185 virtual bool SetParameter4i(const PLCore::String &sName, int nX, int nY, int nZ, int nW) = 0;
00186 virtual bool SetParameter4iv(const PLCore::String &sName, const int nValue[]) = 0;
00187
00188 virtual bool GetParameter1f(const PLCore::String &sName, float &fX) const = 0;
00189 virtual bool SetParameter1f(const PLCore::String &sName, float fX) = 0;
00190
00191 virtual bool GetParameter2f(const PLCore::String &sName, float &fX, float &fY) const = 0;
00192 virtual bool GetParameter2fv(const PLCore::String &sName, float fValue[]) const = 0;
00193 virtual bool SetParameter2f(const PLCore::String &sName, float fX, float fY) = 0;
00194 virtual bool SetParameter2fv(const PLCore::String &sName, const float fValue[]) = 0;
00195
00196 virtual bool GetParameter3f(const PLCore::String &sName, float &fX, float &fY, float &fZ) const = 0;
00197 virtual bool GetParameter3fv(const PLCore::String &sName, float fValue[]) const = 0;
00198 virtual bool SetParameter3f(const PLCore::String &sName, float fX, float fY, float fZ) = 0;
00199 virtual bool SetParameter3fv(const PLCore::String &sName, const float fValue[]) = 0;
00200
00201 virtual bool GetParameter4f(const PLCore::String &sName, float &fX, float &fY, float &fZ, float &fW) const = 0;
00202 virtual bool GetParameter4fv(const PLCore::String &sName, float fValue[]) const = 0;
00203 virtual bool SetParameter4f(const PLCore::String &sName, float fX, float fY, float fZ, float fW) = 0;
00204 virtual bool SetParameter4fv(const PLCore::String &sName, const float fValue[]) = 0;
00205
00206 virtual bool GetParameter1d(const PLCore::String &sName, double &fX) const = 0;
00207 virtual bool SetParameter1d(const PLCore::String &sName, double fX) = 0;
00208
00209 virtual bool GetParameter2d(const PLCore::String &sName, double &fX, double &fY) const = 0;
00210 virtual bool GetParameter2dv(const PLCore::String &sName, double fValue[]) const = 0;
00211 virtual bool SetParameter2d(const PLCore::String &sName, double fX, double fY) = 0;
00212 virtual bool SetParameter2dv(const PLCore::String &sName, const double fValue[]) = 0;
00213
00214 virtual bool GetParameter3d(const PLCore::String &sName, double &fX, double &fY, double &fZ) const = 0;
00215 virtual bool GetParameter3dv(const PLCore::String &sName, double fValue[]) const = 0;
00216 virtual bool SetParameter3d(const PLCore::String &sName, double fX, double fY, double fZ) = 0;
00217 virtual bool SetParameter3dv(const PLCore::String &sName, const double fValue[]) = 0;
00218
00219 virtual bool GetParameter4d(const PLCore::String &sName, double &fX, double &fY, double &fZ, double &fW) const = 0;
00220 virtual bool GetParameter4dv(const PLCore::String &sName, double fValue[]) const = 0;
00221 virtual bool SetParameter4d(const PLCore::String &sName, double fX, double fY, double fZ, double fW) = 0;
00222 virtual bool SetParameter4dv(const PLCore::String &sName, const double fValue[]) = 0;
00223
00224 virtual bool GetParameterFloat3x3(const PLCore::String &sName, float fValue[]) const = 0;
00225 virtual bool SetParameterFloat3x3(const PLCore::String &sName, const float fValue[]) = 0;
00226
00227 virtual bool GetParameterFloat3x4(const PLCore::String &sName, float fValue[]) const = 0;
00228 virtual bool SetParameterFloat3x4(const PLCore::String &sName, const float fValue[]) = 0;
00229
00230 virtual bool GetParameterMatrixfv(const PLCore::String &sName, float fValue[]) const = 0;
00231 virtual bool SetParameterMatrixfv(const PLCore::String &sName, const float fValue[]) = 0;
00232
00233 virtual bool GetParameterMatrixdv(const PLCore::String &sName, double fValue[]) const = 0;
00234 virtual bool SetParameterMatrixdv(const PLCore::String &sName, const double fValue[]) = 0;
00235
00236
00237
00238
00239
00240
00241
00242
00243 virtual PLRenderer::TextureBuffer *GetParameterTextureBuffer(const PLCore::String &sName) const = 0;
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 virtual int SetParameterTextureBuffer(const PLCore::String &sName, PLRenderer::TextureBuffer *pTextureBuffer) = 0;
00258
00259
00260
00261
00262
00263
00264
00265
00266 virtual PLRenderer::Texture *GetParameterTexture(const PLCore::String &sName) const = 0;
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280 virtual int SetParameterTexture(const PLCore::String &sName, const PLCore::String &sFilename) = 0;
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294 virtual int SetParameterTexture(const PLCore::String &sName, PLRenderer::Texture *pTexture) = 0;
00295
00296
00297
00298
00299
00300 protected:
00301
00302
00303
00304
00305 PLRENDERER_API Parameters();
00306
00307
00308
00309
00310
00311 PLRENDERER_API virtual ~Parameters();
00312
00313
00314
00315
00316
00317 private:
00318
00319
00320
00321
00322
00323
00324
00325 Parameters(const Parameters &cSource);
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337 Parameters &operator =(const Parameters &cSource);
00338
00339
00340 };
00341
00342
00343
00344
00345
00346 }
00347
00348
00349 #endif // __PLRENDERER_PARAMETERS_H__