Equalizer  1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
drawableConfig.h
1 
2 /* Copyright (c) 2005-2012, Stefan Eilemann <eile@equalizergraphics.com>
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 EQ_DRAWABLECONFIG_H
19 #define EQ_DRAWABLECONFIG_H
20 
21 #include <iostream>
22 
23 namespace eq
24 {
25 namespace fabric
26 {
29  {
31  : stencilBits(0), colorBits(0), alphaBits(0), accumBits(0)
32  , glVersion( 0.f ), stereo( false ), doublebuffered( false ) {}
33 
34  int32_t stencilBits;
35  int32_t colorBits;
36  int32_t alphaBits;
37  int32_t accumBits;
38  float glVersion;
39  bool stereo;
41  };
42 
43  inline std::ostream& operator << ( std::ostream& os,
44  const DrawableConfig& config )
45  {
46  os << "GL" << config.glVersion;
47  os << "|rgb" << config.colorBits;
48  if( config.alphaBits )
49  os << "a" << config.alphaBits;
50  if( config.stencilBits )
51  os << "|st" << config.stencilBits;
52  if( config.accumBits )
53  os << "|acc" << config.accumBits;
54  if( config.doublebuffered )
55  os << "|DB";
56  if( config.stereo )
57  os << "|ST";
58  return os;
59  }
60 }
61 }
62 
63 namespace lunchbox
64 {
65 template<> inline void byteswap( eq::fabric::DrawableConfig& value )
66 {
67  byteswap( value.stencilBits );
68  byteswap( value.colorBits );
69  byteswap( value.alphaBits );
70  byteswap( value.accumBits );
71  byteswap( value.glVersion );
72 }
73 }
74 #endif // EQ_DRAWABLECONFIG_H
75 
int32_t colorBits
Number of bits per color component.
int32_t alphaBits
Number of alpha bits.
bool stereo
Active stereo supported.
int32_t accumBits
Number of accumulation bits.
Stores the characteristics of a window's frame buffer configuration.
float glVersion
OpenGL version.
int32_t stencilBits
Number of stencil bits.
bool doublebuffered
Doublebuffering supported.