[SDL] using an image as mouse cursor

Olof Bjarnason olof.bjarnason at gmail.com
Tue Jan 25 06:47:17 PST 2005


Think of the event queue like a QUEUE; if there are several clients
(events) waiting today (this time around the loop), you may want to
serve all of them today (this time around the loop) and not tomorrow
(next time around the loop), because otherwise the queue will soon
reach all over town (the event queue will fill up). The while loop
takes care of the events this time around the loop, and the if takes
"one customer per day"!

/Olof


On Mon, 24 Jan 2005 11:25:58 +0000, Roger D. Vargas <roger at ehtsc.co.cu> wrote:
> El sáb, 22-01-2005 a las 17:58, Clemens Kirchgatterer escribió:
> > "Roger D. Vargas" <roger at ehtsc.co.cu> wrote:
> >
> > > > most likely you process one event at a time instead of all events in
> > > > the queue.
> > > >
> > > > change your 'if (SDL_PollEvent ...)' to a 'while (SDL_PollEvent)'
> > > >
> > > Well, yes, that was the problem. But I still dont get the difference
> > > between processing with if and processing with while.
> >
> > do you have a SDL_Delay() or usleep() somewhere in your eventloop? if
> > yes - think about it a little bit. :)
> No, i have a delay but out of event processing, inside game processing
> loop.
> 
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at libsdl.org
> > http://www.libsdl.org/mailman/listinfo/sdl
> --
> Roger D. Vargas
> Linux user #180787
> ICQ: 117641572
> * No hay nada tan importante que no pueda ser olvidado *
> Alzheimer
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>




More information about the SDL mailing list