primitives_array.h Source File - ClanLib SDK
Description: primitives_array.h Source File

primitives_array.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27** Harry Storbacka
28** Mark Page
29** Kenneth Gangstoe
30**
31*/
32
33#pragma once
34
35#include <memory>
36#include "../../Core/Math/vec3.h"
37#include "../2D/color.h"
38#include "vertex_array_vector.h"
39
40namespace clan
41{
44
45 class GraphicContext;
46 class Colorf;
47 class Colorf;
48 class GraphicContext;
49 class PrimitivesArray_Impl;
50 class PrimitivesArrayProvider;
51
52 #define cl_offsetof(s,m) (&(((s *)0)->m))
53
55 enum class VertexAttributeDataType
56 {
57 type_unsigned_byte,
58 type_unsigned_short,
59 type_unsigned_int,
60 type_byte,
61 type_short,
62 type_int,
63 type_float
64 };
65
67 class PrimitivesArray
68 {
69 public:
71 PrimitivesArray();
72
76 PrimitivesArray(GraphicContext &gc);
77
78 ~PrimitivesArray();
79
81 bool is_null() const { return !impl; }
82 explicit operator bool() const { return bool(impl); }
83
85 void throw_if_null() const;
86
88 PrimitivesArrayProvider *get_provider() const;
89
99 void set_attributes(int index, VertexArrayBuffer &buffer, int size, VertexAttributeDataType type, size_t offset = 0, int stride = 0, bool normalize = false);
100
101 void set_attributes(int index, VertexArrayVector<unsigned char> &buffer, int size, bool normalize = false)
102 {
103 set_attributes(index, (VertexArrayBuffer&)buffer, size, VertexAttributeDataType::type_unsigned_byte, 0, 0, normalize);
104 }
105
106 void set_attributes(int index, VertexArrayVector<char> &buffer, int size, bool normalize = false)
107 {
108 set_attributes(index, (VertexArrayBuffer&)buffer, size, VertexAttributeDataType::type_byte, 0, 0, normalize);
109 }
110
111 void set_attributes(int index, VertexArrayVector<unsigned short> &buffer, int size, bool normalize = false)
112 {
113 set_attributes(index, (VertexArrayBuffer&)buffer, size, VertexAttributeDataType::type_unsigned_short, 0, 0, normalize);
114 }
115
116 void set_attributes(int index, VertexArrayVector<short> &buffer, int size, bool normalize = false)
117 {
118 set_attributes(index, (VertexArrayBuffer&)buffer, size, VertexAttributeDataType::type_short, 0, 0, normalize);
119 }
120
121 void set_attributes(int index, VertexArrayVector<unsigned int> &buffer, int size, bool normalize = false)
122 {
123 set_attributes(index, (VertexArrayBuffer&)buffer, size, VertexAttributeDataType::type_unsigned_int, 0, 0, normalize);
124 }
125
126 void set_attributes(int index, VertexArrayVector<int> &buffer, int size, bool normalize = false)
127 {
128 set_attributes(index, (VertexArrayBuffer&)buffer, size, VertexAttributeDataType::type_int, 0, 0, normalize);
129 }
130
131 void set_attributes(int index, VertexArrayVector<float> &buffer, int size, bool normalize = false)
132 {
133 set_attributes(index, (VertexArrayBuffer&)buffer, size, VertexAttributeDataType::type_float, 0, 0, normalize);
134 }
135
136 void set_attributes(int index, VertexArrayVector<unsigned char> &buffer, bool normalize = false)
137 {
138 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_unsigned_byte, 0, sizeof(unsigned char), normalize);
139 }
140
141 void set_attributes(int index, VertexArrayVector<signed char> &buffer, bool normalize = false)
142 {
143 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_byte, 0, sizeof(signed char), normalize);
144 }
145
146 void set_attributes(int index, VertexArrayVector<unsigned short> &buffer, bool normalize = false)
147 {
148 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_unsigned_short, 0, sizeof(unsigned short), normalize);
149 }
150
151 void set_attributes(int index, VertexArrayVector<signed short> &buffer, bool normalize = false)
152 {
153 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_short, 0, sizeof(signed short), normalize);
154 }
155
156 void set_attributes(int index, VertexArrayVector<unsigned int> &buffer, bool normalize = false)
157 {
158 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_unsigned_int, 0, sizeof(unsigned int), normalize);
159 }
160
161 void set_attributes(int index, VertexArrayVector<signed int> &buffer, bool normalize = false)
162 {
163 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_int, 0, sizeof(signed int), normalize);
164 }
165
166 void set_attributes(int index, VertexArrayVector<float> &buffer)
167 {
168 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_float, 0, sizeof(float), false);
169 }
170
171 void set_attributes(int index, VertexArrayVector<Vec2ub> &buffer, bool normalize = false)
172 {
173 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_unsigned_byte, 0, sizeof(Vec2ub), normalize);
174 }
175
176 void set_attributes(int index, VertexArrayVector<Vec2b> &buffer, bool normalize = false)
177 {
178 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_byte, 0, sizeof(Vec2b), normalize);
179 }
180
181 void set_attributes(int index, VertexArrayVector<Vec2us> &buffer, bool normalize = false)
182 {
183 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_unsigned_short, 0, sizeof(Vec2us), normalize);
184 }
185
186 void set_attributes(int index, VertexArrayVector<Vec2s> &buffer, bool normalize = false)
187 {
188 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_short, 0, sizeof(Vec2s), normalize);
189 }
190
191 void set_attributes(int index, VertexArrayVector<Vec2ui> &buffer, bool normalize = false)
192 {
193 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_unsigned_int, 0, sizeof(Vec2ui), normalize);
194 }
195
196 void set_attributes(int index, VertexArrayVector<Vec2i> &buffer, bool normalize = false)
197 {
198 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_int, 0, sizeof(Vec2i), normalize);
199 }
200
201 void set_attributes(int index, VertexArrayVector<Vec2f> &buffer)
202 {
203 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_float, 0, sizeof(Vec2f), false);
204 }
205
206 void set_attributes(int index, VertexArrayVector<Vec3ub> &buffer, bool normalize = false)
207 {
208 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_unsigned_byte, 0, sizeof(Vec3ub), normalize);
209 }
210
211 void set_attributes(int index, VertexArrayVector<Vec3b> &buffer, bool normalize = false)
212 {
213 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_byte, 0, sizeof(Vec3b), normalize);
214 }
215
216 void set_attributes(int index, VertexArrayVector<Vec3us> &buffer, bool normalize = false)
217 {
218 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_unsigned_short, 0, sizeof(Vec3us), normalize);
219 }
220
221 void set_attributes(int index, VertexArrayVector<Vec3s> &buffer, bool normalize = false)
222 {
223 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_short, 0, sizeof(Vec3s), normalize);
224 }
225
226 void set_attributes(int index, VertexArrayVector<Vec3ui> &buffer, bool normalize = false)
227 {
228 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_unsigned_int, 0, sizeof(Vec3ui), normalize);
229 }
230
231 void set_attributes(int index, VertexArrayVector<Vec3i> &buffer, bool normalize = false)
232 {
233 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_int, 0, sizeof(Vec3i), normalize);
234 }
235
236 void set_attributes(int index, VertexArrayVector<Vec3f> &buffer)
237 {
238 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_float, 0, sizeof(Vec3f), false);
239 }
240
241 void set_attributes(int index, VertexArrayVector<Vec4ub> &buffer, bool normalize = false)
242 {
243 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_unsigned_byte, 0, sizeof(Vec4ub), normalize);
244 }
245
246 void set_attributes(int index, VertexArrayVector<Vec4b> &buffer, bool normalize = false)
247 {
248 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_byte, 0, sizeof(Vec4b), normalize);
249 }
250
251 void set_attributes(int index, VertexArrayVector<Vec4us> &buffer, bool normalize = false)
252 {
253 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_unsigned_short, 0, sizeof(Vec4us), normalize);
254 }
255
256 void set_attributes(int index, VertexArrayVector<Vec4s> &buffer, bool normalize = false)
257 {
258 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_short, 0, sizeof(Vec4s), normalize);
259 }
260
261 void set_attributes(int index, VertexArrayVector<Vec4ui> &buffer, bool normalize = false)
262 {
263 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_unsigned_int, 0, sizeof(Vec4ui), normalize);
264 }
265
266 void set_attributes(int index, VertexArrayVector<Vec4i> &buffer, bool normalize = false)
267 {
268 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_int, 0, sizeof(Vec4i), normalize);
269 }
270
271 void set_attributes(int index, VertexArrayVector<Vec4f> &buffer)
272 {
273 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_float, 0, sizeof(Vec4f), false);
274 }
275
276 void set_attributes(int index, VertexArrayVector<Colorf> &buffer)
277 {
278 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_float, 0, sizeof(Colorf), false);
279 }
280
281 template<typename Type>
282 void set_attributes(int index, VertexArrayVector<Type> &buffer, unsigned char *member_offset, bool normalize = false)
283 {
284 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_unsigned_byte, (size_t)member_offset, sizeof(Type), normalize);
285 }
286
287 template<typename Type>
288 void set_attributes(int index, VertexArrayVector<Type> &buffer, signed char *member_offset, bool normalize = false)
289 {
290 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_byte, (size_t)member_offset, sizeof(Type), normalize);
291 }
292
293 template<typename Type>
294 void set_attributes(int index, VertexArrayVector<Type> &buffer, unsigned short *member_offset, bool normalize = false)
295 {
296 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_unsigned_short, (size_t)member_offset, sizeof(Type), normalize);
297 }
298
299 template<typename Type>
300 void set_attributes(int index, VertexArrayVector<Type> &buffer, signed short *member_offset, bool normalize = false)
301 {
302 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_short, (size_t)member_offset, sizeof(Type), normalize);
303 }
304
305 template<typename Type>
306 void set_attributes(int index, VertexArrayVector<Type> &buffer, unsigned int *member_offset, bool normalize = false)
307 {
308 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_unsigned_int, (size_t)member_offset, sizeof(Type), normalize);
309 }
310
311 template<typename Type>
312 void set_attributes(int index, VertexArrayVector<Type> &buffer, signed int *member_offset, bool normalize = false)
313 {
314 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_int, (size_t)member_offset, sizeof(Type), normalize);
315 }
316
317 template<typename Type>
318 void set_attributes(int index, VertexArrayVector<Type> &buffer, float *member_offset)
319 {
320 set_attributes(index, (VertexArrayBuffer&)buffer, 1, VertexAttributeDataType::type_float, (size_t)member_offset, sizeof(Type), false);
321 }
322
323 template<typename Type>
324 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec2ub *member_offset, bool normalize = false)
325 {
326 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_unsigned_byte, (size_t)member_offset, sizeof(Type), normalize);
327 }
328
329 template<typename Type>
330 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec2b *member_offset, bool normalize = false)
331 {
332 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_byte, (size_t)member_offset, sizeof(Type), normalize);
333 }
334
335 template<typename Type>
336 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec2us *member_offset, bool normalize = false)
337 {
338 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_unsigned_short, (size_t)member_offset, sizeof(Type), normalize);
339 }
340
341 template<typename Type>
342 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec2s *member_offset, bool normalize = false)
343 {
344 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_short, (size_t)member_offset, sizeof(Type), normalize);
345 }
346
347 template<typename Type>
348 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec2ui *member_offset, bool normalize = false)
349 {
350 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_unsigned_int, (size_t)member_offset, sizeof(Type), normalize);
351 }
352
353 template<typename Type>
354 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec2i *member_offset, bool normalize = false)
355 {
356 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_int, (size_t)member_offset, sizeof(Type), normalize);
357 }
358
359 template<typename Type>
360 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec2f *member_offset)
361 {
362 set_attributes(index, (VertexArrayBuffer&)buffer, 2, VertexAttributeDataType::type_float, (size_t)member_offset, sizeof(Type), false);
363 }
364
365 template<typename Type>
366 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec3ub *member_offset, bool normalize = false)
367 {
368 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_unsigned_byte, (size_t)member_offset, sizeof(Type), normalize);
369 }
370
371 template<typename Type>
372 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec3b *member_offset, bool normalize = false)
373 {
374 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_byte, (size_t)member_offset, sizeof(Type), normalize);
375 }
376
377 template<typename Type>
378 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec3us *member_offset, bool normalize = false)
379 {
380 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_unsigned_short, (size_t)member_offset, sizeof(Type), normalize);
381 }
382
383 template<typename Type>
384 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec3s *member_offset, bool normalize = false)
385 {
386 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_short, (size_t)member_offset, sizeof(Type), normalize);
387 }
388
389 template<typename Type>
390 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec3ui *member_offset, bool normalize = false)
391 {
392 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_unsigned_int, (size_t)member_offset, sizeof(Type), normalize);
393 }
394
395 template<typename Type>
396 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec3i *member_offset, bool normalize = false)
397 {
398 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_int, (size_t)member_offset, sizeof(Type), normalize);
399 }
400
401 template<typename Type>
402 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec3f *member_offset)
403 {
404 set_attributes(index, (VertexArrayBuffer&)buffer, 3, VertexAttributeDataType::type_float, (size_t)member_offset, sizeof(Type), false);
405 }
406
407 template<typename Type>
408 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec4ub *member_offset, bool normalize = false)
409 {
410 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_unsigned_byte, (size_t)member_offset, sizeof(Type), normalize);
411 }
412
413 template<typename Type>
414 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec4b *member_offset, bool normalize = false)
415 {
416 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_byte, (size_t)member_offset, sizeof(Type), normalize);
417 }
418
419 template<typename Type>
420 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec4us *member_offset, bool normalize = false)
421 {
422 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_unsigned_short, (size_t)member_offset, sizeof(Type), normalize);
423 }
424
425 template<typename Type>
426 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec4s *member_offset, bool normalize = false)
427 {
428 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_short, (size_t)member_offset, sizeof(Type), normalize);
429 }
430
431 template<typename Type>
432 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec4ui *member_offset, bool normalize = false)
433 {
434 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_unsigned_int, (size_t)member_offset, sizeof(Type), normalize);
435 }
436
437 template<typename Type>
438 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec4i *member_offset, bool normalize = false)
439 {
440 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_int, (size_t)member_offset, sizeof(Type), normalize);
441 }
442
443 template<typename Type>
444 void set_attributes(int index, VertexArrayVector<Type> &buffer, Vec4f *member_offset)
445 {
446 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_float, (size_t)member_offset, sizeof(Type), false);
447 }
448
449 template<typename Type>
450 void set_attributes(int index, VertexArrayVector<Type> &buffer, Colorf *member_offset)
451 {
452 set_attributes(index, (VertexArrayBuffer&)buffer, 4, VertexAttributeDataType::type_float, (size_t)member_offset, sizeof(Type), false);
453 }
454
455 private:
456 std::shared_ptr<PrimitivesArray_Impl> impl;
457 };
458
460}
clan::Colorf
Floating point color description class (for float).
Definition color.h:799
clan::GraphicContext
Interface to drawing graphics.
Definition graphic_context.h:257
clan::PrimitivesArrayProvider
Interface for implementing a PrimitivesArray target.
Definition primitives_array_provider.h:40
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, signed char *member_offset, bool normalize=false)
Definition primitives_array.h:288
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec3us > &buffer, bool normalize=false)
Definition primitives_array.h:216
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec3ub *member_offset, bool normalize=false)
Definition primitives_array.h:366
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec2us *member_offset, bool normalize=false)
Definition primitives_array.h:336
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< unsigned char > &buffer, int size, bool normalize=false)
Definition primitives_array.h:101
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec4s > &buffer, bool normalize=false)
Definition primitives_array.h:256
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, signed short *member_offset, bool normalize=false)
Definition primitives_array.h:300
clan::PrimitivesArray::PrimitivesArray
PrimitivesArray()
Construct a null instance.
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< signed char > &buffer, bool normalize=false)
Definition primitives_array.h:141
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< float > &buffer)
Definition primitives_array.h:166
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec2ui *member_offset, bool normalize=false)
Definition primitives_array.h:348
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< char > &buffer, int size, bool normalize=false)
Definition primitives_array.h:106
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< unsigned int > &buffer, bool normalize=false)
Definition primitives_array.h:156
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec2s > &buffer, bool normalize=false)
Definition primitives_array.h:186
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec2i *member_offset, bool normalize=false)
Definition primitives_array.h:354
clan::PrimitivesArray::PrimitivesArray
PrimitivesArray(GraphicContext &gc)
Constructs a PrimitivesArray.
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec2us > &buffer, bool normalize=false)
Definition primitives_array.h:181
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec3i > &buffer, bool normalize=false)
Definition primitives_array.h:231
clan::PrimitivesArray::get_provider
PrimitivesArrayProvider * get_provider() const
Returns the target provider for the primitives array.
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec4b > &buffer, bool normalize=false)
Definition primitives_array.h:246
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< unsigned short > &buffer, int size, bool normalize=false)
Definition primitives_array.h:111
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayBuffer &buffer, int size, VertexAttributeDataType type, size_t offset=0, int stride=0, bool normalize=false)
Set attributes.
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec3b > &buffer, bool normalize=false)
Definition primitives_array.h:211
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec4us *member_offset, bool normalize=false)
Definition primitives_array.h:420
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, float *member_offset)
Definition primitives_array.h:318
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, unsigned int *member_offset, bool normalize=false)
Definition primitives_array.h:306
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec3ui > &buffer, bool normalize=false)
Definition primitives_array.h:226
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec3ui *member_offset, bool normalize=false)
Definition primitives_array.h:390
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< signed short > &buffer, bool normalize=false)
Definition primitives_array.h:151
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec4ub > &buffer, bool normalize=false)
Definition primitives_array.h:241
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec2s *member_offset, bool normalize=false)
Definition primitives_array.h:342
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec4us > &buffer, bool normalize=false)
Definition primitives_array.h:251
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec4f *member_offset)
Definition primitives_array.h:444
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< unsigned short > &buffer, bool normalize=false)
Definition primitives_array.h:146
clan::PrimitivesArray::is_null
bool is_null() const
Returns true if this object is invalid.
Definition primitives_array.h:81
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, signed int *member_offset, bool normalize=false)
Definition primitives_array.h:312
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec4ui > &buffer, bool normalize=false)
Definition primitives_array.h:261
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< signed int > &buffer, bool normalize=false)
Definition primitives_array.h:161
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec4f > &buffer)
Definition primitives_array.h:271
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec2ui > &buffer, bool normalize=false)
Definition primitives_array.h:191
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec3i *member_offset, bool normalize=false)
Definition primitives_array.h:396
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< unsigned int > &buffer, int size, bool normalize=false)
Definition primitives_array.h:121
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, unsigned char *member_offset, bool normalize=false)
Definition primitives_array.h:282
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec4ui *member_offset, bool normalize=false)
Definition primitives_array.h:432
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec3f *member_offset)
Definition primitives_array.h:402
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, unsigned short *member_offset, bool normalize=false)
Definition primitives_array.h:294
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec4i > &buffer, bool normalize=false)
Definition primitives_array.h:266
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< int > &buffer, int size, bool normalize=false)
Definition primitives_array.h:126
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec2i > &buffer, bool normalize=false)
Definition primitives_array.h:196
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec3f > &buffer)
Definition primitives_array.h:236
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< short > &buffer, int size, bool normalize=false)
Definition primitives_array.h:116
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec3ub > &buffer, bool normalize=false)
Definition primitives_array.h:206
clan::PrimitivesArray::~PrimitivesArray
~PrimitivesArray()
clan::PrimitivesArray::throw_if_null
void throw_if_null() const
Throw an exception if this object is invalid.
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec4i *member_offset, bool normalize=false)
Definition primitives_array.h:438
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec2ub > &buffer, bool normalize=false)
Definition primitives_array.h:171
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec3s *member_offset, bool normalize=false)
Definition primitives_array.h:384
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< float > &buffer, int size, bool normalize=false)
Definition primitives_array.h:131
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec2ub *member_offset, bool normalize=false)
Definition primitives_array.h:324
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec2b *member_offset, bool normalize=false)
Definition primitives_array.h:330
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec2f *member_offset)
Definition primitives_array.h:360
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec3b *member_offset, bool normalize=false)
Definition primitives_array.h:372
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Colorf > &buffer)
Definition primitives_array.h:276
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec2b > &buffer, bool normalize=false)
Definition primitives_array.h:176
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec2f > &buffer)
Definition primitives_array.h:201
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec4b *member_offset, bool normalize=false)
Definition primitives_array.h:414
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec3us *member_offset, bool normalize=false)
Definition primitives_array.h:378
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec4ub *member_offset, bool normalize=false)
Definition primitives_array.h:408
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Vec4s *member_offset, bool normalize=false)
Definition primitives_array.h:426
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Type > &buffer, Colorf *member_offset)
Definition primitives_array.h:450
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< unsigned char > &buffer, bool normalize=false)
Definition primitives_array.h:136
clan::PrimitivesArray::set_attributes
void set_attributes(int index, VertexArrayVector< Vec3s > &buffer, bool normalize=false)
Definition primitives_array.h:221
clan::VertexArrayBuffer
Vertex Array Buffer.
Definition vertex_array_buffer.h:46
clan::VertexArrayVector
Vertex Array Vector.
Definition vertex_array_vector.h:43
clan::Vec4ub
Vec4< unsigned char > Vec4ub
Definition vec4.h:393
clan::Vec3ub
Vec3< unsigned char > Vec3ub
Definition vec3.h:341
clan::Vec4ui
Vec4< unsigned int > Vec4ui
Definition vec4.h:397
clan::Vec2ui
Vec2< unsigned int > Vec2ui
Definition vec2.h:355
clan::Vec2us
Vec2< unsigned short > Vec2us
Definition vec2.h:353
clan::Vec3us
Vec3< unsigned short > Vec3us
Definition vec3.h:343
clan::Vec4b
Vec4< char > Vec4b
Definition vec4.h:394
clan::Vec4f
Vec4< float > Vec4f
Definition vec4.h:399
clan::Vec3ui
Vec3< unsigned int > Vec3ui
Definition vec3.h:345
clan::Vec2b
Vec2< char > Vec2b
Definition vec2.h:352
clan::Vec3f
Vec3< float > Vec3f
Definition vec3.h:347
clan::Vec2i
Vec2< int > Vec2i
Definition vec2.h:356
clan::Vec4s
Vec4< short > Vec4s
Definition vec4.h:396
clan::Vec4i
Vec4< int > Vec4i
Definition vec4.h:398
clan::Vec3b
Vec3< char > Vec3b
Definition vec3.h:342
clan::Vec2f
Vec2< float > Vec2f
Definition vec2.h:357
clan::Vec2ub
Vec2< unsigned char > Vec2ub
Definition vec2.h:351
clan::Vec3s
Vec3< short > Vec3s
Definition vec3.h:344
clan::Vec2s
Vec2< short > Vec2s
Definition vec2.h:354
clan::Vec3i
Vec3< int > Vec3i
Definition vec3.h:346
clan::Vec4us
Vec4< unsigned short > Vec4us
Definition vec4.h:395
clan::VertexAttributeDataType
VertexAttributeDataType
Primitives array description.
Definition primitives_array.h:56
clan::VertexAttributeDataType::type_float
@ type_float
Definition primitives_array.h:63
clan::VertexAttributeDataType::type_short
@ type_short
Definition primitives_array.h:61
clan::VertexAttributeDataType::type_unsigned_byte
@ type_unsigned_byte
Definition primitives_array.h:57
clan::VertexAttributeDataType::type_int
@ type_int
Definition primitives_array.h:62
clan::VertexAttributeDataType::type_byte
@ type_byte
Definition primitives_array.h:60
clan::VertexAttributeDataType::type_unsigned_short
@ type_unsigned_short
Definition primitives_array.h:58
clan::VertexAttributeDataType::type_unsigned_int
@ type_unsigned_int
Definition primitives_array.h:59
clan
Definition clanapp.h:36