Is this from a different version of SFML? It says to put GetEvent on a seperate thread, but SFML 2.1 only has pollEvent.
Either way I tried putting pollEvent on a seperate thread, but the window locks up (can't drag, minimize, close) unless it's being called on the main thread.
I have a function like this:
int pollThread(){
while (window.isOpen()){
sf::Event ev;
while (window.pollEvent(ev)){
if (ev.type == sf::Event::Closed){
window.close();
return 0;
}
}
}
}
And before I have the drawing loop in the main function I do this:
sf::Thread thread(&pollThread);
thread.launch();