yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
main.cc
Go to the documentation of this file.
1#if defined(_WIN32)
2#define main SDL_main
3#elif __APPLE__
5#endif
6
7#include "absl/debugging/failure_signal_handler.h"
8#include "absl/debugging/symbolize.h"
10
15using namespace yaze::app;
16
20int main(int argc, char** argv) {
21 absl::InitializeSymbolizer(argv[0]);
22
23 absl::FailureSignalHandlerOptions options;
24 options.symbolize_stacktrace = true;
25 options.use_alternate_stack = true;
26 options.alarm_on_failure_secs = true;
27 options.call_previous_handler = true;
28 absl::InstallFailureSignalHandler(options);
29
30 std::string rom_filename;
31 if (argc > 1) {
32 rom_filename = argv[1];
33 }
34
35#ifdef __APPLE__
36 yaze_run_cocoa_app_delegate(rom_filename.c_str());
37 return EXIT_SUCCESS;
38#endif
39
40 core::Controller controller;
41 EXIT_IF_ERROR(controller.OnEntry(rom_filename))
42
43 while (controller.IsActive()) {
44 controller.OnInput();
45 if (auto status = controller.OnLoad(); !status.ok()) {
46 std::cerr << status.message() << std::endl;
47 break;
48 }
49 controller.DoRender();
50 }
51 controller.OnExit();
52
53 return EXIT_SUCCESS;
54}
Main controller for the application.
Definition controller.h:30
absl::Status OnEntry(std::string filename="")
Definition controller.cc:53
#define EXIT_IF_ERROR(expression)
Definition constants.h:44
int main(int argc, char **argv)
Main entry point for the application.
Definition main.cc:20
Main namespace for the ImGui application.
Definition common.cc:23