engine/test/src/main.cpp

35 lines
604 B
C++
Raw Normal View History

2022-11-07 20:15:26 +00:00
#include "config.h"
#include "game.hpp"
// engine
2022-11-07 20:15:26 +00:00
#include "logger.hpp"
#include "window.hpp"
// standard library
2022-11-07 20:15:26 +00:00
#include <exception>
#include <string.h>
2022-11-07 20:15:26 +00:00
int main(int argc, char* argv[])
2022-11-07 20:15:26 +00:00
{
bool enableFrameLimiter = true;
if (argc == 2) {
if (strcmp(argv[2], "nofpslimit") == 0) enableFrameLimiter = false;
}
2022-11-07 20:15:26 +00:00
engine::setupLog(PROJECT_NAME);
LOG_INFO("{} v{}", PROJECT_NAME, PROJECT_VERSION);
2022-11-07 20:15:26 +00:00
try {
playGame(enableFrameLimiter);
2022-11-07 20:15:26 +00:00
}
catch (const std::exception& e) {
LOG_CRITICAL("{}", e.what());
2022-11-07 20:15:26 +00:00
engine::Window::errorBox(e.what());
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}