[SDL] using an image as mouse cursor

Roger D. Vargas roger at ehtsc.co.cu
Sat Jan 22 05:45:23 PST 2005

El sáb, 22-01-2005 a las 17:32, Clemens Kirchgatterer escribió:
> "Roger D. Vargas" <roger at ehtsc.co.cu> wrote:
> > I didnt got any answer about how to convert a surface to cursor, so I
> > tried another method I found in a demo app. I hide system cursor, then
> > use mouse motion events to change image coordinates. The demo works
> > smooth, but in my program for some reason the image floats slowly
> > following mouse path during some time instead of behaving like the
> > system cursor.
> > This is the code I use (copied exactly from demo)
> 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.

Roger D. Vargas
Linux user #180787
ICQ: 117641572
* No hay nada tan importante que no pueda ser olvidado *

More information about the SDL mailing list