[SDL] using an image as mouse cursor

Clemens Kirchgatterer clemens at 1541.org
Sat Jan 22 09:32:47 PST 2005


"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)'

clemens




More information about the SDL mailing list