light/modules/app/public/entrypoint.hpp

28 lines
545 B
C++
Raw Normal View History

2021-05-20 10:21:08 +04:30
#pragma once
#include <app/application.hpp>
2021-05-20 10:21:08 +04:30
auto main(int argc, char *argv[]) -> int32_t
2025-07-11 00:24:44 +03:30
try
2021-05-20 10:21:08 +04:30
{
2025-07-11 00:24:44 +03:30
std::ignore = argc;
std::ignore = argv;
auto application = lt::Scope<lt::app::Application> {};
application = lt::app::create_application();
if (!application)
{
throw std::runtime_error { "Failed to create application\n" };
}
2025-07-11 00:24:44 +03:30
application->game_loop();
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
}