Equalizer  1.13.0
Parallel Rendering Framework
vmmlib.h
1 
2 /* Copyright (c) 2011-2016, 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 #include <eq/fabric/types.h>
22 #include <lunchbox/bitOperation.h>
23 
24 #pragma warning(push)
25 #pragma warning(disable : 4996)
26 # include <vmmlib/aabb.hpp>
27 # include <vmmlib/frustum.hpp>
28 # include <vmmlib/matrix.hpp>
29 # include <vmmlib/vector.hpp>
30 #pragma warning(pop)
31 
32 namespace lunchbox
33 {
34 template<> inline void byteswap( eq::fabric::Vector2ui& value )
35 {
36  byteswap( value.x( ));
37  byteswap( value.y( ));
38 }
39 
40 template<> inline void byteswap( eq::fabric::Vector2i& value )
41 {
42  byteswap( value.x( ));
43  byteswap( value.y( ));
44 }
45 
46 template<> inline void byteswap( eq::fabric::Vector2f& value )
47 {
48  byteswap( value.x( ));
49  byteswap( value.y( ));
50 }
51 
52 template<> inline void byteswap( eq::fabric::Vector3f& value )
53 {
54  byteswap( value.x( ));
55  byteswap( value.y( ));
56  byteswap( value.z( ));
57 }
58 
59 template<> inline void byteswap( eq::fabric::Vector4f& value )
60 {
61  byteswap( value.x( ));
62  byteswap( value.y( ));
63  byteswap( value.z( ));
64  byteswap( value.w( ));
65 }
66 
67 template<> inline void byteswap( eq::fabric::Vector4ui& value )
68 {
69  byteswap( value.x( ));
70  byteswap( value.y( ));
71  byteswap( value.z( ));
72  byteswap( value.w( ));
73 }
74 
75 template<> inline void byteswap( eq::fabric::Vector4i& 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::Vector4ub& ) { /*NOP*/ }
84 template<> inline void byteswap( eq::fabric::Vector3ub& ) { /*NOP*/ }
85 
86 template<> inline void byteswap( eq::fabric::Matrix4f& value )
87 {
88  for( size_t i = 0; i < 16; ++i )
89  byteswap( value.array[ i ]);
90 }
91 
92 template<> inline void byteswap( eq::fabric::Frustumf& value )
93 {
94  byteswap( value.left( ));
95  byteswap( value.right( ));
96  byteswap( value.bottom( ));
97  byteswap( value.top( ));
98  byteswap( value.nearPlane( ));
99  byteswap( value.farPlane( ));
100 }
101 
102 template<> inline void byteswap( eq::fabric::AABBf& value )
103 {
104  byteswap( value._min );
105  byteswap( value._max );
106 }
107 }
108 
109 #endif // EQFABRIC_VMMLIB_H