You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
626 B
C++

#include "game.h"
Game::Game()
{
sf::Window window(sf::VideoMode(640, 480), "SFML-Test Application", sf::Style::Default);
window.setActive();
}
int Game::run()
{
clock = std::make_unique<sf::Clock>();
// On the game loop
while (main_window.isOpen())
{
sf::Event event;
while (main_window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
main_window.close();
if ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape))
main_window.close();
}
}
return EXIT_SUCCESS;
}