-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_start.rs
More file actions
37 lines (26 loc) · 780 Bytes
/
Copy pathquick_start.rs
File metadata and controls
37 lines (26 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use bog::prelude::*;
fn main() -> Result<()> {
run_simple_app(None, MyApp)
}
struct MyApp;
impl SimpleApp for MyApp {
type CustomEvent = ();
fn render<'a>(&'a mut self, cx: AppContext, pass: &mut RenderPass<'a>) {
pass.start_layer(cx.renderer.viewport_rect());
pass.fill_quad(Quad {
bounds: cx.renderer.viewport_rect(),
bg_color: Color::new(43, 43, 53, 255),
..Default::default()
});
pass.end_layer();
}
fn input(&mut self, cx: AppContext, _event: InputEvent) {
cx.window.request_redraw();
}
fn window_desc(&self) -> WindowDescriptor<'_> {
WindowDescriptor {
title: "Bog - Quickstart Example",
..Default::default()
}
}
}