ResolutionManager
Generated from engine/render/resolution_manager.h at 862e08b. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
#include "engine/render/resolution_manager.h" · namespace labrador
class ResolutionManager
Section titled “class ResolutionManager”The size everything above the backend lays itself out against. ViewportManager derives every viewport and every divider from it, and it is what a game means when it says "the resolution".
IT IS A SIZE, AND ScreenResolution IS A LABEL FOR FOUR OF ITS VALUES. That is the way round it has to be, because a window can be any size at all - a user drags an edge, a borderless full-screen window takes the whole monitor - and a closed enum of four 16:9 presets cannot hold most of them. The size is the member and the enum is a label over it, so a window outside the four presets lays out against its own size.
ResolutionManager
Section titled “ResolutionManager”The two defaults are one decision, not two that must be kept in step: the size is whatever the default preset's size is.
resolution_ivec · resolution_vec · resolution_string · resolution · set_resolution
Section titled “resolution_ivec · resolution_vec · resolution_string · resolution · set_resolution”std::string resolution_string() const;void set_resolution(ScreenResolution resolution);void set_resolution(const std::string& resolution);void set_resolution(const mattmath::Vector2F& resolution);void set_resolution(const mattmath::Vector2I& resolution);set_resolution_exactly
Section titled “set_resolution_exactly”The size as given, with no preset anywhere near it. This is what a real window is, and Application calls it from on_window_size_changed so that a resize, a full-screen toggle and a dragged window edge all land here. NOT ALL THREE ARRIVE AS WM_SIZE: engine/app/window.cpp drops every WM_SIZE sent inside the modal drag loop and forwards a GetClientRect on WM_EXITSIZEMOVE instead, so a dragged edge reaches this through that message. One call covers the three because the shell converges them, not because Windows does.
IT MUST NOT BE ROUTED THROUGH set_resolution(const Vector2I&), and that is not a style preference. That overload converts to the enum first, and the conversion answers 1280x720 for anything outside the four presets - so pushing a window size through it reports 720p for every window that is not exactly one of them. This setter is the path that does not coerce.
The label follows only on an EXACT match. Ask for 1920x1080 and resolution() becomes s_1920_1080; ask for 1600x900 and it keeps whatever preset was last requested, because that size does not have a name in this enum and inventing one would be the coercion again. resolution() and resolution_string() therefore mean "the preset last asked for" and can differ from the live size - a game showing a resolution in an options menu wants the label, and anything laying itself out wants resolution_ivec().
Throws std::invalid_argument for a non-positive extent (T6): it is a divisor for everything downstream. No window can reach it - WM_SIZE is guarded against SIZE_MINIMIZED and WM_GETMINMAXINFO floors the drag - so this is aimed at a caller that computed a size wrongly.
ONE CONSEQUENCE WORTH A CLIENT'S ATTENTION: a game can be handed a size that is not 16:9. Anything assuming a single scale factor from one axis has a letterboxing decision to make. That is correct rather than free.
convert_resolution_to_string
Section titled “convert_resolution_to_string”static std::string convert_resolution_to_string(Related types
Section titled “Related types”Named in the public declarations above: ScreenResolution, Vector2F, Vector2I.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
tests/local_multiplayer/arena_tests.cpptests/render/resolution_manager_tests.cpp,viewport_manager_tests.cpp
Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.