This repository has been archived on 2025-06-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
LotoStatek/main.cpp
Andrii Solianyk 9d4af21d4d Migrated the whole main loop
The main loop of the game is now contained in Plansza class
2024-12-04 22:12:30 +01:00

35 lines
897 B
C++

#include <iostream>
#include "SFML/Graphics.hpp"
#include "headers/Plansza.h"
int main()
{
std::clog << "Game started\n";
sf::RenderWindow mainWindow(sf::VideoMode(600, 800), "LotoStatek");
mainWindow.setVerticalSyncEnabled(true);
mainWindow.setFramerateLimit(60);
sf::Image icon;
icon.loadFromFile("../assets/img/icon/ikonka.png");
mainWindow.setIcon(128, 128, icon.getPixelsPtr());
Plansza plansza(mainWindow.getSize().y, mainWindow.getSize().x, &mainWindow);
while (mainWindow.isOpen()) {
mainWindow.clear();
// Tu są handlowane eventy
sf::Event event{};
while (mainWindow.pollEvent(event)) {
if(event.type == sf::Event::Closed || sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
mainWindow.close();
}
plansza.update();
mainWindow.display();
}
return 0;
}