1 ////////////////////////////////////////////////////////////
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
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.
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:
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.
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
21 // 3. This notice may not be removed or altered from any source distribution.
23 ////////////////////////////////////////////////////////////
25 #ifndef SFML_CONTEXTSETTINGS_HPP
26 #define SFML_CONTEXTSETTINGS_HPP
31 ////////////////////////////////////////////////////////////
32 /// \brief Structure defining the settings of the OpenGL
33 /// context attached to a window
35 ////////////////////////////////////////////////////////////
36 struct ContextSettings
38 ////////////////////////////////////////////////////////////
39 /// \brief Default constructor
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
47 ////////////////////////////////////////////////////////////
48 explicit ContextSettings(unsigned int depth = 0, unsigned int stencil = 0, unsigned int antialiasing = 0, unsigned int major = 2, unsigned int minor = 0) :
50 stencilBits (stencil),
51 antialiasingLevel(antialiasing),
57 ////////////////////////////////////////////////////////////
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
70 #endif // SFML_CONTEXTSETTINGS_HPP
73 ////////////////////////////////////////////////////////////
74 /// \class sf::ContextSettings
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.
84 /// The depthBits and stencilBits members define the number
85 /// of bits per pixel requested for the (respectively) depth
86 /// and stencil buffers.
88 /// antialiasingLevel represents the requested number of
89 /// multisampling levels for anti-aliasing.
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).
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().
104 ////////////////////////////////////////////////////////////