summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-08-10 20:45:56 +0300
committeromagdy7 <omar.professional8777@gmail.com>2023-08-10 20:45:56 +0300
commit7cdd18e6b03711c5e70874a092b94affc8b7d586 (patch)
tree4e2be890f1fb32143f1a9981d466d9afd3c2ae35 /src/main.rs
downloadlgsim-7cdd18e6b03711c5e70874a092b94affc8b7d586.tar.xz
lgsim-7cdd18e6b03711c5e70874a092b94affc8b7d586.zip
Intial commit
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..1759a20
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,38 @@
+use macroquad::prelude::*;
+mod gate;
+use gate::*;
+
+#[macroquad::main("egui with macroquad")]
+async fn main() {
+ let mut gate = Gate::new(
+ Rec::new(500., 500., 120., 80., RED),
+ vec![Connection::new(10., GOLD), Connection::new(10., GOLD)],
+ Connection::new(10., GOLD),
+ );
+
+ loop {
+ clear_background(color_u8!(27, 27, 27, 255));
+
+ // Process keys, mouse etc.
+
+ egui_macroquad::ui(|egui_ctx| {
+ egui::Window::new("egui ❤ macroquad").show(egui_ctx, |ui| {
+ ui.label("Test");
+ });
+ });
+
+ // Draw things before egui
+
+ // let gate2 = Gate::new(
+ // Rec::new(700., 700., 120., 80., RED),
+ // vec![Connection::new(10., GOLD), Connection::new(10., GOLD)],
+ // );
+ gate.draw();
+ // gate2.draw();
+ egui_macroquad::draw();
+
+ // Draw things after egui
+
+ next_frame().await;
+ }
+}