[][src]Struct ds2d::ContextBuilder

pub struct ContextBuilder { /* fields omitted */ }

The entry point of the ds2d library that sets up the various subsystems, and in particular a window with a graphics context.

Implementations

impl ContextBuilder[src]

pub fn new() -> Self[src]

pub fn title<T: Into<String>>(self, title: T) -> Self[src]

Set the title of the game window.

pub fn logical_size(self, size: LogicalSize<f64>) -> Self[src]

Set the logical size of the game window (before being scaled by the DPI factor). TODO: is there a way of providing a physical size for initialization?

pub fn debug(self, debug: bool) -> Self[src]

Enable additional debug checks and output. Defaults to cfg!(debug_assertions).

pub fn build(self) -> Result<(EventLoop<()>, Context), InitError>[src]

Create a window with an OpenGL context, and the corresponding event loop. The returned ds2d::Context can be used for initializing the Game state before starting the game loop.

Trait Implementations

impl Default for ContextBuilder[src]

Auto Trait Implementations

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.