This is a snapshot of a work-in-progress documentation theme. If you feel lost, miss something, or want to see the original Doxygen docs instead, head over to the archived version of this documentation page.

Magnum::Platform::Sdl2Application::Configuration class

Configuration.

Contents

The created window is always with double-buffered OpenGL context and 24bit depth buffer.

Public types

enum class Flag: int { Debug = SDL_GL_CONTEXT_DEBUG_FLAG, RobustAccess = SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG, ResetIsolation = SDL_GL_CONTEXT_RESET_ISOLATION_FLAG }
Context flag.
enum class WindowFlag: Uint32 { Resizable = SDL_WINDOW_RESIZABLE, Fullscreen = SDL_WINDOW_FULLSCREEN, Borderless = SDL_WINDOW_BORDERLESS, AllowHighDpi = SDL_WINDOW_ALLOW_HIGHDPI, Hidden = SDL_WINDOW_HIDDEN, Maximized = SDL_WINDOW_MAXIMIZED, Minimized = SDL_WINDOW_MINIMIZED, MouseLocked = SDL_WINDOW_INPUT_GRABBED }
Window flag.
using Flags = Containers::EnumSet<Flag>
Context flags.
using WindowFlags = Containers::EnumSet<WindowFlag>
Window flags.

Public functions

auto title() const -> std::string
Window title.
auto setTitle(std::string title) -> Configuration&
Set window title.
auto size() const -> Vector2i
Window size.
auto setSize(const Vector2i& size) -> Configuration&
Set window size.
auto windowFlags() const -> WindowFlags
Window flags.
auto setWindowFlags(WindowFlags flags) -> Configuration&
Set window flags.
auto flags() const -> Flags
Context flags.
auto setFlags(Flags flags) -> Configuration&
Set context flags.
auto version() const -> Version
Context version.
auto setVersion(Version version) -> Configuration&
Set context version.
auto sampleCount() const -> Int
Sample count.
auto setSampleCount(Int count) -> Configuration&
Set sample count.
auto isSRGBCapable() const -> bool
sRGB-capable default framebuffer
auto setSRGBCapable(bool enabled) -> Configuration&
Set sRGB-capable default framebuffer.

Enum documentation

enum class Magnum::Platform::Sdl2Application::Configuration::Flag: int

Context flag.

Enumerators
Debug

Create debug context

RobustAccess

Create context with robust access

ResetIsolation

Create context with reset isolation

enum class Magnum::Platform::Sdl2Application::Configuration::WindowFlag: Uint32

Window flag.

Enumerators
Resizable

Resizable window. On iOS this allows the application to respond to display orientation changes. Implement viewportEvent() to react to the resizing events.

Fullscreen

Fullscreen window

Borderless

No window decoration. On iOS this hides the menu bar.

AllowHighDpi

Allow high DPI. On iOS you also have to set the NSHighResolutionCapable entry in the *.plist file to make it working.

Hidden

Hidden window

Maximized

Maximized window

Minimized

Minimized window

MouseLocked

Window with mouse locked

Typedef documentation

typedef Containers::EnumSet<Flag> Magnum::Platform::Sdl2Application::Configuration::Flags

Context flags.

typedef Containers::EnumSet<WindowFlag> Magnum::Platform::Sdl2Application::Configuration::WindowFlags

Window flags.

Function documentation

std::string Magnum::Platform::Sdl2Application::Configuration::title() const

Window title.

Configuration& Magnum::Platform::Sdl2Application::Configuration::setTitle(std::string title)

Set window title.

Returns Reference to self (for method chaining)

Default is "Magnum SDL2 Application".

Configuration& Magnum::Platform::Sdl2Application::Configuration::setSize(const Vector2i& size)

Set window size.

Returns Reference to self (for method chaining)

Default is {800, 600} and {640, 480} on Emscripten. On iOS it defaults to a "reasonable" size based on whether HiDPI support is enabled using WindowFlag::AllowHighDpi, but not necessarily native display resolution (you have to set it explicitly).

Configuration& Magnum::Platform::Sdl2Application::Configuration::setWindowFlags(WindowFlags flags)

Set window flags.

Returns Reference to self (for method chaining)

Default are none.

Flags Magnum::Platform::Sdl2Application::Configuration::flags() const

Context flags.

Configuration& Magnum::Platform::Sdl2Application::Configuration::setFlags(Flags flags)

Set context flags.

Returns Reference to self (for method chaining)

Default is no flag. See also Context::flags().

Version Magnum::Platform::Sdl2Application::Configuration::version() const

Context version.

Configuration& Magnum::Platform::Sdl2Application::Configuration::setVersion(Version version)

Set context version.

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

Configuration& Magnum::Platform::Sdl2Application::Configuration::setSampleCount(Int count)

Set sample count.

Returns Reference to self (for method chaining)

Default is 0, thus no multisampling. See also Renderer::Feature::Multisampling.

bool Magnum::Platform::Sdl2Application::Configuration::isSRGBCapable() const

sRGB-capable default framebuffer

Configuration& Magnum::Platform::Sdl2Application::Configuration::setSRGBCapable(bool enabled)

Set sRGB-capable default framebuffer.

Returns Reference to self (for method chaining)

Default is false. See also Renderer::Feature::FramebufferSRGB.