Basic script-based engine init is working - performance is poor

This commit is contained in:
2022-10-02 13:50:50 +01:00
parent 91afafab22
commit a7e5d101dd
9 changed files with 544 additions and 60 deletions

View File

@@ -2,6 +2,7 @@
#include "common.h"
#include "engine_node.h"
#include "interpreter.h"
#include <SDL2/SDL.h>
@@ -10,11 +11,14 @@
//the base engine object, which represents the state of the game
typedef struct _engine {
//engine stuff
EngineNode* root;
EngineNode* rootNode;
struct timeval simTime;
struct timeval realTime;
bool running;
//Toy stuff
Interpreter interpreter;
//SDL stuff
SDL_Window* window;
SDL_Renderer* renderer;
@@ -22,9 +26,11 @@ typedef struct _engine {
int screenHeight;
} Engine;
//APIs for initializing the engine
CORE_API void initEngine(Engine* engine);
CORE_API void freeEngine(Engine* engine);
//extern singleton
extern Engine engine;
CORE_API void execEngine(Engine* engine);
//APIs for running the engine in main()
CORE_API void initEngine();
CORE_API void execEngine();
CORE_API void freeEngine();