kuso4ek

main.cpp

Jun 5th, 2022 (edited)
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <Engine.hpp>
  2. #include <TGUI/TGUI.hpp>
  3. #include <TGUI/Backend/SFML-OpenGL3.hpp>
  4.  
  5. int main()
  6. {
  7.     Engine engine;
  8.    
  9.     engine.CreateWindow(640, 360, "Issue");
  10.     engine.Init();
  11.    
  12.     Shader post("../shaders/post.vs", "../shaders/post.frag");
  13.    
  14.     Framebuffer buf(&post, 640, 360);
  15.    
  16.     tgui::Gui gui{ engine.GetWindow() };
  17.    
  18.     gui.loadWidgetsFromFile("form.txt");
  19.    
  20.     engine.EventLoop([&](sf::Event& event)
  21.     {
  22.         if(event.type == sf::Event::Closed)
  23.             engine.Close();
  24.     });
  25.    
  26.     engine.Loop([&]()
  27.     {
  28.         if(sf::Keyboard::isKeyPressed(sf::Keyboard::Q))
  29.         {
  30.             buf.Bind();
  31.             gui.draw();
  32.             buf.Unbind();
  33.             buf.Draw();
  34.         }
  35.         else gui.draw();
  36.     });
  37.    
  38.     engine.Launch();
  39. }
  40.  
Add Comment
Please, Sign In to add comment