2021-05-05 23:43:30 +00:00
|
|
|
#include "../version.h"
|
2017-02-24 08:28:44 +00:00
|
|
|
#include "athena/Global.hpp"
|
|
|
|
#include "logvisor/logvisor.hpp"
|
2021-05-10 22:16:42 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
#include "metal/VISIRendererMetal.hh"
|
|
|
|
#else
|
|
|
|
#include "vulkan/VISIRendererVulkan.hpp"
|
2017-02-24 08:28:44 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static logvisor::Module AthenaLog("Athena");
|
2021-05-05 23:43:30 +00:00
|
|
|
static void AthenaExc(athena::error::Level level, const char * /*file*/, const char *, int /*line*/,
|
2019-08-31 20:40:07 +00:00
|
|
|
fmt::string_view fmt, fmt::format_args args) {
|
|
|
|
AthenaLog.vreport(logvisor::Level(level), fmt, args);
|
2017-02-24 08:28:44 +00:00
|
|
|
}
|
|
|
|
|
2021-05-05 23:43:30 +00:00
|
|
|
int main(int argc, const char **argv) {
|
|
|
|
if (argc > 1 && !strcmp(argv[1], "--dlpackage")) {
|
|
|
|
fmt::print(FMT_STRING("{}\n"), METAFORCE_DLPACKAGE);
|
|
|
|
return 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
logvisor::RegisterStandardExceptions();
|
|
|
|
logvisor::RegisterConsoleLogger();
|
|
|
|
atSetExceptionHandler(AthenaExc);
|
2021-05-10 22:16:42 +00:00
|
|
|
#ifdef __APPLE__
|
2021-05-05 23:43:30 +00:00
|
|
|
VISIRendererMetal renderer(argc, argv);
|
2021-05-10 22:16:42 +00:00
|
|
|
#else
|
|
|
|
VISIRendererVulkan renderer(argc, argv);
|
|
|
|
#endif
|
|
|
|
renderer.Run(nullptr);
|
2021-05-05 23:43:30 +00:00
|
|
|
return renderer.ReturnVal();
|
2017-02-24 08:28:44 +00:00
|
|
|
}
|