Initial commit
This commit is contained in:
commit
d327311719
5 changed files with 4030 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/target
|
||||
3964
Cargo.lock
generated
Normal file
3964
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
7
Cargo.toml
Normal file
7
Cargo.toml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[package]
|
||||
name = "nonagon-infinity"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
iced = "0.14.0"
|
||||
28
src/main.rs
Normal file
28
src/main.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
mod node;
|
||||
|
||||
use iced::{Element, Point};
|
||||
use node::Node;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct State {
|
||||
nodes: Vec<Node>
|
||||
}
|
||||
|
||||
pub enum Message {
|
||||
MoveNode(usize, Point),
|
||||
SocketDragStart,
|
||||
SocketDragEnd,
|
||||
}
|
||||
|
||||
impl State {
|
||||
pub fn view(&self) -> Element<'_, Message> {
|
||||
todo!();
|
||||
}
|
||||
pub fn update(&mut self, message: Message) {
|
||||
todo!();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> Result<(), iced::Error> {
|
||||
iced::run(State::update, State::view)
|
||||
}
|
||||
30
src/node.rs
Normal file
30
src/node.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use iced::{Element, Point};
|
||||
|
||||
use crate::Message;
|
||||
|
||||
pub struct Node {
|
||||
pub name: String,
|
||||
pub inputs: Vec<Socket>,
|
||||
pub outputs: Vec<Socket>,
|
||||
pub position: Point,
|
||||
pub function: Box<dyn Fn([&Socket]) -> Vec<Socket>>
|
||||
}
|
||||
|
||||
pub struct Socket {
|
||||
name: Option<String>,
|
||||
kind: SocketType,
|
||||
data: SocketData
|
||||
}
|
||||
|
||||
pub enum SocketType {
|
||||
Input,
|
||||
Output,
|
||||
}
|
||||
|
||||
pub enum SocketData {
|
||||
F32(f32)
|
||||
}
|
||||
|
||||
pub fn node(from: &Node, node_index: usize) -> Element<'_,Message> {
|
||||
todo!();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue