Line data Source code
1 :
2 : /* Copyright (c) 2005-2017, 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 : {
28 : /** Stores the characteristics of a window's frame buffer configuration. */
29 : struct DrawableConfig
30 : {
31 3010 : DrawableConfig()
32 3010 : : stencilBits(0)
33 : , colorBits(0)
34 : , alphaBits(0)
35 : , accumBits(0)
36 : , glVersion(0.f)
37 : , glewGLVersion(0.f)
38 : , stereo(false)
39 : , doublebuffered(false)
40 3010 : , coreProfile(false)
41 : {
42 3010 : }
43 :
44 : int32_t stencilBits; //!< Number of stencil bits
45 : int32_t colorBits; //!< Number of bits per color component
46 : int32_t alphaBits; //!< Number of alpha bits
47 : int32_t accumBits; //!< Number of accumulation bits
48 : float glVersion; //!< OpenGL version (glGetString( GL_VERSION ))
49 : float glewGLVersion; //!< OpenGL version (GLEW detected)
50 : bool stereo; //!< Active stereo supported
51 : bool doublebuffered; //!< Doublebuffering supported
52 : bool coreProfile; //!< Core or Compat profile (since OpenGL 3.2)
53 : };
54 :
55 2 : inline std::ostream& operator<<(std::ostream& os, const DrawableConfig& config)
56 : {
57 2 : os << "GL" << config.glVersion << "|GLEW" << config.glewGLVersion;
58 2 : if (config.glVersion >= 3.2f)
59 2 : os << (config.coreProfile ? "|Core" : "|Compat");
60 2 : os << "|rgb" << config.colorBits;
61 2 : if (config.alphaBits)
62 2 : os << "a" << config.alphaBits;
63 2 : if (config.stencilBits)
64 2 : os << "|st" << config.stencilBits;
65 2 : if (config.accumBits)
66 1 : os << "|acc" << config.accumBits;
67 2 : if (config.doublebuffered)
68 1 : os << "|DB";
69 2 : if (config.stereo)
70 0 : os << "|ST";
71 2 : return os;
72 : }
73 : }
74 : }
75 :
76 : #endif // EQ_DRAWABLECONFIG_H
|