Magnum::Platform::GlfwApplication::GLConfiguration class

OpenGL context configuration.

Contents

The created window is always with double-buffered OpenGL context.

Public types

enum class Flag: UnsignedByte { ForwardCompatible = 1 << 0, NoError = 1 << 1, Debug = 1 << 2, Stereo = 1 << 3 }
Context flag.
using Flags = Containers::EnumSet<Flag>
Context flags.

Public functions

auto flags() const -> Flags
Context flags.
auto setFlags(Flags flags) -> GLConfiguration&
Set context flags.
auto addFlags(Flags flags) -> GLConfiguration&
Add context flags.
auto clearFlags(Flags flags) -> GLConfiguration&
Clear context flags.
auto version() const -> GL::Version
Context version.
auto setVersion(GL::Version version) -> GLConfiguration&
Set context version.
auto colorBufferSize() const -> Vector4i
Color buffer size.
auto setColorBufferSize(const Vector4i& size) -> GLConfiguration&
Set color buffer size.
auto depthBufferSize() const -> Int
Depth buffer size.
auto setDepthBufferSize(Int size) -> GLConfiguration&
Set depth buffer size.
auto stencilBufferSize() const -> Int
Stencil buffer size.
auto setStencilBufferSize(Int size) -> GLConfiguration&
Set stencil buffer size.
auto sampleCount() const -> Int
Sample count.
auto setSampleCount(Int count) -> GLConfiguration&
Set sample count.
auto isSrgbCapable() const -> bool
sRGB-capable default framebuffer
auto setSrgbCapable(bool enabled) -> GLConfiguration&
Set sRGB-capable default framebuffer.
auto isSRGBCapable() const -> bool deprecated
sRGB-capable default framebuffer
auto setSRGBCapable(bool enabled) -> GLConfiguration& deprecated
Set sRGB-capable default framebuffer.

Enum documentation

enum class Magnum::Platform::GlfwApplication::GLConfiguration::Flag: UnsignedByte

Context flag.

Enumerators
ForwardCompatible

Forward compatible context

NoError

Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.

Debug

Debug context

Stereo

Stereo rendering

Typedef documentation

typedef Containers::EnumSet<Flag> Magnum::Platform::GlfwApplication::GLConfiguration::Flags

Context flags.

Function documentation

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::setFlags(Flags flags)

Set context flags.

Returns Reference to self (for method chaining)

Default is Flag::ForwardCompatible on desktop GL and no flags on OpenGL ES.

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::addFlags(Flags flags)

Add context flags.

Returns Reference to self (for method chaining)

Unlike setFlags(), ORs the flags with existing instead of replacing them. Useful for preserving the defaults.

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::clearFlags(Flags flags)

Clear context flags.

Returns Reference to self (for method chaining)

Unlike setFlags(), ANDs the inverse of flags with existing instead of replacing them. Useful for removing default flags.

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::setVersion(GL::Version version)

Set context version.

If requesting version greater or equal to OpenGL 3.2, core profile is used. The created context will then have any version which is backwards-compatible with requested one. Default is GL::Version::None, i.e. any provided version is used.

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::setColorBufferSize(const Vector4i& size)

Set color buffer size.

Default is {8, 8, 8, 0} (8-bit-per-channel RGB, no alpha).

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::setDepthBufferSize(Int size)

Set depth buffer size.

Default is 24 bits.

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::setStencilBufferSize(Int size)

Set stencil buffer size.

Default is 0 bits (i.e., no stencil buffer).

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::setSampleCount(Int count)

Set sample count.

Returns Reference to self (for method chaining)

Default is 0, thus no multisampling. The actual sample count is ignored, GLFW either enables it or disables. See also GL::Renderer::Feature::Multisampling.

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::setSrgbCapable(bool enabled)

Set sRGB-capable default framebuffer.

Returns Reference to self (for method chaining)

Default is false. See also GL::Renderer::Feature::FramebufferSrgb.

bool Magnum::Platform::GlfwApplication::GLConfiguration::isSRGBCapable() const

sRGB-capable default framebuffer

GLConfiguration& Magnum::Platform::GlfwApplication::GLConfiguration::setSRGBCapable(bool enabled)

Set sRGB-capable default framebuffer.