SFML community forums

Help => Window => Topic started by: HeliumPL on November 17, 2013, 05:27:16 pm

Title: Strange window.pollEvent(event) performance problem - Win 8.1
Post by: HeliumPL on November 17, 2013, 05:27:16 pm
Hi!

Sometimes when I run my game it freezes for about ~200 ms every ~600 ms. Deleting
while (window.pollEvent(event))
fixes the problem. The problem isn't present everytime. Sometimes when I run my game it works normal. If the problem appears I usually run the game(or any other SFML application!) as administrator and this fixes the problem.

My system is Windows 8.1 Pro and I use Visual Studio 2013 for Windows Desktop.

Sorry for bad english!  ;D
Title: Re: Strange window.pollEvent(event) performance problem - Win 8.1
Post by: eXpl0it3r on November 17, 2013, 05:31:34 pm
Do you have a gamepad or joystick plugged into your PC?

You could profile the application to see where it wastes its time. My guess from past experience is that it's hanging in the joystick code... ;)
Title: Re: Strange window.pollEvent(event) performance problem - Win 8.1
Post by: HeliumPL on November 17, 2013, 06:20:08 pm
I have no gamepad/joystick and my game doesn't support it ;)
Title: Re: Strange window.pollEvent(event) performance problem - Win 8.1
Post by: eXpl0it3r on November 17, 2013, 07:06:04 pm
SFML will still be looking for any connected devices. Anyways you should just profile the application and see where the time is being wasted. :)
Title: Re: Strange window.pollEvent(event) performance problem - Win 8.1
Post by: Mario on November 17, 2013, 10:26:11 pm
Maybe you're doing something more weird inside the loop or when handling events? Show some more code or a minimal example? Running my SFML stuff just fine under Windows 8.1 here without any lags or similar issues.
Title: Re: Strange window.pollEvent(event) performance problem - Win 8.1
Post by: HeliumPL on November 19, 2013, 06:14:52 pm
No, I don't. Even if I leave the loop empty, the problem occurs. If I delete it - it's fixed.