1ALLEGRO_PRIM_STORAGE(3) ALLEGRO_PRIM_STORAGE(3)
2
3
4
6 ALLEGRO_PRIM_STORAGE - Allegro 5 API
7
9 #include <allegro5/allegro_primitives.h>
10
11 typedef enum ALLEGRO_PRIM_STORAGE
12
14 Enumerates the types of storage an attribute of a custom vertex may be
15 stored in. Many of these can only be used for ALLEGRO_PRIM_USER_ATTR
16 attributes and can only be accessed via shaders. Usually no matter
17 what the storage is specified the attribute gets converted to single
18 precision floating point when the shader is run. Despite that, it may
19 be advantageous to use more dense storage formats (e.g. ALLE‐
20 GRO_PRIM_NORMALIZED_UBYTE_4 instead of ALLEGRO_PRIM_FLOAT_4) when band‐
21 width (amount of memory sent to the GPU) is an issue but precision is
22 not.
23
24 • ALLEGRO_PRIM_FLOAT_1 - A single float
25
26 Since: 5.1.6
27
28 • ALLEGRO_PRIM_FLOAT_2 - A doublet of floats
29
30 • ALLEGRO_PRIM_FLOAT_3 - A triplet of floats
31
32 • ALLEGRO_PRIM_FLOAT_4 - A quad of floats
33
34 Since: 5.1.6
35
36 • ALLEGRO_PRIM_SHORT_2 - A doublet of shorts
37
38 • ALLEGRO_PRIM_SHORT_4 - A quad of shorts
39
40 Since: 5.1.6
41
42 • ALLEGRO_PRIM_UBYTE_4 - A quad of unsigned bytes
43
44 Since: 5.1.6
45
46 • ALLEGRO_PRIM_NORMALIZED_SHORT_2 - A doublet of shorts. Before being
47 sent to the shader, each component is divided by 32767. Each compo‐
48 nent of the resultant float doublet ranges between -1.0 and 1.0
49
50 Since: 5.1.6
51
52 • ALLEGRO_PRIM_NORMALIZED_SHORT_4 - A quad of shorts. Before being
53 sent to the shader, each component is divided by 32767. Each compo‐
54 nent of the resultant float quad ranges between -1.0 and 1.0
55
56 Since: 5.1.6
57
58 • ALLEGRO_PRIM_NORMALIZED_UBYTE_4 - A quad of unsigned bytes. Before
59 being sent to the shader, each component is divided by 255. Each
60 component of the resultant float quad ranges between 0.0 and 1.0
61
62 Since: 5.1.6
63
64 • ALLEGRO_PRIM_NORMALIZED_USHORT_2 - A doublet of unsigned shorts. Be‐
65 fore being sent to the shader, each component is divided by 65535.
66 Each component of the resultant float doublet ranges between 0.0 and
67 1.0
68
69 Since: 5.1.6
70
71 • ALLEGRO_PRIM_NORMALIZED_USHORT_4 - A quad of unsigned shorts. Before
72 being sent to the shader, each component is divided by 65535. Each
73 component of the resultant float quad ranges between 0.0 and 1.0
74
75 Since: 5.1.6
76
77 • ALLEGRO_PRIM_HALF_FLOAT_2 - A doublet of half-precision floats. Note
78 that this storage format is not supported on all platforms. al_cre‐
79 ate_vertex_decl(3) will return NULL if you use it on those platforms
80
81 Since: 5.1.6
82
83 • ALLEGRO_PRIM_HALF_FLOAT_4 - A quad of half-precision floats. Note
84 that this storage format is not supported on all platforms. al_cre‐
85 ate_vertex_decl(3) will return NULL if you use it on those platforms.
86
87 Since: 5.1.6
88
90 ALLEGRO_PRIM_ATTR(3)
91
92
93
94Allegro reference manual ALLEGRO_PRIM_STORAGE(3)