/** * Copyright (c) 2025 Dominic Masters * * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ #include "engine/engine.h" #include "asset/assetmanager.h" #include "util/string.h" #include "input/input.h" int main(int argc, char **argv) { errorret_t ret; // Init engine ret = engineInit(); if(ret.code != ERROR_OK) { errorCatch(errorPrint(ret)); return ret.code; } // Setup system path on asset manager if(argc > 0) { stringCopy( ASSET_MANAGER.systemPath, argv[0], sizeof(ASSET_MANAGER.systemPath) / sizeof(char_t) ); } // Begin main loop do { ret = engineUpdate(); if(ret.code != ERROR_OK) { errorCatch(errorPrint(ret)); return ret.code; } } while(ENGINE.running); ret = engineDispose(); if(ret.code != ERROR_OK) { errorCatch(errorPrint(ret)); return ret.code; } return 0; }