pub struct Config {
pub title: String,
pub studio: String,
pub game: String,
pub window_size: UVec2,
pub min_window_size: UVec2,
pub resizable: bool,
pub fullscreen: bool,
pub frame_rate_limit: Option<u32>,
pub vsync: bool,
pub virtual_resolution: UVec2,
pub assets: PathBuf,
pub volumes: Volumes,
}Expand description
What a game asks of the engine.
Fields§
§title: StringThe text in the window’s title bar.
studio: StringWho makes the game. On Windows the game’s folders for settings, saves and logs are inside a folder of this name.
game: StringThe name of the game’s folders for settings, saves and logs. Keep it the same from one release to the next, or players lose their settings and saves. Two games with the same name and studio share their folders.
This and studio must each be a valid folder name
on every system (the rules are at nadir_platform::user_dirs). If
one is not, the game runs without a log file, and a warning says why.
window_size: UVec2The size of the inside of the window, in logical pixels.
min_window_size: UVec2The smallest size the user can give the window, in logical pixels. A zero means no limit in that direction.
resizable: boolWhether the user can resize the window.
fullscreen: boolWhether the window starts in borderless fullscreen.
frame_rate_limit: Option<u32>The most frames to run in a second. None and Some(0) mean no
limit. With vsync the display paces the loop too,
but some drivers accept vsync and do not wait (llvmpipe, XWayland),
so the limit stays as a cap. Without either, the loop runs as fast as
it can and keeps a processor core busy.
vsync: boolWhether each frame waits for the display’s refresh, so that it does not tear (a swap interval of 1).
virtual_resolution: UVec2The size of the image the world is drawn into, in pixels. It is scaled up into the window by the largest whole factor that fits (pixel-perfect mode, ADR-0018).
assets: PathBufThe folder the game’s assets are loaded from: the cook’s output,
whose pack game.kpak builds without dev read when it is there
(App::new).
volumes: VolumesThe volume of each of the mixer’s buses as the game starts: full, by default.