This is very weird problem, but first you and us need to know if the problem is SFML or your code.
Try this sample code from sfml visual studio tutorial.
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
If you want, add little event handling to test.
And give your result here.
Is useful to know what version of SFML you are using, your OS and your PC specifications.
PD: If you are using "if", check semi-colon error like:
if (event.type == sf::Event::Closed); // -> note the wrong semi-colon here.
window.close();
Or if using "switch", for missing-break errors:
switch( event.type )
{
case sf::Event::Closed :
window.close() ;
// Missing break here.
case sf::Event::AnyEvent :
any_action() ;
break ;
}