Add functionality to draw nodes with user-defined inputs count

This commit is contained in:
2024-02-24 23:53:04 +00:00
parent 30986e3c99
commit 2d31233a1e
4 changed files with 73 additions and 39 deletions

View File

@@ -5,6 +5,8 @@
#include "ui.h"
#define MAX_NODES 1024
#define IO_INPUT_COUNT 0
#define OP_INPUT_COUNT 2
typedef i32 (*node_func)(i32 a, i32 b);
typedef enum node_type node_type;
@@ -28,6 +30,7 @@ struct node {
ui_elem_colours colours;
node_type type;
node_data data;
u64 inputs;
};
#endif // !NODES_H

View File

@@ -39,8 +39,9 @@ struct ui_elem_colours {
typedef struct ui_node_elem ui_node_elem;
struct ui_node_elem {
line noodle;
rect rec;
line *noodles;
u64 inputs;
};
struct ui_ctx {