16
Window / Event Loop Hitches Program
« on: May 28, 2009, 07:35:34 am »
The event loop ONLY hitches my program while the mouse is moving across the SFML window. So I put a counter in the event loop and moved my mouse a bit to observe how many events were being created each frame due to the mouse.
And my output looks like this:
So it's just accumulating events as long as my mouse is moving. What I really want is for it to just register one event per frame. Either the mouse moved or it didn't.
Why is this accumulating and hitching my program?
Code: [Select]
int numEvents=0;
sf::Event Event;
while (window.GetEvent(Event))
{
numEvents++;
}
cout << numEvents << endl;
And my output looks like this:
Code: [Select]
0
0
3 //tapped my mouse
0
0
0
13 //moved my mouse
0
0
0
0
0
222 //moved my mouse for 2 seconds
So it's just accumulating events as long as my mouse is moving. What I really want is for it to just register one event per frame. Either the mouse moved or it didn't.
Why is this accumulating and hitching my program?