So i've just picked up SFML for my first romp into using real graphics for programming (and so far i love it), however i am having a problem with sprite drawing and my Clear() method.
whenever i call the Clear() method all my sprites that work and draw properly without it suddenly stop drawing altogether and stop existing. I have a feeling i am doing something very basic wrong, or i have put code in the wrong place.
while(true)
{
app.Clear(sf::Color(0, 255, 255));
app.Display();
app.Draw(player.drawsprite());
float ElapsedTime = app.GetFrameTime();
if(app.GetEvent(Event))
{
if(app.GetInput().IsKeyDown(sf::Key::Up))
{
player.move_up();
}
if(Event.Type == Event::Closed)
{
return EXIT_SUCCESS;
}
if(Event.Type == Event::KeyPressed && Event.Key.Code == Key::Escape)
{
return EXIT_SUCCESS;
}
}
}
any help would be much appreciated.