Advertisement
Guest User

Untitled

a guest
May 30th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include "SFML\Graphics.hpp"
  2. #include <iostream>
  3.  
  4. struct windowVars
  5. {
  6. int windowWidth = 640;
  7. int windowHeight = 480;
  8. std::string WindowTitle = "Platformer";
  9. sf::Event ev;
  10. };
  11.  
  12. int main()
  13. {
  14. windowVars winVar;
  15. sf::RenderWindow win(sf::VideoMode(winVar.windowWidth, winVar.windowHeight), winVar.WindowTitle);
  16.  
  17. while (win.isOpen())
  18. {
  19. while (win.pollEvent(winVar.ev))
  20. {
  21. switch (winVar.ev.type)
  22. {
  23. case sf::Event::Closed: win.close(); break;
  24. }
  25. }
  26.  
  27. win.clear();
  28.  
  29. win.display();
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement