Magnum::Platform::Sdl2Application::Configuration class

Configuration.

Contents

Public types

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, Contextless = 1u << 31 }
Window flag.
using Flag = GLConfiguration::Flag deprecated
Context flag.
using Flags = GLConfiguration::Flags deprecated
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 -> GLConfiguration::Flags deprecated
Context flags.
auto setFlags(GLConfiguration::Flags flags) -> Configuration& deprecated
Set context flags.
auto version() const -> GL::Version deprecated
Context version.
auto setVersion(GL::Version version) -> Configuration& deprecated
Set context version.
auto sampleCount() const -> Int deprecated
Sample count.
auto setSampleCount(Int count) -> Configuration& deprecated
Set sample count.
auto isSRGBCapable() const -> bool deprecated
sRGB-capable default framebuffer
auto setSRGBCapable(bool enabled) -> Configuration& deprecated
Set sRGB-capable default framebuffer.

Enum documentation

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

Contextless

Do not create any GPU context. Use together with Sdl2Application(const Arguments&, const Configuration&), create(const Configuration&) or tryCreate(const Configuration&) to prevent implicit creation of an OpenGL context.

Typedef documentation

typedef GLConfiguration::Flag Magnum::Platform::Sdl2Application::Configuration::Flag

Context flag.

typedef GLConfiguration::Flags 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.

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

Context flags.

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

Set context flags.

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

Context version.

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

Set context version.

Int Magnum::Platform::Sdl2Application::Configuration::sampleCount() const

Sample count.

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

Set sample count.

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

sRGB-capable default framebuffer

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

Set sRGB-capable default framebuffer.