27 |
|
* Ctrl-F5 = grab mouse (in windowed mode) |
28 |
|
* |
29 |
|
* FIXMEs and TODOs: |
30 |
+ |
* - Windows requires an extra mouse event to update the actual cursor image? |
31 |
|
* - Ctr-Tab for suspend/resume but how? SDL does not support that for non-Linux |
32 |
|
* - Ctrl-Fn doesn't generate SDL_KEYDOWN events (SDL bug?) |
33 |
|
* - Mouse acceleration, there is no API in SDL yet for that |
34 |
|
* - Force relative mode in Grab mode even if SDL provides absolute coordinates? |
34 |
– |
* - Fullscreen mode |
35 |
|
* - Gamma tables support is likely to be broken here |
36 |
|
* - Events processing is bound to the general emulation thread as SDL requires |
37 |
|
* to PumpEvents() within the same thread as the one that called SetVideoMode(). |
38 |
|
* Besides, there can't seem to be a way to call SetVideoMode() from a child thread. |
39 |
– |
* - Refresh performance is still slow. Use SDL_CreateRGBSurface()? |
39 |
|
* - Backport hw cursor acceleration to Basilisk II? |
40 |
|
* - Factor out code |
41 |
|
*/ |
2189 |
|
LOCK_EVENTS; |
2190 |
|
SDL_FreeCursor(sdl_cursor); |
2191 |
|
sdl_cursor = SDL_CreateCursor(MacCursor + 4, MacCursor + 36, 16, 16, MacCursor[2], MacCursor[3]); |
2192 |
< |
if (sdl_cursor) |
2192 |
> |
if (sdl_cursor) { |
2193 |
|
SDL_SetCursor(sdl_cursor); |
2194 |
+ |
#ifdef WIN32 |
2195 |
+ |
// XXX Windows apparently needs an extra mouse event to |
2196 |
+ |
// make the new cursor image visible |
2197 |
+ |
int visible = SDL_ShowCursor(-1); |
2198 |
+ |
if (visible) { |
2199 |
+ |
int x, y; |
2200 |
+ |
SDL_GetMouseState(&x, &y); |
2201 |
+ |
SDL_WarpMouse(x, y); |
2202 |
+ |
} |
2203 |
+ |
#endif |
2204 |
+ |
} |
2205 |
|
UNLOCK_EVENTS; |
2206 |
|
} |
2207 |
|
#endif |