ClanLib
2.3.7
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
Sources
API
Display
Render
primitives_array.h
Go to the documentation of this file.
1
/*
2
** ClanLib SDK
3
** Copyright (c) 1997-2011 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
35
36
#pragma once
37
38
#include "../api_display.h"
39
#include "../../Core/System/sharedptr.h"
40
#include "../../Core/Math/vec3.h"
41
42
class
CL_GraphicContext
;
43
class
CL_Colorf
;
44
class
CL_Colorf
;
45
class
CL_GraphicContext
;
46
class
CL_VertexArrayBuffer
;
47
class
CL_PrimitivesArray_Impl;
48
52
enum
CL_VertexAttributeDataType
53
{
54
cl_type_unsigned_byte
,
55
cl_type_unsigned_short
,
56
cl_type_unsigned_int
,
57
cl_type_byte
,
58
cl_type_short
,
59
cl_type_int
,
60
cl_type_float
61
};
62
68
enum
CL_StandardAttributeIndex
69
{
70
cl_attrib_position
= 0,
71
cl_attrib_color
= 1,
72
cl_attrib_texture_position
= 2,
73
cl_attrib_texture_index
= 3,
74
cl_attrib_normal
= 4
// The normal vector (Currently only used by the GL1 target)
75
};
76
82
class
CL_PrimitivesArray
83
{
86
public
:
88
CL_PrimitivesArray
();
89
93
CL_PrimitivesArray
(
CL_GraphicContext
&gc);
94
95
~CL_PrimitivesArray
();
96
100
public
:
102
bool
is_null
()
const
{
return
!impl; }
103
105
void
throw_if_null
()
const
;
106
107
111
public
:
112
117
void
set_attribute
(
int
index,
const
CL_Vec1ub
&value);
118
123
void
set_attribute
(
int
index,
const
CL_Vec1b
&value);
124
129
void
set_attribute
(
int
index,
const
CL_Vec1us
&value);
130
135
void
set_attribute
(
int
index,
const
CL_Vec1s
&value);
136
141
void
set_attribute
(
int
index,
const
CL_Vec1ui
&value);
142
147
void
set_attribute
(
int
index,
const
CL_Vec1i
&value);
148
153
void
set_attribute
(
int
index,
const
CL_Vec1f
&value);
154
159
void
set_attribute
(
int
index,
const
CL_Vec2ub
&value);
160
165
void
set_attribute
(
int
index,
const
CL_Vec2b
&value);
166
171
void
set_attribute
(
int
index,
const
CL_Vec2us
&value);
172
177
void
set_attribute
(
int
index,
const
CL_Vec2s
&value);
178
183
void
set_attribute
(
int
index,
const
CL_Vec2ui
&value);
184
189
void
set_attribute
(
int
index,
const
CL_Vec2i
&value);
190
195
void
set_attribute
(
int
index,
const
CL_Vec2f
&value);
196
201
void
set_attribute
(
int
index,
const
CL_Vec3ub
&value);
202
207
void
set_attribute
(
int
index,
const
CL_Vec3b
&value);
208
213
void
set_attribute
(
int
index,
const
CL_Vec3us
&value);
214
219
void
set_attribute
(
int
index,
const
CL_Vec3s
&value);
220
225
void
set_attribute
(
int
index,
const
CL_Vec3ui
&value);
226
231
void
set_attribute
(
int
index,
const
CL_Vec3i
&value);
232
237
void
set_attribute
(
int
index,
const
CL_Vec3f
&value);
238
244
void
set_attribute
(
int
index,
const
CL_Vec4ub
&value,
bool
normalize =
false
);
245
251
void
set_attribute
(
int
index,
const
CL_Vec4b
&value,
bool
normalize =
false
);
252
258
void
set_attribute
(
int
index,
const
CL_Vec4us
&value,
bool
normalize =
false
);
259
265
void
set_attribute
(
int
index,
const
CL_Vec4s
&value,
bool
normalize =
false
);
266
272
void
set_attribute
(
int
index,
const
CL_Vec4ui
&value,
bool
normalize =
false
);
273
279
void
set_attribute
(
int
index,
const
CL_Vec4i
&value,
bool
normalize =
false
);
280
285
void
set_attribute
(
int
index,
const
CL_Vec4f
&value);
286
291
void
set_attribute
(
int
index,
const
CL_Colorf
&value);
292
302
void
set_attributes
(
int
index,
CL_VertexArrayBuffer
&buffer,
int
size,
CL_VertexAttributeDataType
type,
void
*offset = 0,
int
stride = 0,
bool
normalize =
false
);
303
309
void
set_attributes
(
int
index,
const
CL_Vec1ub
*
const
values,
int
stride = 0);
310
316
void
set_attributes
(
int
index,
const
CL_Vec1b
*
const
values,
int
stride = 0);
317
323
void
set_attributes
(
int
index,
const
CL_Vec1us
*
const
values,
int
stride = 0);
324
330
void
set_attributes
(
int
index,
const
CL_Vec1s
*
const
values,
int
stride = 0);
331
337
void
set_attributes
(
int
index,
const
CL_Vec1ui
*
const
values,
int
stride = 0);
338
344
void
set_attributes
(
int
index,
const
CL_Vec1i
*
const
values,
int
stride = 0);
345
351
void
set_attributes
(
int
index,
const
CL_Vec1f
*
const
values,
int
stride = 0);
352
358
void
set_attributes
(
int
index,
const
CL_Vec2ub
*
const
values,
int
stride = 0);
359
365
void
set_attributes
(
int
index,
const
CL_Vec2b
*
const
values,
int
stride = 0);
366
372
void
set_attributes
(
int
index,
const
CL_Vec2us
*
const
values,
int
stride = 0);
373
379
void
set_attributes
(
int
index,
const
CL_Vec2s
*
const
values,
int
stride = 0);
380
386
void
set_attributes
(
int
index,
const
CL_Vec2ui
*
const
values,
int
stride = 0);
387
393
void
set_attributes
(
int
index,
const
CL_Vec2i
*
const
values,
int
stride = 0);
394
400
void
set_attributes
(
int
index,
const
CL_Vec2f
*
const
values,
int
stride = 0);
401
407
void
set_attributes
(
int
index,
const
CL_Vec3ub
*
const
values,
int
stride = 0);
408
414
void
set_attributes
(
int
index,
const
CL_Vec3b
*
const
values,
int
stride = 0);
415
421
void
set_attributes
(
int
index,
const
CL_Vec3us
*
const
values,
int
stride = 0);
422
428
void
set_attributes
(
int
index,
const
CL_Vec3s
*
const
values,
int
stride = 0);
429
435
void
set_attributes
(
int
index,
const
CL_Vec3ui
*
const
values,
int
stride = 0);
436
442
void
set_attributes
(
int
index,
const
CL_Vec3i
*
const
values,
int
stride = 0);
443
449
void
set_attributes
(
int
index,
const
CL_Vec3f
*
const
values,
int
stride = 0);
450
457
void
set_attributes
(
int
index,
const
CL_Vec4ub
*
const
values,
int
stride = 0,
bool
normalize =
false
);
458
465
void
set_attributes
(
int
index,
const
CL_Vec4b
*
const
values,
int
stride = 0,
bool
normalize =
false
);
466
473
void
set_attributes
(
int
index,
const
CL_Vec4us
*
const
values,
int
stride = 0,
bool
normalize =
false
);
474
481
void
set_attributes
(
int
index,
const
CL_Vec4s
*
const
values,
int
stride = 0,
bool
normalize =
false
);
482
489
void
set_attributes
(
int
index,
const
CL_Vec4ui
*
const
values,
int
stride = 0,
bool
normalize =
false
);
490
497
void
set_attributes
(
int
index,
const
CL_Vec4i
*
const
values,
int
stride = 0,
bool
normalize =
false
);
498
504
void
set_attributes
(
int
index,
const
CL_Vec4f
*
const
values,
int
stride = 0);
505
509
private
:
510
CL_SharedPtr<CL_PrimitivesArray_Impl> impl;
511
512
friend
class
CL_GraphicContext
;
513
friend
class
CL_PrimitivesArrayBuilder
;
515
};
516
Generated on Fri Jun 14 2013 13:05:46 for ClanLib by
1.8.4