[SDL] SDL mouse events.

Bob Pendleton bob at pendleton.com
Sun Mar 16 14:53:57 PDT 2008


On 3/16/08, Lucas <lucas_pet at live.co.uk> wrote:
>
>
> >No, not quite 500, the queue is only 128 items long. Once the queue is
> full
> >SDL just discards any new events. That means you never have to >process
> >more than 128 events at a time, but if you only check for events every
> >second and you can have 500 events pile up during a second, >you will
> lose
> >372 events. The best idea is to use SDL_WaitEvents() to process events as
> >they come in.
> >
> >      Bob Pendleton
>
> thanks everybody.
>
> Would this mean that when the queue is full of mouse events, all key
> events
> are gone as well?


Yep.

Is it possible to not let SDL push any mouse events on the queue? (I know
> people who poll their mouse at 1000Hz :/)


That statement doesn't make a lot of sense to me. The rate at which the
mouse is polled is not necessarily the rate at which mouse events are
generated. Often physical mouse movements are accumulated and a motion event
is only generated when the position changes by some minimum amount or a
button changes state. Not to mention that a lot (most?) mouse information is
processed as interrupts and not polled at all.

Bob Pendleton

I think getting the mouse state manually (GetMouseState and
> GetRelativeMouseState) is best for me.
> Does GetRelativeMouseState gets the relative state from the last time I
> called that function or relative to last mouse poll (system)?


The last time you called it.

Lucas
>
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



-- 

+ Bob Pendleton: writer and programmer
+ email: Bob at Pendleton.com
+ web: www.GameProgrammer.com
+ www.Wise2Food.com

+--------------------------------------+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080316/1d27dc30/attachment.htm 


More information about the SDL mailing list