galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::settings Struct Reference

Helper class to encapsulate our global settings we want to quickly access across app. More...

#include <Settings.hpp>

+ Collaboration diagram for galaxy::settings:

Static Public Member Functions

static auto set_config_to_default (core::Config &config) -> void
 Restore all config settings to default.
 
static auto set_settings_from_config (core::Config &config) -> void
 Set all our settings using the provided config file.
 
static auto set_delta_time (const double dt) noexcept -> void
 Set galaxy delta time.
 
static auto dt () noexcept -> double
 Get galaxy delta time.
 
static auto ups () noexcept -> double
 Game updates per second, independant of FPS, see "fixed timestep gameloop".
 
static auto window_width () noexcept -> int
 Window creation width.
 
static auto window_height () noexcept -> int
 Window creation height.
 
static auto window_title () noexcept -> const std::string &
 Window title.
 
static auto window_icon () noexcept -> const std::string &
 Window icon file in vfs.
 
static auto fullscreen () noexcept -> bool
 Window maximized state.
 
static auto key_repeat () noexcept -> bool
 Enable if a keypress will dispatch a single or repeating events.
 
static auto vsync () noexcept -> bool
 Vsync control.
 
static auto msaa () noexcept -> bool
 Enable MSAA.
 
static auto cursor_visible () noexcept -> bool
 Show/hide mouse cursor.
 
static auto cursor_grabbed () noexcept -> bool
 Grab/release mouse cursor.
 
static auto cursor_icon () noexcept -> const std::string &
 Cursor texture file in vfs.
 
static auto cursor_icon_size () noexcept -> const sf::Vector2u &
 Cursor icon texture size.
 
static auto cursor_hotspot () noexcept -> const sf::Vector2u &
 Cursor selector point (hotspot).
 
static auto root_dir () noexcept -> std::filesystem::path
 Current root directory of application, unless it has been changed.
 
static auto assets_dir () noexcept -> std::filesystem::path
 Main data directory.
 
static auto editor_dir () noexcept -> std::filesystem::path
 Directory for editor specific stuff.
 
static auto asset_pack () noexcept -> const std::string &
 Name of packed assets file.
 
static auto use_loose_assets () noexcept -> bool
 Should asset data be read from pack or assets dir.
 
static auto assets_dir_music () noexcept -> const std::string &
 Music asset location.
 
static auto assets_dir_sfx () noexcept -> const std::string &
 SFX asset location.
 
static auto assets_dir_voice () noexcept -> const std::string &
 Voice asset location.
 
static auto assets_dir_font () noexcept -> const std::string &
 Font asset location.
 
static auto assets_dir_script () noexcept -> const std::string &
 Scripts asset location.
 
static auto assets_dir_shaders () noexcept -> const std::string &
 Shaders asset location.
 
static auto assets_dir_animation () noexcept -> const std::string &
 Animation data location.
 
static auto assets_dir_texture () noexcept -> const std::string &
 Textures asset location.
 
static auto assets_dir_prefabs () noexcept -> const std::string &
 Prefab asset location.
 
static auto assets_dir_maps () noexcept -> const std::string &
 Maps asset location.
 
static auto assets_dir_video () noexcept -> const std::string &
 Video asset location.
 
static auto assets_dir_ui () noexcept -> const std::string &
 UI asset location.
 

Static Private Attributes

static double s_delta_time
 
static double s_ups
 
static int s_window_width
 
static int s_window_height
 
static std::string s_title
 
static std::string s_icon
 
static bool s_fullscreen
 
static bool s_key_repeat
 
static bool s_vsync
 
static bool s_msaa
 
static bool s_cursor_visible
 
static bool s_cursor_grabbed
 
static std::string s_cursor_icon
 
static sf::Vector2u s_cursor_icon_size
 
static sf::Vector2u s_cursor_hotspot
 
static std::filesystem::path s_assets_dir
 
static std::filesystem::path s_editor_dir
 
static std::string s_asset_pack
 
static bool s_use_loose_assets
 
static std::string s_assets_music
 
static std::string s_assets_sfx
 
static std::string s_assets_voice
 
static std::string s_assets_font
 
static std::string s_assets_script
 
static std::string s_assets_shaders
 
static std::string s_assets_animation
 
static std::string s_assets_texture
 
static std::string s_assets_prefabs
 
static std::string s_assets_maps
 
static std::string s_assets_video
 
static std::string s_assets_ui
 

Detailed Description

Helper class to encapsulate our global settings we want to quickly access across app.

Definition at line 20 of file Settings.hpp.

Member Function Documentation

◆ set_config_to_default()

auto galaxy::settings::set_config_to_default ( core::Config & config) -> void
static

Restore all config settings to default.

Parameters
dtConfig option to restore defaults to.

Definition at line 12 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ set_settings_from_config()

auto galaxy::settings::set_settings_from_config ( core::Config & config) -> void
static

Set all our settings using the provided config file.

Parameters
dtConfig option to set settings from.

Definition at line 53 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ set_delta_time()

auto galaxy::settings::set_delta_time ( const double dt) -> void
staticnoexcept

