Advertisement
Guest User

Untitled

a guest
Feb 12th, 2017
117
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement