Isolate the node drawing code into separate files
This commit is contained in:
1 parent
95d9f5e5cf
commit
c397bcd17d
3 files changed
+49
-38
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#ifndef NODES_H
|
||||
#define NODES_H
|
||||
|
||||
#include "window.h"
|
||||
|
||||
#define MAX_NODES 1024
|
||||
|
||||
#define NODE_WIDTH 70
|
||||
#define NODE_HEIGHT 20
|
||||
|
||||
#define IO_NODE_FILL_COLOUR ((colour_t){.abgr = 0xff2c84b7})
|
||||
#define IO_NODE_BORDER_COLOUR ((colour_t){.abgr = 0xff122d5e})
|
||||
#define OP_NODE_FILL_COLOUR ((colour_t){.abgr = 0xffad6c3a})
|
||||
#define OP_NODE_BORDER_COLOUR ((colour_t){.abgr = 0xff592516})
|
||||
|
||||
typedef struct node node_t;
|
||||
|
||||
enum comp_ops {
|
||||
COMP_OP_ADD,
|
||||
COMP_OP_SUB,
|
||||
COMP_OP_MUL,
|
||||
COMP_OP_DIV,
|
||||
|
||||
COUNT_COMP_OPS,
|
||||
};
|
||||
|
||||
struct node {
|
||||
rect_t rect;
|
||||
const char *path;
|
||||
};
|
||||
|
||||
bool aabb(const node_t *node, i32 x, i32 y);
|
||||
void draw_node(const window_t *wnd, const node_t *node);
|
||||
|
||||
#endif // !NODES_H
|
||||
Reference in new issue
Block a user