light/modules/engine/include/engine/core/entrypoint.hpp

28 lines
593 B
C++
Raw Normal View History

2021-05-20 10:21:08 +04:30
#pragma once
2025-07-11 00:24:44 +03:30
#include <engine/engine.hpp>
2021-05-20 10:21:08 +04:30
2025-07-11 00:24:44 +03:30
int main(int argc, char *argv[]) // NOLINT
try
2021-05-20 10:21:08 +04:30
{
2025-07-11 00:24:44 +03:30
std::ignore = argc;
std::ignore = argv;
2025-07-11 00:24:44 +03:30
auto application = lt::Scope<lt::Application> {};
2025-07-11 00:24:44 +03:30
application = lt::create_application();
2025-07-11 02:12:55 +03:30
lt::ensure(application, "Failed to create application");
lt::ensure(application->sanity_check(), "Failed to verify the sanity of the application");
2025-07-11 00:24:44 +03:30
application->game_loop();
2025-07-11 00:24:44 +03:30
return EXIT_SUCCESS;
2021-05-20 10:21:08 +04:30
}
2025-07-11 00:24:44 +03:30
catch (const std::exception &exp)
2021-06-26 13:09:11 +04:30
{
2025-07-11 00:24:44 +03:30
log_crt("Terminating due to uncaught exception:");
log_crt("\texception.what(): {}", exp.what());
return EXIT_FAILURE;
2021-06-26 13:09:11 +04:30
}