primitives_array.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 **    Harry Storbacka
00028 **    Mark Page
00029 **    Kenneth Gangstoe
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 

Generated on Thu Dec 3 02:39:30 2009 for ClanLib by  doxygen 1.4.6