ScreenDump: WindowSystems: add screenId in doScreenShot function
[profile/ivi/layer-management.git] / LayerManagerExamples / EGLX11MockNavigation / include / vec.h
1 /***************************************************************************
2  *
3  * Copyright 2010,2011 BMW Car IT GmbH
4  *
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  ****************************************************************************/
19 #ifndef _VEC_H
20 #define _VEC_H
21
22 #include <GLES2/gl2.h>
23
24 template <class T>
25 class vec2
26 {
27 public:
28     vec2()
29     {
30     }
31     
32     vec2(T _x, T _y)
33     : x(_x)
34     , y(_y)
35     {
36     }
37     
38     struct
39     {
40         T x;
41         T y;
42     };
43 };
44
45 template <class T>
46 class vec3
47 {
48 public:
49     vec3()
50     {
51     }
52     
53     vec3(T _x, T _y, T _z)
54     : x(_x)
55     , y(_y)
56     , z(_z)
57     {
58     }
59     
60     union
61     {
62         struct
63         {
64             T x;
65             T y;
66             T z;
67         };
68         struct
69         {
70             T r;
71             T g;
72             T b;
73         };
74     };
75 };
76
77 template <class T>
78 class vec4
79 {
80 public:
81     vec4()
82     {
83     }
84
85     vec4(T _x, T _y, T _z, T _w)
86     : x(_x)
87     , y(_y)
88     , z(_z)
89     , w(_w)
90     {
91     }
92     
93     union
94     {
95         struct
96         {
97             T x;
98             T y;
99             T z;
100             T w;
101         };
102         struct
103         {
104             T r;
105             T g;
106             T b;
107             T a;
108         };
109     };
110 };
111
112 typedef vec2<GLfloat> vec2f;
113 typedef vec2<GLint>   vec2i;
114 typedef vec2<GLuint>  vec2u;
115
116 typedef vec3<GLfloat> vec3f;
117 typedef vec3<GLint>   vec3i;
118 typedef vec3<GLuint>  vec3u;
119
120 typedef vec4<GLfloat> vec4f;
121 typedef vec4<GLint>   vec4i;
122 typedef vec4<GLuint>  vec4u;
123
124 #endif /* _VEC_H */