[][src]Struct ggez::Context

pub struct Context {
    pub filesystem: Filesystem,
    pub timer_context: TimeContext,
    pub audio_context: Box<dyn AudioContext>,
    pub keyboard_context: KeyboardContext,
    pub mouse_context: MouseContext,
    pub gamepad_context: Box<dyn GamepadContext>,
    pub conf: Conf,
    pub continuing: bool,
    // some fields omitted
}

A Context is an object that holds on to global resources. It basically tracks hardware state such as the screen, audio system, timers, and so on. Generally this type is not thread- safe and only one Context can exist at a time. Trying to create another one will fail.

Most functions that interact with the hardware, for instance drawing things, playing sounds, or loading resources (which then need to be transformed into a format the hardware likes) will need to access the Context.

Fields

Filesystem state

Timer state

Audio context

Keyboard context

Mouse context

Gamepad context

The Conf object the Context was created with

Controls whether or not the event loop should be running.

Methods

impl Context
[src]

Feeds an Event into the Context so it can update any internal state it needs to, such as detecting window resizes. If you are rolling your own event loop, you should call this on the events you receive before processing them yourself.

TODO: Resolve hidpi mongling in #391. This also returns a new version of the Event that has been modified for ggez's optional overriding of hidpi. For full discussion see https://github.com/tomaka/winit/issues/591#issuecomment-403096230.

Trait Implementations

impl Debug for Context
[src]

Auto Trait Implementations

impl !Send for Context

impl !Sync for Context

Blanket Implementations

impl<T> From for T
[src]

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> SetParameter for T

Sets value as a parameter of self.

impl<T> Erased for T

impl<T> Same for T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>,