52 lines
937 B
C
52 lines
937 B
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#include "engine.h"
|
|
#include "util/memory.h"
|
|
#include "time/time.h"
|
|
#include "console/console.h"
|
|
#include "display/display.h"
|
|
#include "ecs/ecssystem.h"
|
|
#include "scene/node.h"
|
|
#include "asset/assetsystem.h"
|
|
|
|
#include "scene/test/scenetest.h"
|
|
|
|
engine_t ENGINE;
|
|
|
|
errorret_t engineInit(void) {
|
|
memoryZero(&ENGINE, sizeof(engine_t));
|
|
ENGINE.running = true;
|
|
|
|
// Init systems. Order is important.
|
|
timeInit();
|
|
consoleInit();
|
|
ecsSystemInit();
|
|
assetSystemInit();
|
|
errorChain(displayInit());
|
|
|
|
sceneTestAdd();
|
|
|
|
errorOk();
|
|
}
|
|
|
|
errorret_t engineUpdate(void) {
|
|
timeUpdate();
|
|
consoleUpdate();
|
|
errorChain(displayUpdate());
|
|
|
|
errorOk();
|
|
}
|
|
|
|
errorret_t engineDispose(void) {
|
|
ecsSystemDispose();
|
|
errorChain(displayDispose());
|
|
assetSystemDispose();
|
|
consoleDispose();
|
|
|
|
errorOk();
|
|
} |