Documentation of SFML 2.2

Warning: this page refers to an old version of SFML. Click here to switch to the latest version.
sf::ContextSettings Class Reference

Structure defining the settings of the OpenGL context attached to a window. More...

#include <ContextSettings.hpp>

Public Member Functions

 ContextSettings (unsigned int depth=0, unsigned int stencil=0, unsigned int antialiasing=0, unsigned int major=2, unsigned int minor=0)
 Default constructor. More...
 

Public Attributes

unsigned int depthBits
 Bits of the depth buffer. More...
 
unsigned int stencilBits
 Bits of the stencil buffer. More...
 
unsigned int antialiasingLevel
 Level of antialiasing. More...
 
unsigned int majorVersion
 Major number of the context version to create. More...
 
unsigned int minorVersion
 Minor number of the context version to create. More...
 

Detailed Description

Structure defining the settings of the OpenGL context attached to a window.

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 (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.

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().

Definition at line 36 of file ContextSettings.hpp.

Constructor & Destructor Documentation

sf::ContextSettings::ContextSettings ( unsigned int  depth = 0,
unsigned int  stencil = 0,
unsigned int  antialiasing = 0,
unsigned int  major = 2,
unsigned int  minor = 0 
)
inlineexplicit

Default constructor.

Parameters
depthDepth buffer bits
stencilStencil buffer bits
antialiasingAntialiasing level
majorMajor number of the context version
minorMinor number of the context version

Definition at line 48 of file ContextSettings.hpp.

Member Data Documentation

unsigned int sf::ContextSettings::antialiasingLevel

Level of antialiasing.

Definition at line 62 of file ContextSettings.hpp.

unsigned int sf::ContextSettings::depthBits

Bits of the depth buffer.

Definition at line 60 of file ContextSettings.hpp.

unsigned int sf::ContextSettings::majorVersion

Major number of the context version to create.

Definition at line 63 of file ContextSettings.hpp.

unsigned int sf::ContextSettings::minorVersion

Minor number of the context version to create.

Definition at line 64 of file ContextSettings.hpp.

unsigned int sf::ContextSettings::stencilBits

Bits of the stencil buffer.

Definition at line 61 of file ContextSettings.hpp.


The documentation for this class was generated from the following file: