pub struct GliumApp {
pub io: WinitIo,
pub renderer: GliumRenderer,
pub context: Context,
pub display: Display,
pub event_loop: EventLoop<()>,
}
Expand description
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
impl GliumApp
sourcepub fn main_loop<F: Fn(&mut Frame) + 'static>(self, f: F) -> !
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§
impl !RefUnwindSafe for GliumApp
impl !Send for GliumApp
impl !Sync for GliumApp
impl Unpin for GliumApp
impl !UnwindSafe for GliumApp
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more