Advertisement
Guest User

Untitled

a guest
Feb 12th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <SFML/Graphics.hpp>
  2.  
  3. int main()
  4. {
  5.     sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "");
  6.  
  7.     while (window.isOpen())
  8.     {
  9.         sf::Event event;
  10.         while (window.pollEvent(event))
  11.         {
  12.             switch (event.type)
  13.             {
  14.                 case sf::Event::Closed:
  15.                     window.close();
  16.                     break;
  17.  
  18.                 case sf::Event::LostFocus:
  19.                     window.setActive(false);
  20.                     break;
  21.  
  22.                 case sf::Event::GainedFocus:
  23.                     window.setActive(true);
  24.                     break;
  25.             }
  26.         }
  27.  
  28.         window.clear(sf::Color::White);
  29.         window.display();
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement