Program Listing for File QualityPreset.ixx

Program Listing for File QualityPreset.ixx#

↰ Return to documentation for file (Src/GraphicsEngineVulkan/gui/QualityPreset.ixx)

module;

#include <cstddef>
#include <optional>
#include <string>
#include <vector>

export module kataglyphis.vulkan.quality_preset;

import kataglyphis.vulkan.gui_renderer_shared_vars;
import kataglyphis.vulkan.gui_scene_shared_vars;

// OxidANT's quality presets through the bridge, whose generated header only this module's .cpp includes.
export namespace Kataglyphis {

// Low, Medium, High and Ultra, the Renderer tab's order; High is the editor's defaults.
[[nodiscard]] std::vector<std::string> qualityPresetLabels();

// The preset the settings are at, its index in qualityPresetLabels(); none is Custom. Auto's moving scale is not compared.
[[nodiscard]] std::optional<std::size_t> matchingQualityPreset(
  const VulkanRendererInternals::FrontendShared::GUIRendererSharedVars &renderer,
  const GUISceneSharedVars &scene);

// Sets the knobs preset `index` owns, as Rust's apply_preset: Auto's target and every other setting stay the user's.
// False, changing nothing, for an index no preset has.
bool applyQualityPreset(std::size_t index,
  VulkanRendererInternals::FrontendShared::GUIRendererSharedVars &renderer,
  GUISceneSharedVars &scene);

}// namespace Kataglyphis