Equalizer  1.9.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
drawableConfig.h
1 
2 /* Copyright (c) 2005-2015, Stefan Eilemann <eile@equalizergraphics.com>
3  * Daniel Nachbaur <danielnachbaur@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQ_DRAWABLECONFIG_H
20 #define EQ_DRAWABLECONFIG_H
21 
22 #include <iostream>
23 
24 namespace eq
25 {
26 namespace fabric
27 {
30  {
32  : stencilBits(0), colorBits(0), alphaBits(0), accumBits(0)
33  , glVersion( 0.f ), stereo( false ), doublebuffered( false )
34  , coreProfile( false ) {}
35 
36  int32_t stencilBits;
37  int32_t colorBits;
38  int32_t alphaBits;
39  int32_t accumBits;
40  float glVersion;
41  bool stereo;
43  bool coreProfile;
44  };
45 
46  inline std::ostream& operator << ( std::ostream& os,
47  const DrawableConfig& config )
48  {
49  os << "GL" << config.glVersion;
50  if( config.glVersion >= 3.2f )
51  os << (config.coreProfile ? "|Core" : "|Compat");
52  os << "|rgb" << config.colorBits;
53  if( config.alphaBits )
54  os << "a" << config.alphaBits;
55  if( config.stencilBits )
56  os << "|st" << config.stencilBits;
57  if( config.accumBits )
58  os << "|acc" << config.accumBits;
59  if( config.doublebuffered )
60  os << "|DB";
61  if( config.stereo )
62  os << "|ST";
63  return os;
64  }
65 }
66 }
67 
68 namespace lunchbox
69 {
70 template<> inline void byteswap( eq::fabric::DrawableConfig& value )
71 {
72  byteswap( value.stencilBits );
73  byteswap( value.colorBits );
74  byteswap( value.alphaBits );
75  byteswap( value.accumBits );
76  byteswap( value.glVersion );
77 }
78 }
79 #endif // EQ_DRAWABLECONFIG_H
80 
bool coreProfile
Core or Compat profile (since OpenGL 3.2)
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.