[][src]Struct gate::AppInfo

pub struct AppInfo { /* fields omitted */ }

A struct for specifying initialization information for running an App.

Methods for setting fields in AppInfo are intended to be chained together like the builder pattern.

Example

use gate::AppInfo;

let info = AppInfo::with_max_dims(160., 90.)
                   .min_dims(120., 86.)
                   .tile_width(16)
                   .title("My Game")
                   .target_fps(30.)
                   .print_workload_info()
                   .print_gl_info();

Methods

impl AppInfo[src]

pub fn with_max_dims(max_width: f64, max_height: f64) -> AppInfo[src]

Returns a new AppInfo, initialized with the maximum app dimensions.

These dimensions are specified in conceptual "app pixels", which defines the units used by the renderers. Even if a window is resized, this conecptual max_width and max_height will never be exceeded. Max width/height must be at least 1.

pub fn min_dims(self, min_width: f64, min_height: f64) -> Self[src]

Specifies the minimum dimensions in "app pixels" (default is 0).

Even if you want height to be fixed, it is good practice to design the app so that min_height is slightly less than max_height. Under normal circumstances, the app dimensions will not fall below these minimum dimensions, but there are some extreme cases in which it could. App dimensions will never fall below 1.

pub fn tile_width(self, tile_width: u32) -> Self[src]

Specifies the tile width for meshing tiles.

If this value is set, the app dimensions are chosen carefully to ensure that the width of a tile is aligned to native pixels.

pub fn title(self, title: &'static str) -> Self[src]

Specifies a window title (default is "untitled app").

pub fn native_dims(self, width: u32, height: u32) -> Self[src]

Specifies the intial native width and height of the window (default is 800 by 600).

pub fn target_fps(self, target_fps: f64) -> Self[src]

Specifies the target frames-per-second (default is 60.).

pub fn print_workload_info(self) -> Self[src]

If invoked, workload info will be printed to standard output periodically.

pub fn print_gl_info(self) -> Self[src]

If invoked, the OpenGL version info will be printed out at the start of the application.

Auto Trait Implementations

impl RefUnwindSafe for AppInfo

impl Send for AppInfo

impl Sync for AppInfo

impl Unpin for AppInfo

impl UnwindSafe for AppInfo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.