Started on the engine proper

This commit is contained in:
2022-09-18 21:48:15 +01:00
parent 902b917d2b
commit 50aef00ec0
11 changed files with 241 additions and 79 deletions

23
core/engine_node.h Normal file
View File

@@ -0,0 +1,23 @@
#pragma once
#include "common.h"
//forward declare
typedef struct _engineNode EngineNode;
typedef struct _engine Engine;
//the interface function
typedef void (*EngineNodeFn)(EngineNode* self, Engine* engine);
//the node object, which forms a tree
typedef struct _engineNode {
//use Toy's memory model
void* children;
int capacity;
int count;
EngineNodeFn onInit;
EngineNodeFn onStep;
EngineNodeFn onFree;
} EngineNode;