2009-01-29 00:18:34 +08:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// SFML - Simple and Fast Multimedia Library
|
2009-02-13 01:48:35 +08:00
|
|
|
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
|
2009-01-29 00:18:34 +08:00
|
|
|
//
|
|
|
|
// This software is provided 'as-is', without any express or implied warranty.
|
|
|
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
|
|
|
//
|
|
|
|
// Permission is granted to anyone to use this software for any purpose,
|
|
|
|
// including commercial applications, and to alter it and redistribute it freely,
|
|
|
|
// subject to the following restrictions:
|
|
|
|
//
|
|
|
|
// 1. The origin of this software must not be misrepresented;
|
|
|
|
// you must not claim that you wrote the original software.
|
|
|
|
// If you use this software in a product, an acknowledgment
|
|
|
|
// in the product documentation would be appreciated but is not required.
|
|
|
|
//
|
|
|
|
// 2. Altered source versions must be plainly marked as such,
|
|
|
|
// and must not be misrepresented as being the original software.
|
|
|
|
//
|
|
|
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
2009-03-29 00:22:58 +08:00
|
|
|
#ifndef SFML_CONTEXTSETTINGS_HPP
|
|
|
|
#define SFML_CONTEXTSETTINGS_HPP
|
2009-01-29 00:18:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
namespace sf
|
|
|
|
{
|
|
|
|
////////////////////////////////////////////////////////////
|
2009-10-15 16:37:32 +08:00
|
|
|
/// \brief Structure defining the settings of the OpenGL
|
|
|
|
/// context attached to a window
|
2009-11-03 23:13:11 +08:00
|
|
|
///
|
2009-01-29 00:18:34 +08:00
|
|
|
////////////////////////////////////////////////////////////
|
2009-03-29 00:22:58 +08:00
|
|
|
struct ContextSettings
|
2009-01-29 00:18:34 +08:00
|
|
|
{
|
|
|
|
////////////////////////////////////////////////////////////
|
2009-10-15 16:37:32 +08:00
|
|
|
/// \brief Default constructor
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
2009-10-15 16:37:32 +08:00
|
|
|
/// \param depth Depth buffer bits
|
|
|
|
/// \param stencil Stencil buffer bits
|
|
|
|
/// \param antialiasing Antialiasing level
|
2009-11-03 23:13:11 +08:00
|
|
|
/// \param major Major number of the context version
|
|
|
|
/// \param minor Minor number of the context version
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
////////////////////////////////////////////////////////////
|
2011-04-04 14:20:03 +08:00
|
|
|
explicit ContextSettings(unsigned int depth = 0, unsigned int stencil = 0, unsigned int antialiasing = 0, unsigned int major = 2, unsigned int minor = 0) :
|
2009-07-12 06:17:24 +08:00
|
|
|
DepthBits (depth),
|
|
|
|
StencilBits (stencil),
|
2009-11-03 23:13:11 +08:00
|
|
|
AntialiasingLevel(antialiasing),
|
|
|
|
MajorVersion (major),
|
|
|
|
MinorVersion (minor)
|
2009-01-29 00:18:34 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// Member data
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
unsigned int DepthBits; ///< Bits of the depth buffer
|
|
|
|
unsigned int StencilBits; ///< Bits of the stencil buffer
|
|
|
|
unsigned int AntialiasingLevel; ///< Level of antialiasing
|
2009-11-03 23:13:11 +08:00
|
|
|
unsigned int MajorVersion; ///< Major number of the context version to create
|
|
|
|
unsigned int MinorVersion; ///< Minor number of the context version to create
|
2009-01-29 00:18:34 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace sf
|
|
|
|
|
|
|
|
|
2009-03-29 00:22:58 +08:00
|
|
|
#endif // SFML_CONTEXTSETTINGS_HPP
|
2009-11-03 23:13:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
/// \class sf::ContextSettings
|
2010-07-23 05:45:58 +08:00
|
|
|
/// \ingroup window
|
2009-11-03 23:13:11 +08:00
|
|
|
///
|
|
|
|
/// ContextSettings allows to define several advanced settings
|
|
|
|
/// of the OpenGL context attached to a window. All these
|
|
|
|
/// settings have no impact on the regular SFML rendering
|
2010-05-22 03:13:50 +08:00
|
|
|
/// (graphics module) -- except the anti-aliasing level, so
|
|
|
|
/// you may need to use this structure only if you're using
|
|
|
|
/// SFML as a windowing system for custom OpenGL rendering.
|
2009-11-03 23:13:11 +08:00
|
|
|
///
|
|
|
|
/// The DepthBits and StencilBits members define the number
|
|
|
|
/// of bits per pixel requested for the (respectively) depth
|
|
|
|
/// and stencil buffers.
|
|
|
|
///
|
|
|
|
/// AntialiasingLevel represents the requested number of
|
|
|
|
/// multisampling levels for anti-aliasing.
|
|
|
|
///
|
|
|
|
/// MajorVersion and MinorVersion define the version of the
|
|
|
|
/// OpenGL context that you want. Only versions greater or
|
|
|
|
/// equal to 3.0 are relevant; versions lesser than 3.0 are
|
|
|
|
/// all handled the same way (i.e. you can use any version
|
|
|
|
/// < 3.0 if you don't want an OpenGL 3 context).
|
|
|
|
///
|
|
|
|
/// Please note that these values are only a hint.
|
|
|
|
/// No failure will be reported if one or more of these values
|
|
|
|
/// are not supported by the system; instead, SFML will try to
|
|
|
|
/// find the closest valid match. You can then retrieve the
|
|
|
|
/// settings that the window actually used to create its context,
|
|
|
|
/// with Window::GetSettings().
|
|
|
|
///
|
|
|
|
////////////////////////////////////////////////////////////
|