summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..8bb668f
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,31 @@
+use eframe::egui;
+
+fn main() -> Result<(), eframe::Error> {
+ let options = eframe::NativeOptions {
+ viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
+ ..Default::default()
+ };
+
+ eframe::run_native(
+ "Hello World",
+ options,
+ Box::new(|_cc| Ok(Box::new(MyApp::default()))),
+ )
+}
+
+struct MyApp;
+
+impl Default for MyApp {
+ fn default() -> Self {
+ Self
+ }
+}
+
+impl eframe::App for MyApp {
+ fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
+ egui::CentralPanel::default().show(ctx, |ui| {
+ ui.heading("Hello World!");
+ ui.label("This is a simple egui application.");
+ });
+ }
+}