This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGame::CGame() // Konstruktor klasy. | |
: // Korzystamy z listy inicjalizacyjnej. | |
m_status(Status::Initializing), // Status w konstruktorze ustawiamy na Initializing | |
m_window(sf::VideoMode(800, 600, 32), "Tworzenie gier - ekspansywny kod.", sf::Style::Close) // Tworzymy okno SFMLa. Typowe okienko 800x600. | |
{ | |
} | |
///////////////////////////////////////////////////////// | |
CGame::~CGame() // Destruktor klasy. | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Status | |
{ | |
Initializing = 0, // Ten status zostanie ustawiony gdy wejdziemy do konstruktora klasy gry. | |
Running = 1, // Ten status zostanie ustawiony gdy rozpoczniemy grę. | |
Paused = 2, // Ten status zostanie ustawiony gdy użytkownik zapauzuje gre. | |
CleaningUp = 3 // Ten status zostanie ustawiony gdy użytkownik zamknie aplikację. | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGame::CGame() // Konstruktor klasy. | |
: | |
m_window(sf::VideoMode(800, 600, 32), "Tworzenie gier - rozszerzalny kod wzorem Unreal Engine 4.", sf::Style::Close) | |
{ | |
} | |
///////////////////////////////////////////////////////// | |
CGame::~CGame() // Destruktor klasy. | |
{ | |
if(m_window.isOpen()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
#include <SFML/Window.hpp> | |
#include <SFML/System.hpp> | |
int main() | |
{ | |
sf::RenderWindow window(sf::VideoMode(800, 600, 32), "Tworzenie gier - rozszerzalny kod wzorem Unreal Engine 4.", sf::Style::Close); | |
while(window.isOpen()) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////////////// | |
CGame::CGame() // Konstruktor klasy. | |
{ | |
} | |
///////////////////////////////////////////////////////// | |
CGame::~CGame() // Destruktor klasy. | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CGame final | |
{ | |
public: | |
~CGame(); | |
CGame(const CGame &) = delete; | |
void operator=(const CGame &) = delete; | |
inline static CGame& Instance() | |
{ |
NewerOlder