Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SFML/System.hpp"
- #include <SFML/Window.hpp>
- int main()
- {
- sf::Window window(sf::VideoMode(800, 600), "OpenGL", sf::Style::Close);//This is the cause of the problem.
- bool running = true;
- while(running){
- sf::Event windowEvent;
- while(window.pollEvent(windowEvent)){
- switch (windowEvent.type)
- {
- case sf::Event::KeyPressed:
- case sf::Event::Closed:
- running = false;
- break;
- default:
- break;
- }
- }
- }
- sf::sleep(sf::seconds(1.f));//This works fine.
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment