49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#include "gui/fsm.hpp"
|
|
#include "textures.hpp"
|
|
#include "sound.hpp"
|
|
#include "ai.hpp"
|
|
#include "animation.hpp"
|
|
#include <iostream>
|
|
#include "shaders.hpp"
|
|
#include "backend.hpp"
|
|
#include "constants.hpp"
|
|
#include "gui/event_router.hpp"
|
|
#include "camera.hpp"
|
|
#include "storyboard/ui.hpp"
|
|
|
|
int main(int, char*[]) {
|
|
components::init();
|
|
sfml::Backend backend;
|
|
guecs::init(&backend);
|
|
animation::init();
|
|
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()) {
|
|
while(const auto ev = window.pollEvent()) {
|
|
auto gui_ev = router.process_event(ev);
|
|
auto mouse_pos = window.mapPixelToCoords(router.position);
|
|
|
|
if(gui_ev == gui::Event::QUIT) {
|
|
return 0;
|
|
} else if(gui_ev == gui::Event::MOUSE_CLICK) {
|
|
main.mouse(mouse_pos.x, mouse_pos.y, guecs::NO_MODS);
|
|
}
|
|
}
|
|
|
|
main.render(window);
|
|
window.display();
|
|
}
|
|
|
|
return 0;
|
|
}
|