NoobsDeSroobs

Barebone OpenGL project

Jul 13th, 2014
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include "SFML/System.hpp"
  2. #include <SFML/Window.hpp>
  3. int main()
  4. {
  5.     sf::Window window(sf::VideoMode(800, 600), "OpenGL", sf::Style::Close);//This is the cause of the problem.
  6.  
  7.     bool running = true;
  8.     while(running){
  9.         sf::Event windowEvent;
  10.         while(window.pollEvent(windowEvent)){
  11.             switch (windowEvent.type)
  12.             {
  13.             case sf::Event::KeyPressed:
  14.             case sf::Event::Closed:
  15.                 running = false;
  16.                 break;
  17.  
  18.             default:
  19.                 break;
  20.             }
  21.         }
  22.  
  23.     }
  24.  
  25.     sf::sleep(sf::seconds(1.f));//This works fine.
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment