36 lines
676 B
C
36 lines
676 B
C
#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 = 0xff315c89})
|
|
#define OP_NODE_FILL_COLOUR ((colour_t){.abgr = 0xffad6c3a})
|
|
#define OP_NODE_BORDER_COLOUR ((colour_t){.abgr = 0xff8e4a33})
|
|
|
|
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
|