Fw: "Laggy" Events

Hi folks,
this is Nils Wogatzky from Germany - just to introduce myself.

I?m having some trouble with SDL - Events.

If I move the mouse over my SDL-App-Window it reacts
a few seconds later.
If I move the Mouse in circles for a while an stop moving,
I can see the Movement been done on the screen. (After I already stopped moving the mouse!)

Seems as if my movement would be faster then the Events.

While writing this I think it has to be anywhere in my code, so
I?ll give a short overview of my code.********************************************
code of the GameLoop:

while(running)
{
PreBlit();

Blit();

HandleEvents();

Process(TimeFactor);

}



HandleEvents - Func:

void HandleEvents()
{

HandleButtonMouseOver();
HandleInventoryMouseOver();
HandleObjectsMouseOver();
HandleReached();

if(SDL_PollEvent(&event))
{

	switch(event.type)
	{
		case SDL_QUIT:
			Running = false;
		break;

		case SDL_KEYDOWN:
			Running = false;
		break;

		case SDL_MOUSEBUTTONUP:
			if(Interaction)
			{
				HandleButtonMouseUp();
				HandleObjectsMouseUp();
				HandleInventoryMouseUp();
				HandleWalkTo();
			}
		break;

		case SDL_MOUSEMOTION:
			if(Interaction)
			{
				//
				// refresh the MousePosition
				//
				SDL_PumpEvents();
				SDL_GetMouseState(&CursorX,&CursorY);
			}
		break;
	}
}

}


I?ve sent the Game to some of my friends to test it on other systems
and on some OS the Events are fast, and on some they run slow.

So I?m a bit confused and really don?t know where to start fixing this problem.
I?ve already searched the Internet, but for this Problem I couldn?t find
proper help.

I hope you can help me

Thanks,

Nils

if(SDL_PollEvent(&event))

This should be:
while(SDL_PollEvent(&event))

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

short and efficient !

thanks a lot ,
Nils Wogatzky, Unemployeeah :wink:

have a nice day>> if(SDL_PollEvent(&event))

This should be:
while(SDL_PollEvent(&event))

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl