My first post here, so sorry if I'm posting in the wrong section
Anyway, I started using SFML to make a simple game, nothing special, just something to pass some time and learn SFML. Everything was fine until I started manipulating sprites that were already loaded. For example:
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace std;
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 8), "I AM SLOWPOKE KING OF SLOW");
App.UseVerticalSync(true);
sf::Image Image;
sf::Sprite Sprite;
Image.LoadFromFile("slowpoke.png");
Sprite.SetImage(Image);
if(!Image.LoadFromFile("slowpoke.png"))
{
cout << "NO SLOWPOKE SPRITE PRESENT.\n";
cout << "ABORT!\n";
return 0;
}
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
App.Close();
}
App.Draw(Sprite);
//ommit when posting to forum
Sprite.SetPosition(200.f, 100.f);
App.Display();
}
return 0;
}
I get a weird flickering of the sprite's original position. BUT when I fullscreen the window or resize it, the flickering disappears and everything is as it should be. I tried it with V-Sync off but it was also flickering (albeit with a smaller frequency). I'm thinking this is a garbage problem... how can I fix it (if I'm correct, if I'm not, please help me).
Thanks in advance
PS will post screenshots if needed