Set galaxy delta time.

Parameters
dtTime lag from game loop.

Definition at line 92 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ dt()

auto galaxy::settings::dt ( ) -> double
staticnodiscardnoexcept

Get galaxy delta time.

Returns
Current lag from gameloop.

Definition at line 97 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ ups()

auto galaxy::settings::ups ( ) -> double
staticnodiscardnoexcept

Game updates per second, independant of FPS, see "fixed timestep gameloop".

Definition at line 102 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ window_width()

auto galaxy::settings::window_width ( ) -> int
staticnodiscardnoexcept

Window creation width.

Definition at line 107 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ window_height()

auto galaxy::settings::window_height ( ) -> int
staticnodiscardnoexcept

Window creation height.

Definition at line 112 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ window_title()

auto galaxy::settings::window_title ( ) -> const std::string&
staticnodiscardnoexcept

Window title.

Definition at line 117 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ window_icon()

auto galaxy::settings::window_icon ( ) -> const std::string&
staticnodiscardnoexcept

Window icon file in vfs.

Definition at line 122 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ fullscreen()

auto galaxy::settings::fullscreen ( ) -> bool
staticnodiscardnoexcept

Window maximized state.

Definition at line 127 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ key_repeat()

auto galaxy::settings::key_repeat ( ) -> bool
staticnodiscardnoexcept

Enable if a keypress will dispatch a single or repeating events.

Definition at line 132 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ vsync()

auto galaxy::settings::vsync ( ) -> bool
staticnodiscardnoexcept

Vsync control.

Definition at line 137 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ msaa()

auto galaxy::settings::msaa ( ) -> bool
staticnodiscardnoexcept

Enable MSAA.

Definition at line 142 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ cursor_visible()

auto galaxy::settings::cursor_visible ( ) -> bool
staticnodiscardnoexcept

Show/hide mouse cursor.

Definition at line 147 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ cursor_grabbed()

auto galaxy::settings::cursor_grabbed ( ) -> bool
staticnodiscardnoexcept

Grab/release mouse cursor.

Definition at line 152 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ cursor_icon()

auto galaxy::settings::cursor_icon ( ) -> const std::string&
staticnodiscardnoexcept

Cursor texture file in vfs.

Definition at line 157 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ cursor_icon_size()

auto galaxy::settings::cursor_icon_size ( ) -> const sf::Vector2u&
staticnodiscardnoexcept

Cursor icon texture size.

Definition at line 162 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ cursor_hotspot()

auto galaxy::settings::cursor_hotspot ( ) -> const sf::Vector2u&
staticnodiscardnoexcept

Cursor selector point (hotspot).

Definition at line 167 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ root_dir()

auto galaxy::settings::root_dir ( ) -> std::filesystem::path
staticnodiscardnoexcept

Current root directory of application, unless it has been changed.

Definition at line 172 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir()

auto galaxy::settings::assets_dir ( ) -> std::filesystem::path
staticnodiscardnoexcept

Main data directory.

Definition at line 177 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ editor_dir()

auto galaxy::settings::editor_dir ( ) -> std::filesystem::path
staticnodiscardnoexcept

Directory for editor specific stuff.

Definition at line 182 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ asset_pack()

auto galaxy::settings::asset_pack ( ) -> const std::string&
staticnodiscardnoexcept

Name of packed assets file.

Definition at line 187 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ use_loose_assets()

auto galaxy::settings::use_loose_assets ( ) -> bool
staticnodiscardnoexcept

Should asset data be read from pack or assets dir.

Definition at line 192 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_music()

auto galaxy::settings::assets_dir_music ( ) -> const std::string&
staticnodiscardnoexcept

Music asset location.

Definition at line 197 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_sfx()

auto galaxy::settings::assets_dir_sfx ( ) -> const std::string&
staticnodiscardnoexcept

SFX asset location.

Definition at line 202 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_voice()

auto galaxy::settings::assets_dir_voice ( ) -> const std::string&
staticnodiscardnoexcept

Voice asset location.

Definition at line 207 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_font()

auto galaxy::settings::assets_dir_font ( ) -> const std::string&
staticnodiscardnoexcept

Font asset location.

Definition at line 212 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_script()

auto galaxy::settings::assets_dir_script ( ) -> const std::string&
staticnodiscardnoexcept

Scripts asset location.

Definition at line 217 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_shaders()

auto galaxy::settings::assets_dir_shaders ( ) -> const std::string&
staticnodiscardnoexcept

Shaders asset location.

Definition at line 222 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_animation()

auto galaxy::settings::assets_dir_animation ( ) -> const std::string&
staticnodiscardnoexcept

Animation data location.

Definition at line 227 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_texture()

auto galaxy::settings::assets_dir_texture ( ) -> const std::string&
staticnodiscardnoexcept

Textures asset location.

Definition at line 232 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_prefabs()

auto galaxy::settings::assets_dir_prefabs ( ) -> const std::string&
staticnodiscardnoexcept

Prefab asset location.

Definition at line 237 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_maps()

auto galaxy::settings::assets_dir_maps ( ) -> const std::string&
staticnodiscardnoexcept

