Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Dec 9, 2023
1 parent e8d143b commit d762b95
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions modules/main/src/tactile/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <SDL2/SDL.h>

#include "tactile/core/editor_app.hpp"
#include "tactile/core/engine/engine.hpp"
#include "tactile/core/plugin/plugin_manager.hpp"
#include "tactile/foundation/debug/terminate_handler.hpp"
#include "tactile/foundation/io/save/save_format_context.hpp"
Expand Down Expand Up @@ -72,18 +74,22 @@ auto main(const int argc, char* argv[]) -> int
return EXIT_FAILURE;
}

auto& render_context = RenderContext::get();

if (!render_context.get_window()) {
auto* window = RenderContext::get().get_window();
if (!window) {
TACTILE_LOG_FATAL("No window was installed");
return EXIT_FAILURE;
}

if (!render_context.get_renderer()) {
auto* renderer = RenderContext::get().get_renderer();
if (!renderer) {
TACTILE_LOG_FATAL("No renderer was installed");
return EXIT_FAILURE;
}

EditorApp app {window, renderer};
Engine engine {&app, renderer};
engine.run();

return EXIT_SUCCESS;
}
catch (const Exception& err) {
Expand Down

0 comments on commit d762b95

Please sign in to comment.