Struct thyme::GliumApp

source ·
pub struct GliumApp {
    pub io: WinitIo,
    pub renderer: GliumRenderer,
    pub context: Context,
    pub display: Display,
    pub event_loop: EventLoop<()>,
}
Expand description

The GliumApp object, containing the Thyme Context, Renderer, and IO. You can manually use the public members of this struct, or use main_loop for basic use cases.

Fields§

§io: WinitIo

The Thyme IO

§renderer: GliumRenderer

The Thyme Renderer

§context: Context

The Thyme Context

§display: Display

The Glium / Winit Display

§event_loop: EventLoop<()>

The Glium / Winit Event loop

Implementations§

source§

impl GliumApp

source

pub fn main_loop<F: Fn(&mut Frame) + 'static>(self, f: F) -> !

Runs the Winit main loop for this app

Examples found in repository?
examples/hello_glium.rs (lines 12-18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let app = thyme::AppBuilder::new()
        .with_logger()
        .with_title("Thyme Glium Demo")
        .with_window_size(1280.0, 720.0)
        .with_base_dir("examples/data")
        .with_theme_files(&["themes/base.yml", "themes/pixel.yml"])
        .with_font_dir("fonts")
        .with_image_dir("images")
        .build_glium()?;

    app.main_loop(|ui| {
        ui.window("window", |ui| {
            ui.gap(20.0);
    
            ui.button("label", "Hello, World!");
        });
    });
}

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>