I'm having problems with generating a window for my gameplay state using C++ and SFML. I'm at a menu screen I select an option and then the window is just frozen. I think somethings wrong with how I'm trying to draw the window since debugging shows that the program is running. Are there any mistakes that you can see?
This is a skeleton of how the drawing is set up.
//playstate.h
sf::RenderWindow Window;
void Draw();
//playstate.cc
void MenuState::Draw()
{
Window.Clear(sf::Color(50, 50, 150));
Window.Draw(BackgroundSprite);
Window.Draw(currentui.UInter);
// Display window contents on screen
Window.Display();
Window.Clear();
}
The menu which precedes the playstate is set up like this
//menustate.h
void Draw(sf::RenderWindow &Window);
//menustate.cc
void MenuState::Draw(sf::RenderWindow &Window)
{
Window.Clear(sf::Color(50, 50, 150));
Window.Draw(MenuSprite);
Window.Display();
}
The menu appears to work until I select the play option. I can't set up sf::RenderWindow Window in the playstate like it is in the menu because other functions besides Draw need access to it.