#include "gui/fsm.hpp" #include "graphics/textures.hpp" #include "sound.hpp" #include #include "graphics/shaders.hpp" #include "constants.hpp" #include "gui/backend.hpp" #include "gui/event_router.hpp" #include "graphics/camera.hpp" #include "storyboard/ui.hpp" int main(int, char*[]) { components::init(); sfml::Backend backend; guecs::init(&backend); cinematic::init(); sound::init(); sf::RenderWindow window(sf::VideoMode({SCREEN_WIDTH, SCREEN_HEIGHT}), "Storyboard Editor"); window.setVerticalSyncEnabled(VSYNC); if(FRAME_LIMIT) window.setFramerateLimit(FRAME_LIMIT); window.setPosition({0,0}); gui::routing::Router router; storyboard::UI main("rat_king"); main.init(); while(main.playing()) { main.update(); main.render(window); while(const auto ev = window.pollEvent()) { auto gui_ev = router.process_event(ev); auto mouse_pos = window.mapPixelToCoords(router.position); if(gui_ev == game::Event::QUIT) { return 0; } else if(gui_ev == game::Event::MOUSE_CLICK) { main.mouse(mouse_pos.x, mouse_pos.y, guecs::NO_MODS); } } window.display(); } return 0; }