summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-08-18 21:43:08 +0300
committeromagdy7 <omar.professional8777@gmail.com>2023-08-18 21:43:08 +0300
commit1e5dc994b7c7317a8c5be5c600dcd2dc90b0ac07 (patch)
tree12b82d91929e430b22ac08dedecb36fa19af466d /src/main.rs
parent10bd1676edd9417c8ec8466e585c13bd109d687c (diff)
downloadlgsim-1e5dc994b7c7317a8c5be5c600dcd2dc90b0ac07.tar.xz
lgsim-1e5dc994b7c7317a8c5be5c600dcd2dc90b0ac07.zip
Cleaned the code + added output_layer for displaying outputs
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 3e1b2e7..6b95a83 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,19 +1,24 @@
use macroquad::prelude::*;
mod gate;
mod input_layout;
+mod output_layout;
+mod wire;
use gate::*;
use input_layout::*;
+use output_layout::*;
+use wire::*;
#[macroquad::main("lgsim")]
async fn main() {
let mut gate = Gate::new(
Rec::new(500., 500., 120., 80., RED),
- vec![Connection::new(10., GREEN, false); 2],
+ vec![Connection::new(10., (0.0, 0.0), GREEN, false); 2],
"GATE",
- Connection::new(10., GREEN, false),
+ Connection::new(10., (0.0, 0.0), GREEN, false),
);
- let input_layout = InputLayout::new(vec![Connection::new(10., GREEN, false); 16]);
+ let input_layout = InputLayout::new(vec![Connection::new(10., (0.0, 0.0), GREEN, false); 16]);
+ let output_layout = OutputLayout::new(vec![Connection::new(10., (0.0, 0.0), GREEN, false); 16]);
loop {
let playground_offset_x: f32 = screen_width() / 20.;
@@ -35,6 +40,7 @@ async fn main() {
// Draw things before egui
input_layout.draw();
+ output_layout.draw();
gate.draw();
// egui_macroquad::draw();