PDA

View Full Version : SDL and the event queue


WhatMeWorry
2006.09.28, 12:21 AM
SDL puts events in the event queue. I can see how discrete events
like key up or mouse click could be put on the queue.

But how are continuous (analog) events handled like mouse movement?
Say my mouse is currently at position (x,y) and I move the mouse
across the screen to some other point like (x+33, y+27).

Will SDL say sample the mouse position at some delta time interval?
So that a series of mouse positions would be added to the even queue?

I guess another way to say it would be, is the event queue interrupt
driven or are events polled every so often?

Or I'm I completely confused :)

thanks.

OneSadCookie
2006.09.28, 01:03 AM
You'll get a sequence of discrete movements.

WhatMeWorry
2006.09.28, 09:36 AM
How often? And is this user configurable?

ThemsAllTook
2006.09.28, 10:18 AM
I think it's synchronized to your display's refresh rate, but I could be way off on that.

OneSadCookie
2006.09.28, 10:33 AM
I'm not aware of any guarantee of any particular number, frequency or schedule of updates. It's not configurable.

WhatMeWorry
2006.09.28, 02:56 PM
I was worried about creating a huge backlog of "mouse move events" and how one would process them, but come to think of it, you are probably only going to care about detecting "mouse clicks" and then determining it's position.

Thanks All.