-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathminimal.rs
More file actions
30 lines (27 loc) · 915 Bytes
/
minimal.rs
File metadata and controls
30 lines (27 loc) · 915 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
#![allow(clippy::needless_return)]
//! Minimal application which configures a window & render context before
//! starting the runtime. You can use this as a starting point for your own
//! applications or to verify that your system is configured to run lambda
//! applications correctly.
use lambda::{
render::PresentMode,
runtime::start_runtime,
runtimes::{
ApplicationRuntimeBuilder,
EventLoopPolicy,
},
};
fn main() {
let runtime = ApplicationRuntimeBuilder::new("Minimal Demo application")
.with_event_loop_policy(EventLoopPolicy::Wait)
.with_window_configured_as(move |window_builder| {
return window_builder
.with_dimensions(800, 600)
.with_name("Minimal window");
})
.with_renderer_configured_as(|render_context_builder| {
return render_context_builder.with_present_mode(PresentMode::Mailbox);
})
.build();
start_runtime(runtime);
}