[SDL] SDL_WarpMouse

joey tsai joeytsai at corban.resnet.gatech.edu
Sat Feb 2 14:04:04 PST 2002


Hi, I want to use a mouse in my program, but I'm running into a bit a
problem:

I want the mouse to start somewhere in the window, say, in the middle.
I use SDL_WarpMouse to do so, but the first SDL_MOUSEMOTION event polled
corresponds to the WarpMouse.  (The event.motion.[xy] == event.motion.[xy]rel)

How can I either (1) remove that event from the event queue or (2)
detect (so I can ignore) that SDL_WarpMouse was used?  Or is there
another cleaner solution?  (Right now, I'm just ignoring the first
MOUSEMOTION.)

Thanks!

    // joey tsai

-- 
           |  I believe in Christianity as I believe that the sun has risen,
 joey tsai |  not because I see it, but because by it I see everything else.
           |               -- CS Lewis, Weight of Glory, "Is Theology Poetry?"




More information about the SDL mailing list