branches with status:
Name Status Last Modified Last Commit
lp:~zbigniew-chyla/widelands/use-sdl-color-cursor 1 Development 2018-09-06 13:07:13 UTC 2018-09-06
8809. Use color SDL cursor if possible (wit...

Author: Zbigniew Chyla
Revision Date: 2018-09-06 13:03:36 UTC

Use color SDL cursor if possible (with fallback to old approach)

Currently Widelands paints mouse cursor manually which is bad for user
experience - at 25 FPS the cursor lags behind the actual mouse position
and the user gets impression that there's "something wrong" with the
mouse.

SDL since v2 supports color cursors (SDL_CreateColorCursor) so we can
paint our custom (color) hand using SDL cursor.

Use SDL cursor in WLApplication by:
 - creating SDL_Cursor for both states (normal/clicked) on startup,
 - switching between cursors on button up/down events.
To avoid regressions on systems/setups that don't support our color
cursors keep the old code as a fallback, i.e. if SDL_CreateColorCursor
fails, disable SDL cursor and paint cursor manually.

11 of 1 result