Struct let_engine::settings::Graphics
source · pub struct Graphics { /* private fields */ }
Expand description
Engine wide Graphics settings.
By default the present mode is determined by this order based on availability on the device:
Mailbox
Immediate
Fifo
The framerate limit is None
, so off.
Only alter settings after the game engine has been initialized. The initialisation of the game engine also initializes the settings.
Implementations§
source§impl Graphics
impl Graphics
sourcepub fn present_mode(&self) -> PresentMode
pub fn present_mode(&self) -> PresentMode
Returns the present mode of the game.
sourcepub fn set_present_mode(&self, mode: PresentMode) -> Result<()>
pub fn set_present_mode(&self, mode: PresentMode) -> Result<()>
Sets and applies the present mode of the game.
sourcepub fn framerate_limit(&self) -> Duration
pub fn framerate_limit(&self) -> Duration
Returns waiting time between frames to wait.
sourcepub fn set_framerate_limit(&self, limit: Duration)
pub fn set_framerate_limit(&self, limit: Duration)
Sets the framerate limit as waiting time between frames.
This should be able to be changed by the user in case they have a device with limited power capacity like a laptop with a battery.
Setting the duration to no wait time at all will turn off the limit.
sourcepub fn set_fps_cap(&self, cap: u64)
pub fn set_fps_cap(&self, cap: u64)
Sets the cap for the max frames per second the game should be able to output.
This method is the same as setting the set_framerate_limit
of this setting to 1.0 / cap
in seconds.
Turns off the framerate cap if 0 was given.
sourcepub fn get_supported_present_modes(&self) -> Vec<PresentMode>
pub fn get_supported_present_modes(&self) -> Vec<PresentMode>
Returns all the present modes this device supports.
If the vec is empty the engine has not been initialized and the settings should not be changed at this state.
Auto Trait Implementations§
impl !RefUnwindSafe for Graphics
impl Send for Graphics
impl Sync for Graphics
impl Unpin for Graphics
impl UnwindSafe for Graphics
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.