You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Game::Game(int width, int height, int fps, std::string title)
:
board(settings::boardPosition,
settings::boardWidthHeight,
settings::cellSize,
settings::padding),
tetromino(board)
{
assert(!GetWindowHandle()); // If assertion triggers : Window is already opened
SetTargetFPS(fps);
InitWindow(width, height, title.c_str());
}
Game::~Game() noexcept // We promise to compilator that exception is never thrown here // If it is : std::terminate() is called
{
assert(GetWindowHandle()); // If assertion triggers : Window is already closed
CloseWindow();
}
bool Game::GameShouldClose() const // We promise that we do not change the returnable value // Good practice to use it for getters that return value how it is