Hello. I'm having an issue with pollEvent.
please check out my code
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML works!");
sf::Text text("bla bla ");
text.setPosition(100,100);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(text);
text.rotate(15);
window.display();
}
return 0;
}
what it should be doing is just rotate some text really really fast, but when I move my mouse around the window, the text stops and nothing happens (also the text is rotating really laggy if the mouse is on the window). If I comment out the while loop, everything works as it should.
Also I noticed the same lags and slowdowns in the sample opengl.exe (included with sfml 2.0)
Does anyone know how to fix this?
(this is run on windows 7)