|
Unravel Engine C++ Reference
|
#include <editor/imgui/integration/imgui.h>#include <context/context.hpp>#include <engine/settings/settings.h>Go to the source code of this file.
Namespaces | |
| namespace | unravel |
| namespace | unravel::viewport_resolution |
Functions | |
| auto | unravel::viewport_resolution::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 | unravel::viewport_resolution::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 dimensions in the preset). This is useful when the on-screen image rectangle must match the camera viewport (e.g. for picking and gizmos). | |
| void | unravel::viewport_resolution::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 is modified; viewport position is left untouched. | |
| auto | unravel::viewport_resolution::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). Returns nullptr if no resolutions are configured. | |
| auto | unravel::viewport_resolution::draw_menu (rtti::context &ctx, int ¤t_index) -> bool |
| Draw the resolution selection drop-down for the current menu bar. The selection is read and written through the supplied index parameter. Returns true if the user changed the selection - the caller is responsible for persisting the new index if desired (e.g. project settings vs. a transient panel-local value). Adds an "Edit ..." entry that opens the project settings panel scoped to the Resolution section. | |