Equalizer  1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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 #include <lunchbox/bitOperation.h>
33 
34 namespace eq
35 {
36 namespace fabric
37 {
38 typedef vmml::matrix< 3, 3, double > Matrix3d;
39 typedef vmml::matrix< 4, 4, double > Matrix4d;
40 typedef vmml::matrix< 3, 3, float > Matrix3f;
41 typedef vmml::matrix< 4, 4, float > Matrix4f;
42 typedef vmml::vector< 2, int > Vector2i;
43 typedef vmml::vector< 3, int > Vector3i;
44 typedef vmml::vector< 4, int > Vector4i;
45 typedef vmml::vector< 3, double >Vector3d;
46 typedef vmml::vector< 4, double >Vector4d;
47 typedef vmml::vector< 2, float > Vector2f;
48 typedef vmml::vector< 3, float > Vector3f;
49 typedef vmml::vector< 4, float > Vector4f;
50 typedef vmml::vector< 3, uint8_t > Vector3ub;
51 typedef vmml::vector< 4, uint8_t > Vector4ub;
52 typedef vmml::frustum< float > Frustumf;
53 }
54 }
55 
56 namespace lunchbox
57 {
58 template<> inline void byteswap( eq::fabric::Vector2i& value )
59 {
60  byteswap( value.x( ));
61  byteswap( value.y( ));
62 }
63 
64 template<> inline void byteswap( eq::fabric::Vector2f& value )
65 {
66  byteswap( value.x( ));
67  byteswap( value.y( ));
68 }
69 
70 template<> inline void byteswap( eq::fabric::Vector3f& value )
71 {
72  byteswap( value.x( ));
73  byteswap( value.y( ));
74  byteswap( value.z( ));
75 }
76 
77 template<> inline void byteswap( eq::fabric::Vector4f& value )
78 {
79  byteswap( value.x( ));
80  byteswap( value.y( ));
81  byteswap( value.z( ));
82  byteswap( value.w( ));
83 }
84 
85 template<> inline void byteswap( eq::fabric::Vector4i& value )
86 {
87  byteswap( value.x( ));
88  byteswap( value.y( ));
89  byteswap( value.z( ));
90  byteswap( value.w( ));
91 }
92 
93 template<> inline void byteswap( eq::fabric::Vector4ub& ) { /*NOP*/ }
94 template<> inline void byteswap( eq::fabric::Vector3ub& ) { /*NOP*/ }
95 
96 template<> inline void byteswap( eq::fabric::Matrix4f& value )
97 {
98  for( size_t i = 0; i < 16; ++i )
99  byteswap( value.array[ i ]);
100 }
101 
102 template<> inline void byteswap( eq::fabric::Frustumf& value )
103 {
104  byteswap( value.left( ));
105  byteswap( value.right( ));
106  byteswap( value.bottom( ));
107  byteswap( value.top( ));
108  byteswap( value.near_plane( ));
109  byteswap( value.far_plane( ));
110 }
111 }
112 
113 #endif // EQFABRIC_VMMLIB_H
vmml::vector< 3, uint8_t > Vector3ub
A three-component byte vector.
Definition: vmmlib.h:50
vmml::vector< 4, double > Vector4d
A four-component double vector.
Definition: vmmlib.h:46
vmml::vector< 3, int > Vector3i
A three-component integer vector.
Definition: vmmlib.h:43
vmml::vector< 4, int > Vector4i
A four-component integer vector.
Definition: vmmlib.h:44
vmml::vector< 2, float > Vector2f
A two-component float vector.
Definition: vmmlib.h:47
vmml::vector< 3, float > Vector3f
A three-component float vector.
Definition: vmmlib.h:48
vmml::matrix< 3, 3, float > Matrix3f
A 3x3 float matrix.
Definition: vmmlib.h:40
vmml::matrix< 4, 4, float > Matrix4f
A 4x4 float matrix.
Definition: vmmlib.h:41
vmml::vector< 4, uint8_t > Vector4ub
A four-component byte vector.
Definition: vmmlib.h:51
vmml::frustum< float > Frustumf
A frustum definition.
Definition: vmmlib.h:52
vmml::matrix< 4, 4, double > Matrix4d
A 4x4 double matrix.
Definition: vmmlib.h:39
vmml::vector< 4, float > Vector4f
A four-component float vector.
Definition: vmmlib.h:49
vmml::matrix< 3, 3, double > Matrix3d
A 3x3 double matrix.
Definition: vmmlib.h:38
vmml::vector< 3, double > Vector3d
A three-component double vector.
Definition: vmmlib.h:45
vmml::vector< 2, int > Vector2i
A two-component integer vector.
Definition: vmmlib.h:42