Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kiaran

Pages: 1 [2]
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.

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?

17
Window / Event Loop Hitches Program
« on: May 28, 2009, 07:33:07 am »
When I move my mouse over the SFML window, it stops updating until the mouse stops. I tried taking everything out of the event loop thinking maybe processing an event was causing the hitch:

Code:
Code: [Select]
sf::Event Event;
while (window.GetEvent(Event))
{
//NOTHING IN HERE!!
}



So I removed the event loop entirely and the hitches disappear!! With no event loop, the program runs smoothly. Obviously, I need to keep my event loop so this is not a solution.

I had this exact problem with SDL, which is part of the reason I decided to try SFML. So far I am really liking this library but this bug is torturing me.

Pages: 1 [2]
anything