annotate src/vec234.h @ 42:5770a4c85961

Shut up few warnings.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 05 Aug 2013 23:44:59 +0300
parents 785057719d9b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /* ============================================================================
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * Freetype GL - A C OpenGL Freetype engine
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 * Platform: Any
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 * WWW: http://code.google.com/p/freetype-gl/
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 * ----------------------------------------------------------------------------
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 * Copyright 2011,2012,2013 Nicolas P. Rougier. All rights reserved.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 * Redistribution and use in source and binary forms, with or without
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 * modification, are permitted provided that the following conditions are met:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 * 1. Redistributions of source code must retain the above copyright notice,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 * this list of conditions and the following disclaimer.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 * 2. Redistributions in binary form must reproduce the above copyright
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 * notice, this list of conditions and the following disclaimer in the
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 * documentation and/or other materials provided with the distribution.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 * THIS SOFTWARE IS PROVIDED BY NICOLAS P. ROUGIER ''AS IS'' AND ANY EXPRESS OR
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 * EVENT SHALL NICOLAS P. ROUGIER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 * The views and conclusions contained in the software and documentation are
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 * those of the authors and should not be interpreted as representing official
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 * policies, either expressed or implied, of Nicolas P. Rougier.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 * ============================================================================
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 #ifndef __VEC234_H__
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 #define __VEC234_H__
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 #ifdef __cplusplus
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 extern "C" {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 #endif
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 /**
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 * Tuple of 4 ints.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 * Each field can be addressed using several aliases:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 * - First component: <b>x</b>, <b>r</b>, <b>red</b> or <b>vstart</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 * - Second component: <b>y</b>, <b>g</b>, <b>green</b> or <b>vcount</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 * - Third component: <b>z</b>, <b>b</b>, <b>blue</b>, <b>width</b> or <b>istart</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 * - Fourth component: <b>w</b>, <b>a</b>, <b>alpha</b>, <b>height</b> or <b>icount</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 typedef union
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 int data[4]; /**< All compoments at once */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 int x; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 int y; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 int z; /**< Alias for third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 int w; /**< Alias for fourht component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 int x_; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 int y_; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 int width; /**< Alias for third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 int height; /**< Alias for fourth component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 int r; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 int g; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 int b; /**< Alias for third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 int a; /**< Alias for fourth component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 int red; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 int green; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 int blue; /**< Alias for third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 int alpha; /**< Alias for fourth component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 int vstart; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 int vcount; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 int istart; /**< Alias for third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 int icount; /**< Alias for fourth component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 } ivec4;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 /**
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 * Tuple of 3 ints.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 * Each field can be addressed using several aliases:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 * - First component: <b>x</b>, <b>r</b> or <b>red</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 * - Second component: <b>y</b>, <b>g</b> or <b>green</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 * - Third component: <b>z</b>, <b>b</b> or <b>blue</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 typedef union
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 int data[3]; /**< All compoments at once */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 int x; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 int y; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 int z; /**< Alias for third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 int r; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 int g; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108 int b; /**< Alias for third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 int red; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 int green; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 int blue; /**< Alias for third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 } ivec3;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 /**
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 * Tuple of 2 ints.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 * Each field can be addressed using several aliases:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 * - First component: <b>x</b>, <b>s</b> or <b>start</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 * - Second component: <b>y</b>, <b>t</b> or <b>end</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 typedef union
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 int data[2]; /**< All compoments at once */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 int x; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 int y; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 int s; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 int t; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 int start; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 int end; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141 } ivec2;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 /**
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 * Tuple of 4 floats.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 * Each field can be addressed using several aliases:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 * - First component: <b>x</b>, <b>r</b> or <b>red</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 * - Second component: <b>y</b>, <b>g</b> or <b>green</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150 * - Third component: <b>z</b>, <b>b</b>, <b>blue</b> or <b>width</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 * - Fourth component: <b>w</b>, <b>a</b>, <b>alpha</b> or <b>height</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 typedef union
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 float data[4]; /**< All compoments at once */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 float x; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 float y; /**< Alias fo second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 float z; /**< Alias fo third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 float w; /**< Alias fo fourth component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163 float x_; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164 float y_; /**< Alias fo second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 float width; /**< Alias fo third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 float height; /**< Alias fo fourth component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 float r; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 float g; /**< Alias fo second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 float b; /**< Alias fo third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
172 float a; /**< Alias fo fourth component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
173 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 float red; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176 float green; /**< Alias fo second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 float blue; /**< Alias fo third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178 float alpha; /**< Alias fo fourth component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
180 } vec4;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183 /**
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184 * Tuple of 3 floats
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186 * Each field can be addressed using several aliases:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187 * - First component: <b>x</b>, <b>r</b> or <b>red</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188 * - Second component: <b>y</b>, <b>g</b> or <b>green</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 * - Third component: <b>z</b>, <b>b</b> or <b>blue</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191 typedef union
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193 float data[3]; /**< All compoments at once */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
195 float x; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
196 float y; /**< Alias fo second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197 float z; /**< Alias fo third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200 float r; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201 float g; /**< Alias fo second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202 float b; /**< Alias fo third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
203 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
204 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
205 float red; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
206 float green; /**< Alias fo second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
207 float blue; /**< Alias fo third component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
208 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
209 } vec3;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
210
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
211
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212 /**
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
213 * Tuple of 2 floats
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
215 * Each field can be addressed using several aliases:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
216 * - First component: <b>x</b> or <b>s</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
217 * - Second component: <b>y</b> or <b>t</b>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
218 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219 typedef union
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
221 float data[2]; /**< All components at once */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223 float x; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224 float y; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226 struct {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
227 float s; /**< Alias for first component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
228 float t; /**< Alias for second component */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229 };
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230 } vec2;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
231
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
232
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233 #ifdef __cplusplus
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
234 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
235 #endif
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
236
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
237 #endif /* __VEC234_H__ */