mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
Replace tri-state functions SDL_EventState(), SDL_GetJoystickEventState(), SDL_GetGamepadEventState(), SDL_ShowCursor()
`SDL_QUERY`, `SDL_IGNORE`, `SDL_ENABLE`, and `SDL_DISABLE` have been removed. SDL_EventState() has been replaced with SDL_SetEventEnabled() SDL_GetEventState() has been replaced with SDL_EventEnabled() SDL_GameControllerEventState has been replaced with SDL_SetGamepadEventsEnabled() and SDL_GamepadEventsEnabled() SDL_JoystickEventState has been replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled() SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible() Fixes https://github.com/libsdl-org/SDL/issues/6929
This commit is contained in:
@@ -137,7 +137,7 @@ static SDL_Cursor *cursors[1 + SDL_NUM_SYSTEM_CURSORS];
|
||||
static SDL_SystemCursor cursor_types[1 + SDL_NUM_SYSTEM_CURSORS];
|
||||
static int num_cursors;
|
||||
static int current_cursor;
|
||||
static int show_cursor;
|
||||
static SDL_bool show_cursor;
|
||||
|
||||
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||
static void
|
||||
@@ -214,7 +214,11 @@ void loop()
|
||||
|
||||
} else {
|
||||
show_cursor = !show_cursor;
|
||||
SDL_ShowCursor(show_cursor);
|
||||
if (show_cursor) {
|
||||
SDL_ShowCursor();
|
||||
} else {
|
||||
SDL_HideCursor();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,7 +304,7 @@ int main(int argc, char *argv[])
|
||||
SDL_SetCursor(cursors[0]);
|
||||
}
|
||||
|
||||
show_cursor = SDL_ShowCursor(SDL_QUERY);
|
||||
show_cursor = SDL_CursorVisible();
|
||||
|
||||
/* Main render loop */
|
||||
done = 0;
|
||||
|
||||
Reference in New Issue
Block a user