Hello!
I'm making a simple TicTacToe game, and I'm having some problems with the graphics.
I've written a class containing everything I need:
class Game
{
public:
Game();
~Game();
//boring stuff
private:
bool turn; // 1 for x, 0 for O
int board[4][4]; // 1 for x, -1 for 0, 0 for avaiblable square
sf::RenderWindow app;
};
Game::Game()
{
//more boring stuff
cout << "enter"; //This is printed
app.Create(sf::VideoMode (800,600,32) , "TicTacToe");
cout << "exit"; //This is not printed
}
The code runs fine without the RenderWindow, but when I add it the program just crashes ( "TicTacToe.exe has stopped working" ). To be more exact, first the console shows, then the window shows, then it stays like this for a few seconds and only after that it crashes.
What am I doing wrong?
Thank you.
Edit:
I forgot to mention. After I close the window, the program returns -1073741819.