Maps asset location.

Definition at line 242 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_video()

auto galaxy::settings::assets_dir_video ( ) -> const std::string&
staticnodiscardnoexcept

Video asset location.

Definition at line 247 of file Settings.cpp.

+ Here is the caller graph for this function:

◆ assets_dir_ui()

auto galaxy::settings::assets_dir_ui ( ) -> const std::string&
staticnodiscardnoexcept

UI asset location.

Definition at line 252 of file Settings.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ s_delta_time

double galaxy::settings::s_delta_time
inlinestaticprivate

Definition at line 239 of file Settings.hpp.

◆ s_ups

double galaxy::settings::s_ups
inlinestaticprivate

Definition at line 241 of file Settings.hpp.

◆ s_window_width

int galaxy::settings::s_window_width
inlinestaticprivate

Definition at line 243 of file Settings.hpp.

◆ s_window_height

int galaxy::settings::s_window_height
inlinestaticprivate

Definition at line 244 of file Settings.hpp.

◆ s_title

std::string galaxy::settings::s_title
inlinestaticprivate

Definition at line 245 of file Settings.hpp.

◆ s_icon

std::string galaxy::settings::s_icon
inlinestaticprivate

Definition at line 246 of file Settings.hpp.

◆ s_fullscreen

bool galaxy::settings::s_fullscreen
inlinestaticprivate

Definition at line 247 of file Settings.hpp.

◆ s_key_repeat

bool galaxy::settings::s_key_repeat
inlinestaticprivate

Definition at line 248 of file Settings.hpp.

◆ s_vsync

bool galaxy::settings::s_vsync
inlinestaticprivate

Definition at line 249 of file Settings.hpp.

◆ s_msaa

bool galaxy::settings::s_msaa
inlinestaticprivate

Definition at line 250 of file Settings.hpp.

◆ s_cursor_visible

bool galaxy::settings::s_cursor_visible
inlinestaticprivate

Definition at line 252 of file Settings.hpp.

◆ s_cursor_grabbed

bool galaxy::settings::s_cursor_grabbed
inlinestaticprivate

Definition at line 253 of file Settings.hpp.

◆ s_cursor_icon

std::string galaxy::settings::s_cursor_icon
inlinestaticprivate

Definition at line 254 of file Settings.hpp.

◆ s_cursor_icon_size

sf::Vector2u galaxy::settings::s_cursor_icon_size
inlinestaticprivate

Definition at line 255 of file Settings.hpp.

◆ s_cursor_hotspot

sf::Vector2u galaxy::settings::s_cursor_hotspot
inlinestaticprivate

Definition at line 256 of file Settings.hpp.

◆ s_assets_dir

std::filesystem::path galaxy::settings::s_assets_dir
inlinestaticprivate

Definition at line 258 of file Settings.hpp.

◆ s_editor_dir

std::filesystem::path galaxy::settings::s_editor_dir
inlinestaticprivate

Definition at line 259 of file Settings.hpp.

◆ s_asset_pack

std::string galaxy::settings::s_asset_pack
inlinestaticprivate

Definition at line 260 of file Settings.hpp.

◆ s_use_loose_assets

bool galaxy::settings::s_use_loose_assets
inlinestaticprivate

Definition at line 261 of file Settings.hpp.

◆ s_assets_music

std::string galaxy::settings::s_assets_music
inlinestaticprivate

Definition at line 262 of file Settings.hpp.

◆ s_assets_sfx

std::string galaxy::settings::s_assets_sfx
inlinestaticprivate

Definition at line 263 of file Settings.hpp.

◆ s_assets_voice

std::string galaxy::settings::s_assets_voice
inlinestaticprivate

Definition at line 264 of file Settings.hpp.

◆ s_assets_font

std::string galaxy::settings::s_assets_font
inlinestaticprivate

Definition at line 265 of file Settings.hpp.

◆ s_assets_script

std::string galaxy::settings::s_assets_script
inlinestaticprivate

Definition at line 266 of file Settings.hpp.

◆ s_assets_shaders

std::string galaxy::settings::s_assets_shaders
inlinestaticprivate

Definition at line 267 of file Settings.hpp.

◆ s_assets_animation

std::string galaxy::settings::s_assets_animation
inlinestaticprivate

Definition at line 268 of file Settings.hpp.

◆ s_assets_texture

std::string galaxy::settings::s_assets_texture
inlinestaticprivate

Definition at line 269 of file Settings.hpp.

◆ s_assets_prefabs

std::string galaxy::settings::s_assets_prefabs
inlinestaticprivate

Definition at line 270 of file Settings.hpp.

◆ s_assets_maps

std::string galaxy::settings::s_assets_maps
inlinestaticprivate

Definition at line 271 of file Settings.hpp.

◆ s_assets_video

std::string galaxy::settings::s_assets_video
inlinestaticprivate

Definition at line 272 of file Settings.hpp.

◆ s_assets_ui

std::string galaxy::settings::s_assets_ui
inlinestaticprivate

Definition at line 273 of file Settings.hpp.


The documentation for this struct was generated from the following files: