Equalizer  1.6.1
vmmlib.h
1 
2 /* Copyright (c) 2011-2012, Stefan Eilemann <eile@eyescale.ch>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef EQFABRIC_VMMLIB_H
19 #define EQFABRIC_VMMLIB_H
20 
21 #define VMMLIB_CUSTOM_CONFIG
22 #ifndef NDEBUG
23 # define VMMLIB_SAFE_ACCESSORS
24 #endif
25 #define VMMLIB_ALIGN( var ) var
26 
27 #pragma warning(push)
28 #pragma warning(disable : 4996)
29 # include <vmmlib/vmmlib.hpp>
30 #pragma warning(pop)
31 
32 namespace eq
33 {
34 namespace fabric
35 {
36 typedef vmml::matrix< 3, 3, double > Matrix3d;
37 typedef vmml::matrix< 4, 4, double > Matrix4d;
38 typedef vmml::matrix< 3, 3, float > Matrix3f;
39 typedef vmml::matrix< 4, 4, float > Matrix4f;
40 typedef vmml::vector< 2, int > Vector2i;
41 typedef vmml::vector< 3, int > Vector3i;
42 typedef vmml::vector< 4, int > Vector4i;
43 typedef vmml::vector< 3, double >Vector3d;
44 typedef vmml::vector< 4, double >Vector4d;
45 typedef vmml::vector< 2, float > Vector2f;
46 typedef vmml::vector< 3, float > Vector3f;
47 typedef vmml::vector< 4, float > Vector4f;
48 typedef vmml::vector< 3, uint8_t > Vector3ub;
49 typedef vmml::vector< 4, uint8_t > Vector4ub;
50 typedef vmml::frustum< float > Frustumf;
51 }
52 }
53 
54 namespace lunchbox
55 {
56 template<> inline void byteswap( eq::fabric::Vector2i& value )
57 {
58  byteswap( value.x( ));
59  byteswap( value.y( ));
60 }
61 
62 template<> inline void byteswap( eq::fabric::Vector2f& value )
63 {
64  byteswap( value.x( ));
65  byteswap( value.y( ));
66 }
67 
68 template<> inline void byteswap( eq::fabric::Vector3f& value )
69 {
70  byteswap( value.x( ));
71  byteswap( value.y( ));
72  byteswap( value.z( ));
73 }
74 
75 template<> inline void byteswap( eq::fabric::Vector4f& value )
76 {
77  byteswap( value.x( ));
78  byteswap( value.y( ));
79  byteswap( value.z( ));
80  byteswap( value.w( ));
81 }
82 
83 template<> inline void byteswap( eq::fabric::Vector4i& value )
84 {
85  byteswap( value.x( ));
86  byteswap( value.y( ));
87  byteswap( value.z( ));
88  byteswap( value.w( ));
89 }
90 
91 template<> inline void byteswap( eq::fabric::Vector4ub& ) { /*NOP*/ }
92 template<> inline void byteswap( eq::fabric::Vector3ub& ) { /*NOP*/ }
93 
94 template<> inline void byteswap( eq::fabric::Matrix4f& value )
95 {
96  for( size_t i = 0; i < 16; ++i )
97  byteswap( value.array[ i ]);
98 }
99 
100 template<> inline void byteswap( eq::fabric::Frustumf& value )
101 {
102  byteswap( value.left( ));
103  byteswap( value.right( ));
104  byteswap( value.bottom( ));
105  byteswap( value.top( ));
106  byteswap( value.near_plane( ));
107  byteswap( value.far_plane( ));
108 }
109 }
110 
111 #endif // EQFABRIC_VMMLIB_H
vmml::vector< 3, uint8_t > Vector3ub
A three-component byte vector.
Definition: vmmlib.h:48
vmml::vector< 4, double > Vector4d
A four-component double vector.
Definition: vmmlib.h:44
vmml::vector< 3, int > Vector3i
A three-component integer vector.
Definition: vmmlib.h:41
vmml::vector< 4, int > Vector4i
A four-component integer vector.
Definition: vmmlib.h:42
vmml::vector< 2, float > Vector2f
A two-component float vector.
Definition: vmmlib.h:45
vmml::vector< 3, float > Vector3f
A three-component float vector.
Definition: vmmlib.h:46
vmml::matrix< 3, 3, float > Matrix3f
A 3x3 float matrix.
Definition: vmmlib.h:38
vmml::matrix< 4, 4, float > Matrix4f
A 4x4 float matrix.
Definition: vmmlib.h:39
vmml::vector< 4, uint8_t > Vector4ub
A four-component byte vector.
Definition: vmmlib.h:49
vmml::frustum< float > Frustumf
A frustum definition.
Definition: vmmlib.h:50
vmml::matrix< 4, 4, double > Matrix4d
A 4x4 double matrix.
Definition: vmmlib.h:37
vmml::vector< 4, float > Vector4f
A four-component float vector.
Definition: vmmlib.h:47
vmml::matrix< 3, 3, double > Matrix3d
A 3x3 double matrix.
Definition: vmmlib.h:36
vmml::vector< 3, double > Vector3d
A three-component double vector.
Definition: vmmlib.h:43
vmml::vector< 2, int > Vector2i
A two-component integer vector.
Definition: vmmlib.h:40