Unravel Engine C++ Reference
Loading...
Searching...
No Matches
viewport_resolution.h
Go to the documentation of this file.
1#pragma once
3
4#include <context/context.hpp>
6
7namespace unravel
8{
9class camera_component;
10} // namespace unravel
11
13{
14
15//-----------------------------------------------------------------------------
24//-----------------------------------------------------------------------------
25auto compute_viewport_size(const settings::resolution_settings::resolution& res,
26 ImVec2 avail_size) -> ImVec2;
27
28//-----------------------------------------------------------------------------
35//-----------------------------------------------------------------------------
36auto compute_fitted_size(const settings::resolution_settings::resolution& res,
37 ImVec2 avail_size) -> ImVec2;
38
39//-----------------------------------------------------------------------------
45//-----------------------------------------------------------------------------
46void apply_to_camera(camera_component& camera_comp,
47 const settings::resolution_settings::resolution& res,
48 ImVec2 avail_size);
49
50//-----------------------------------------------------------------------------
55//-----------------------------------------------------------------------------
57 -> const settings::resolution_settings::resolution*;
58
59//-----------------------------------------------------------------------------
68//-----------------------------------------------------------------------------
69auto draw_menu(rtti::context& ctx, int& current_index) -> bool;
70
71} // namespace unravel::viewport_resolution
uint16_t index
auto compute_viewport_size(const settings::resolution_settings::resolution &res, ImVec2 avail_size) -> ImVec2
Compute the camera viewport size to use for a resolution preset.
auto get_resolution(rtti::context &ctx, int index) -> const settings::resolution_settings::resolution *
Get the resolution preset at the given index (clamped against the configured presets)....
auto compute_fitted_size(const settings::resolution_settings::resolution &res, ImVec2 avail_size) -> ImVec2
Compute a viewport size that always fits within avail_size by aspect ratio (ignoring any fixed pixel ...
void apply_to_camera(camera_component &camera_comp, const settings::resolution_settings::resolution &res, ImVec2 avail_size)
Apply the resolution preset to the camera component using compute_viewport_size. Only viewport size i...
auto draw_menu(rtti::context &ctx, int &current_index) -> bool
Draw the resolution selection drop-down for the current menu bar. The selection is read and written t...