1bd2b3e9ed57748dc6ceb57dbf84ba731f9129c7
[TDDC76_proj.git] /
1 ////////////////////////////////////////////////////////////
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
23 ////////////////////////////////////////////////////////////
24
25 #ifndef SFML_CONTEXTSETTINGS_HPP
26 #define SFML_CONTEXTSETTINGS_HPP
27
28
29 namespace sf
30 {
31 ////////////////////////////////////////////////////////////
32 /// \brief Structure defining the settings of the OpenGL
33 /// context attached to a window
34 ///
35 ////////////////////////////////////////////////////////////
36 struct ContextSettings
37 {
38 ////////////////////////////////////////////////////////////
39 /// \brief Default constructor
40 ///
41 /// \param depth Depth buffer bits
42 /// \param stencil Stencil buffer bits
43 /// \param antialiasing Antialiasing level
44 /// \param major Major number of the context version
45 /// \param minor Minor number of the context version
46 ///
47 ////////////////////////////////////////////////////////////
48 explicit ContextSettings(unsigned int depth = 0, unsigned int stencil = 0, unsigned int antialiasing = 0, unsigned int major = 2, unsigned int minor = 0) :
49 depthBits (depth),
50 stencilBits (stencil),
51 antialiasingLevel(antialiasing),
52 majorVersion (major),
53 minorVersion (minor)
54 {
55 }
56
57 ////////////////////////////////////////////////////////////
58 // Member data
59 ////////////////////////////////////////////////////////////
60 unsigned int depthBits; ///< Bits of the depth buffer
61 unsigned int stencilBits; ///< Bits of the stencil buffer
62 unsigned int antialiasingLevel; ///< Level of antialiasing
63 unsigned int majorVersion; ///< Major number of the context version to create
64 unsigned int minorVersion; ///< Minor number of the context version to create
65 };
66
67 } // namespace sf
68
69
70 #endif // SFML_CONTEXTSETTINGS_HPP
71
72
73 ////////////////////////////////////////////////////////////
74 /// \class sf::ContextSettings
75 /// \ingroup window
76 ///
77 /// ContextSettings allows to define several advanced settings
78 /// of the OpenGL context attached to a window. All these
79 /// settings have no impact on the regular SFML rendering
80 /// (graphics module) -- except the anti-aliasing level, so
81 /// you may need to use this structure only if you're using
82 /// SFML as a windowing system for custom OpenGL rendering.
83 ///
84 /// The depthBits and stencilBits members define the number
85 /// of bits per pixel requested for the (respectively) depth
86 /// and stencil buffers.
87 ///
88 /// antialiasingLevel represents the requested number of
89 /// multisampling levels for anti-aliasing.
90 ///
91 /// majorVersion and minorVersion define the version of the
92 /// OpenGL context that you want. Only versions greater or
93 /// equal to 3.0 are relevant; versions lesser than 3.0 are
94 /// all handled the same way (i.e. you can use any version
95 /// < 3.0 if you don't want an OpenGL 3 context).
96 ///
97 /// Please note that these values are only a hint.
98 /// No failure will be reported if one or more of these values
99 /// are not supported by the system; instead, SFML will try to
100 /// find the closest valid match. You can then retrieve the
101 /// settings that the window actually used to create its context,
102 /// with Window::getSettings().
103 ///
104 ////////////////////////////////////////////////////////////