Struct gate::AppInfo

source ·
pub struct AppInfo { /* private fields */ }
Expand description

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();

Implementations

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.

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.

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.

Specifies a window title (default is “untitled app”).

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

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

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

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.