Skip to content

ViewportManager

Generated from engine/render/viewport_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.

Browse the render module

#include "engine/render/viewport_manager.h" · namespace labrador

explicit ViewportManager(ResolutionManager* resolution_manager);

Takes no device, and no member of this class touches one: a ResolutionManager needs none, and every member here hands out a rectangle. That is what makes it constructible in a test.

void set_layout(ScreenLayout layout);
ScreenLayout layout() const;
Viewport player_viewport(int player_num) const;

Pure arithmetic, all of it. Applying a viewport to a device is DrawList::set_viewport, which is why this class names no graphics type. What a viewport shows of the world through a camera is Camera::visible_rectangle, which is why it names no Camera either.

std::vector<Viewport> all_viewports() const;
std::vector<mattmath::RectangleF> viewport_dividers() const;

The strips between the panes, in the same pixels as the viewports, and none for a one-player layout. What fills them is the game's business: this class hands out rectangles and draws nothing.

Viewport fullscreen_viewport() const;

Named in the public declarations above: RectangleF, ResolutionManager, ScreenLayout, Viewport.

The files that include this header directly. A file can also reach it through another header.

Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.