pub struct GameConfig {
pub title: String,
pub width: u32,
pub height: u32,
pub vsync: bool,
pub fullscreen: bool,
pub resizable: bool,
pub target_fps: u32,
pub debug_rendering: bool,
pub show_fps_overlay: bool,
pub fps_update_interval: f32,
}Expand description
Configuration for creating a GoudGame instance.
This struct holds all the settings needed to initialize the game engine, including window properties, rendering options, and engine settings.
§Example
use goud_engine::sdk::GameConfig;
let config = GameConfig {
title: "My Awesome Game".to_string(),
width: 1280,
height: 720,
vsync: true,
..Default::default()
};Fields§
§title: StringWindow title displayed in the title bar.
width: u32Window width in pixels.
height: u32Window height in pixels.
vsync: boolEnable vertical sync to prevent screen tearing.
fullscreen: boolEnable fullscreen mode.
resizable: boolEnable window resizing.
target_fps: u32Target frames per second (0 = unlimited).
debug_rendering: boolEnable debug rendering (collision boxes, etc.).
show_fps_overlay: boolShow the FPS stats overlay.
fps_update_interval: f32How often (in seconds) the FPS overlay recomputes statistics.
Implementations§
Source§impl GameConfig
impl GameConfig
Sourcepub fn new(title: impl Into<String>, width: u32, height: u32) -> GameConfig
pub fn new(title: impl Into<String>, width: u32, height: u32) -> GameConfig
Creates a new configuration with the given title and dimensions.
§Example
use goud_engine::sdk::GameConfig;
let config = GameConfig::new("My Game", 800, 600);Sourcepub fn with_title(self, title: impl Into<String>) -> GameConfig
pub fn with_title(self, title: impl Into<String>) -> GameConfig
Sets the window title.
Sourcepub fn with_size(self, width: u32, height: u32) -> GameConfig
pub fn with_size(self, width: u32, height: u32) -> GameConfig
Sets the window dimensions.
Sourcepub fn with_vsync(self, enabled: bool) -> GameConfig
pub fn with_vsync(self, enabled: bool) -> GameConfig
Enables or disables vsync.
Sourcepub fn with_fullscreen(self, enabled: bool) -> GameConfig
pub fn with_fullscreen(self, enabled: bool) -> GameConfig
Enables or disables fullscreen mode.
Sourcepub fn with_target_fps(self, fps: u32) -> GameConfig
pub fn with_target_fps(self, fps: u32) -> GameConfig
Sets the target FPS (0 for unlimited).
Sourcepub fn with_fps_overlay(self, enabled: bool) -> GameConfig
pub fn with_fps_overlay(self, enabled: bool) -> GameConfig
Enables or disables the FPS stats overlay.
Sourcepub fn with_fps_update_interval(self, interval: f32) -> GameConfig
pub fn with_fps_update_interval(self, interval: f32) -> GameConfig
Sets how often (in seconds) the FPS overlay recomputes statistics.
Trait Implementations§
Source§impl Clone for GameConfig
impl Clone for GameConfig
Source§fn clone(&self) -> GameConfig
fn clone(&self) -> GameConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GameConfig
impl Debug for GameConfig
Source§impl Default for GameConfig
impl Default for GameConfig
Source§fn default() -> GameConfig
fn default() -> GameConfig
Auto Trait Implementations§
impl Freeze for GameConfig
impl RefUnwindSafe for GameConfig
impl Send for GameConfig
impl Sync for GameConfig
impl Unpin for GameConfig
impl UnsafeUnpin for GameConfig
impl UnwindSafe for GameConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().