Equalizer  1.8.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
vmmlib.h
1 
2 /* Copyright (c) 2011-2014, 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 using vmml::Matrix3d;
39 using vmml::Matrix4d;
40 using vmml::Matrix3f;
41 using vmml::Matrix4f;
42 using vmml::Vector2i;
43 using vmml::Vector3i;
44 using vmml::Vector4i;
45 using vmml::Vector3d;
46 using vmml::Vector4d;
47 using vmml::Vector2f;
48 using vmml::Vector3f;
49 using vmml::Vector4f;
50 using vmml::Vector3ub;
51 using vmml::Vector4ub;
52 using vmml::Frustumf;
53 using vmml::AABBf;
54 }
55 }
56 
57 namespace lunchbox
58 {
59 template<> inline void byteswap( eq::fabric::Vector2i& value )
60 {
61  byteswap( value.x( ));
62  byteswap( value.y( ));
63 }
64 
65 template<> inline void byteswap( eq::fabric::Vector2f& value )
66 {
67  byteswap( value.x( ));
68  byteswap( value.y( ));
69 }
70 
71 template<> inline void byteswap( eq::fabric::Vector3f& value )
72 {
73  byteswap( value.x( ));
74  byteswap( value.y( ));
75  byteswap( value.z( ));
76 }
77 
78 template<> inline void byteswap( eq::fabric::Vector4f& value )
79 {
80  byteswap( value.x( ));
81  byteswap( value.y( ));
82  byteswap( value.z( ));
83  byteswap( value.w( ));
84 }
85 
86 template<> inline void byteswap( eq::fabric::Vector4i& value )
87 {
88  byteswap( value.x( ));
89  byteswap( value.y( ));
90  byteswap( value.z( ));
91  byteswap( value.w( ));
92 }
93 
94 template<> inline void byteswap( eq::fabric::Vector4ub& ) { /*NOP*/ }
95 template<> inline void byteswap( eq::fabric::Vector3ub& ) { /*NOP*/ }
96 
97 template<> inline void byteswap( eq::fabric::Matrix4f& value )
98 {
99  for( size_t i = 0; i < 16; ++i )
100  byteswap( value.array[ i ]);
101 }
102 
103 template<> inline void byteswap( eq::fabric::Frustumf& value )
104 {
105  byteswap( value.left( ));
106  byteswap( value.right( ));
107  byteswap( value.bottom( ));
108  byteswap( value.top( ));
109  byteswap( value.near_plane( ));
110  byteswap( value.far_plane( ));
111 }
112 
113 template<> inline void byteswap( eq::fabric::AABBf& value )
114 {
115  byteswap( value.getMin( ));
116  byteswap( value.getMax( ));
117 }
118 }
119 
120 #endif // EQFABRIC_VMMLIB_H