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
00035
00036 #pragma once
00037
00038 #include "../api_display.h"
00039 #include "../../Core/System/sharedptr.h"
00040 #include "../../Core/Math/vec3.h"
00041
00042 class CL_GraphicContext;
00043 class CL_Colorf;
00044 class CL_Colorf;
00045 class CL_GraphicContext;
00046 class CL_VertexArrayBuffer;
00047 class CL_PrimitivesArray_Impl;
00048
00052 enum CL_VertexAttributeDataType
00053 {
00054 cl_type_unsigned_byte,
00055 cl_type_unsigned_short,
00056 cl_type_unsigned_int,
00057 cl_type_byte,
00058 cl_type_short,
00059 cl_type_int,
00060 cl_type_float
00061 };
00062
00066 class CL_PrimitivesArray
00067 {
00070 public:
00071 CL_PrimitivesArray();
00072
00076 CL_PrimitivesArray(CL_GraphicContext &gc);
00077
00078 ~CL_PrimitivesArray();
00079
00083 public:
00085 bool is_null() const;
00086
00090 public:
00091
00096 void set_attribute(int index, const CL_Vec1ub &value);
00097
00102 void set_attribute(int index, const CL_Vec1b &value);
00103
00108 void set_attribute(int index, const CL_Vec1us &value);
00109
00114 void set_attribute(int index, const CL_Vec1s &value);
00115
00120 void set_attribute(int index, const CL_Vec1ui &value);
00121
00126 void set_attribute(int index, const CL_Vec1i &value);
00127
00132 void set_attribute(int index, const CL_Vec1f &value);
00133
00138 void set_attribute(int index, const CL_Vec2ub &value);
00139
00144 void set_attribute(int index, const CL_Vec2b &value);
00145
00150 void set_attribute(int index, const CL_Vec2us &value);
00151
00156 void set_attribute(int index, const CL_Vec2s &value);
00157
00162 void set_attribute(int index, const CL_Vec2ui &value);
00163
00168 void set_attribute(int index, const CL_Vec2i &value);
00169
00174 void set_attribute(int index, const CL_Vec2f &value);
00175
00180 void set_attribute(int index, const CL_Vec3ub &value);
00181
00186 void set_attribute(int index, const CL_Vec3b &value);
00187
00192 void set_attribute(int index, const CL_Vec3us &value);
00193
00198 void set_attribute(int index, const CL_Vec3s &value);
00199
00204 void set_attribute(int index, const CL_Vec3ui &value);
00205
00210 void set_attribute(int index, const CL_Vec3i &value);
00211
00216 void set_attribute(int index, const CL_Vec3f &value);
00217
00223 void set_attribute(int index, const CL_Vec4ub &value, bool normalize = false);
00224
00230 void set_attribute(int index, const CL_Vec4b &value, bool normalize = false);
00231
00237 void set_attribute(int index, const CL_Vec4us &value, bool normalize = false);
00238
00244 void set_attribute(int index, const CL_Vec4s &value, bool normalize = false);
00245
00251 void set_attribute(int index, const CL_Vec4ui &value, bool normalize = false);
00252
00258 void set_attribute(int index, const CL_Vec4i &value, bool normalize = false);
00259
00264 void set_attribute(int index, const CL_Vec4f &value);
00265
00270 void set_attribute(int index, const CL_Colorf &value);
00271
00281 void set_attributes(int index, CL_VertexArrayBuffer &buffer, int size, CL_VertexAttributeDataType type, void *offset = 0, int stride = 0, bool normalize = false);
00282
00288 void set_attributes(int index, const CL_Vec1ub * const values, int stride = 0);
00289
00295 void set_attributes(int index, const CL_Vec1b * const values, int stride = 0);
00296
00302 void set_attributes(int index, const CL_Vec1us * const values, int stride = 0);
00303
00309 void set_attributes(int index, const CL_Vec1s * const values, int stride = 0);
00310
00316 void set_attributes(int index, const CL_Vec1ui * const values, int stride = 0);
00317
00323 void set_attributes(int index, const CL_Vec1i * const values, int stride = 0);
00324
00330 void set_attributes(int index, const CL_Vec1f * const values, int stride = 0);
00331
00337 void set_attributes(int index, const CL_Vec2ub * const values, int stride = 0);
00338
00344 void set_attributes(int index, const CL_Vec2b * const values, int stride = 0);
00345
00351 void set_attributes(int index, const CL_Vec2us * const values, int stride = 0);
00352
00358 void set_attributes(int index, const CL_Vec2s * const values, int stride = 0);
00359
00365 void set_attributes(int index, const CL_Vec2ui * const values, int stride = 0);
00366
00372 void set_attributes(int index, const CL_Vec2i * const values, int stride = 0);
00373
00379 void set_attributes(int index, const CL_Vec2f * const values, int stride = 0);
00380
00386 void set_attributes(int index, const CL_Vec3ub * const values, int stride = 0);
00387
00393 void set_attributes(int index, const CL_Vec3b * const values, int stride = 0);
00394
00400 void set_attributes(int index, const CL_Vec3us * const values, int stride = 0);
00401
00407 void set_attributes(int index, const CL_Vec3s * const values, int stride = 0);
00408
00414 void set_attributes(int index, const CL_Vec3ui * const values, int stride = 0);
00415
00421 void set_attributes(int index, const CL_Vec3i * const values, int stride = 0);
00422
00428 void set_attributes(int index, const CL_Vec3f * const values, int stride = 0);
00429
00436 void set_attributes(int index, const CL_Vec4ub * const values, int stride = 0, bool normalize = false);
00437
00444 void set_attributes(int index, const CL_Vec4b * const values, int stride = 0, bool normalize = false);
00445
00452 void set_attributes(int index, const CL_Vec4us * const values, int stride = 0, bool normalize = false);
00453
00460 void set_attributes(int index, const CL_Vec4s * const values, int stride = 0, bool normalize = false);
00461
00468 void set_attributes(int index, const CL_Vec4ui * const values, int stride = 0, bool normalize = false);
00469
00476 void set_attributes(int index, const CL_Vec4i * const values, int stride = 0, bool normalize = false);
00477
00483 void set_attributes(int index, const CL_Vec4f * const values, int stride = 0);
00484
00488 private:
00489 CL_SharedPtr<CL_PrimitivesArray_Impl> impl;
00490
00491 friend class CL_GraphicContext;
00492 friend class CL_PrimitivesArrayBuilder;
00494 };
00495