ViewportManager
Generated from engine/render/viewport_manager.h at f525bc6. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
Audience: game code.
#include "engine/render/viewport_manager.h" · namespace labrador
class ViewportManager
Section titled “class ViewportManager”ViewportManager
Section titled “ViewportManager”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. resolution_manager is borrowed and must outlive this manager; viewport queries read its current resolution rather than a stored size.
set_layout · layout
Section titled “set_layout · layout”ScreenLayout layout() const;player_viewport
Section titled “player_viewport”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.
player_num indexes all_viewports(): [0, 1) for one player, [0, 2) for two, and [0, 4) for three and four players, since three players leave a fourth quadrant a whole-screen caller still draws. Throws std::out_of_range outside that range rather than answering with a fullscreen pane, which would draw a whole extra pass over the others (T6), as Renderer refuses a view nobody set up.
all_viewports
Section titled “all_viewports”viewport_dividers
Section titled “viewport_dividers”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.
fullscreen_viewport
Section titled “fullscreen_viewport”Related types
Section titled “Related types”Named in the public declarations above: RectangleF, ResolutionManager, ScreenLayout, Viewport.
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/app/application_resize_tests.cpptests/local_multiplayer/arena_tests.cpptests/render/viewport_manager_tests.cpp
Explained in
Section titled “Explained in”Documentation for Labrador v0.4.0. Built from Labrador f525bc6 of 2026-11-17.