Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Engine.hpp>
- #include <TGUI/TGUI.hpp>
- #include <TGUI/Backend/SFML-OpenGL3.hpp>
- int main()
- {
- Engine engine;
- engine.CreateWindow(640, 360, "Issue");
- engine.Init();
- Shader post("../shaders/post.vs", "../shaders/post.frag");
- Framebuffer buf(&post, 640, 360);
- tgui::Gui gui{ engine.GetWindow() };
- gui.loadWidgetsFromFile("form.txt");
- engine.EventLoop([&](sf::Event& event)
- {
- if(event.type == sf::Event::Closed)
- engine.Close();
- });
- engine.Loop([&]()
- {
- if(sf::Keyboard::isKeyPressed(sf::Keyboard::Q))
- {
- buf.Bind();
- gui.draw();
- buf.Unbind();
- buf.Draw();
- }
- else gui.draw();
- });
- engine.Launch();
- }
Add Comment
Please, Sign In to add comment