Line data Source code
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 0 : template<> inline void byteswap( eq::fabric::Vector2i& value )
41 : {
42 0 : byteswap( value.x( ));
43 0 : byteswap( value.y( ));
44 0 : }
45 :
46 0 : template<> inline void byteswap( eq::fabric::Vector2f& value )
47 : {
48 0 : byteswap( value.x( ));
49 0 : byteswap( value.y( ));
50 0 : }
51 :
52 0 : template<> inline void byteswap( eq::fabric::Vector3f& value )
53 : {
54 0 : byteswap( value.x( ));
55 0 : byteswap( value.y( ));
56 0 : byteswap( value.z( ));
57 0 : }
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 0 : template<> inline void byteswap( eq::fabric::Vector4i& value )
76 : {
77 0 : byteswap( value.x( ));
78 0 : byteswap( value.y( ));
79 0 : byteswap( value.z( ));
80 0 : byteswap( value.w( ));
81 0 : }
82 :
83 : template<> inline void byteswap( eq::fabric::Vector4ub& ) { /*NOP*/ }
84 : template<> inline void byteswap( eq::fabric::Vector3ub& ) { /*NOP*/ }
85 :
86 0 : template<> inline void byteswap( eq::fabric::Matrix4f& value )
87 : {
88 0 : for( size_t i = 0; i < 16; ++i )
89 0 : byteswap( value.array[ i ]);
90 0 : }
91 :
92 0 : template<> inline void byteswap( eq::fabric::Frustumf& value )
93 : {
94 0 : byteswap( value.left( ));
95 0 : byteswap( value.right( ));
96 0 : byteswap( value.bottom( ));
97 0 : byteswap( value.top( ));
98 0 : byteswap( value.nearPlane( ));
99 0 : byteswap( value.farPlane( ));
100 0 : }
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
|