libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Attributes | List of all members
donut::graphics::WindowOptions Struct Reference

Configuration options for a Window. More...

#include <donut/graphics/Window.hpp>

Public Attributes

const char * title = "Application"
 Non-owning pointer to a null-terminated UTF-8 string of the displayed title of the window. More...
 
ivec2 size {800, 600}
 The desired size of the window, in screen coordinates (typically pixels). More...
 
bool resizable = true
 Whether the user should be allowed to resize the window or not. More...
 
bool fullscreen = false
 Whether the window should start in fullscreen mode or not. More...
 
bool vSync = false
 Whether the window should use vertical synchronization or not. More...
 
int msaaLevel = 0
 Number of samples used for multisample anti-aliasing (MSAA) when rendering a pixel to the window via its Framebuffer. More...
 

Detailed Description

Configuration options for a Window.

Examples
example_game.cpp.

Member Data Documentation

◆ title

const char* donut::graphics::WindowOptions::title = "Application"

Non-owning pointer to a null-terminated UTF-8 string of the displayed title of the window.

Warning
Must not be set to nullptr.
Examples
example_game.cpp.

◆ size

ivec2 donut::graphics::WindowOptions::size {800, 600}

The desired size of the window, in screen coordinates (typically pixels).

The x component represents the width, and the y component represents the height.

Warning
Both the width and height must be positive.

◆ resizable

bool donut::graphics::WindowOptions::resizable = true

Whether the user should be allowed to resize the window or not.

◆ fullscreen

bool donut::graphics::WindowOptions::fullscreen = false

Whether the window should start in fullscreen mode or not.

◆ vSync

bool donut::graphics::WindowOptions::vSync = false

Whether the window should use vertical synchronization or not.

VSync introduces a pause each time an application frame is finished rendering that causes the application to wait for the previously displayed frame to finish being drawn to the screen. This eliminates any tearing artifacts that may otherwise occur due to swapping the frame buffers in the middle of a screen refresh, at the cost of effectively limiting the application's frame rate to the screen's refresh rate.

Note
Enabling VSync is not recommended for applications that are sensitive to input delay, such as games, since it can significantly increase the time before a rendered frame gets displayed to the user compared to a regular frame rate limiter.

◆ msaaLevel

int donut::graphics::WindowOptions::msaaLevel = 0

Number of samples used for multisample anti-aliasing (MSAA) when rendering a pixel to the window via its Framebuffer.

This can be used to mitigate aliasing artifacts on the edges of 3D objects, at the cost of some performance.

If set to 0 or lower, MSAA will not be used.

Remarks
Typical values are 0, 2 and 4.
Note
Current GPUs (as of 2023) rarely support values greater than 8.

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