1ALLEGRO_PRIM_ATTR(3) ALLEGRO_PRIM_ATTR(3)
2
3
4
6 ALLEGRO_PRIM_ATTR - Allegro 5 API
7
9 #include <allegro5/allegro_primitives.h>
10
11 typedef enum ALLEGRO_PRIM_ATTR
12
14 Enumerates the types of vertex attributes that a custom vertex may
15 have.
16
17 · ALLEGRO_PRIM_POSITION - Position information, can be stored only in
18 ALLEGRO_PRIM_SHORT_2, ALLEGRO_PRIM_FLOAT_2 and ALLEGRO_PRIM_FLOAT_3.
19
20 · ALLEGRO_PRIM_COLOR_ATTR - Color information, stored in an ALLE‐
21 GRO_COLOR(3). The storage field of ALLEGRO_VERTEX_ELEMENT is ignored
22
23 · ALLEGRO_PRIM_TEX_COORD - Texture coordinate information, can be
24 stored only in ALLEGRO_PRIM_FLOAT_2 and ALLEGRO_PRIM_SHORT_2. These
25 coordinates are normalized by the width and height of the texture,
26 meaning that the bottom-right corner has texture coordinates of (1,
27 1).
28
29 · ALLEGRO_PRIM_TEX_COORD_PIXEL - Texture coordinate information, can be
30 stored only in ALLEGRO_PRIM_FLOAT_2 and ALLEGRO_PRIM_SHORT_2. These
31 coordinates are measured in pixels.
32
33 · ALLEGRO_PRIM_USER_ATTR - A user specified attribute. You can use any
34 storage for this attribute. You may have at most ALLE‐
35 GRO_PRIM_MAX_USER_ATTR (currently 10) of these that you can specify
36 by adding an index to the value of ALLEGRO_PRIM_USER_ATTR, e.g. the
37 first user attribute is ALLEGRO_PRIM_USER_ATTR + 0, the second is AL‐
38 LEGRO_PRIM_USER_ATTR + 1 and so on.
39
40 To access these custom attributes from GLSL shaders you need to de‐
41 clare attributes that follow this nomenclature: user_attr_# where #
42 is the index of the attribute.
43
44 To access these custom attributes from HLSL you need to declare a pa‐
45 rameter with the following semantics: TEXCOORD{# + 2} where # is the
46 index of the attribute. E.g. the first attribute can be accessed
47 via TEXCOORD2, second via TEXCOORD3 and so on.
48
49 Since: 5.1.6
50
52 ALLEGRO_VERTEX_DECL(3), ALLEGRO_PRIM_STORAGE(3)
53
54
55
56Allegro reference manual ALLEGRO_PRIM_ATTR(3)