From a12ffbd5325aec02531066ac302ed7f4985ef416 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 17 May 2022 12:49:36 -0400 Subject: [PATCH] testcustomcursor: Log the current cursor type as it changes. So you know what you're looking at. --- test/testcustomcursor.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/testcustomcursor.c b/test/testcustomcursor.c index 2feee81a2..d29c1c56f 100644 --- a/test/testcustomcursor.c +++ b/test/testcustomcursor.c @@ -160,7 +160,28 @@ loop() if (current_cursor == SDL_arraysize(cursors)) { current_cursor = 0; } + SDL_SetCursor(cursors[current_cursor]); + + if (current_cursor == 0) { + SDL_Log("Custom cursor"); + } else { + switch ((SDL_SystemCursor) (current_cursor-1)) { + case SDL_SYSTEM_CURSOR_ARROW: SDL_Log("Arrow"); break; + case SDL_SYSTEM_CURSOR_IBEAM: SDL_Log("I-beam"); break; + case SDL_SYSTEM_CURSOR_WAIT: SDL_Log("Wait"); break; + case SDL_SYSTEM_CURSOR_CROSSHAIR: SDL_Log("Crosshair"); break; + case SDL_SYSTEM_CURSOR_WAITARROW: SDL_Log("Small wait cursor (or Wait if not available)"); break; + case SDL_SYSTEM_CURSOR_SIZENWSE: SDL_Log("Double arrow pointing northwest and southeast"); break; + case SDL_SYSTEM_CURSOR_SIZENESW: SDL_Log("Double arrow pointing northeast and southwest"); break; + case SDL_SYSTEM_CURSOR_SIZEWE: SDL_Log("Double arrow pointing west and east"); break; + case SDL_SYSTEM_CURSOR_SIZENS: SDL_Log("Double arrow pointing north and south"); break; + case SDL_SYSTEM_CURSOR_SIZEALL: SDL_Log("Four pointed arrow pointing north, south, east, and west"); break; + case SDL_SYSTEM_CURSOR_NO: SDL_Log("Slashed circle or crossbones"); break; + case SDL_SYSTEM_CURSOR_HAND: SDL_Log("Hand"); break; + default: SDL_Log("UNKNOWN CURSOR TYPE, FIX THIS PROGRAM."); break; + } + } } else { show_cursor = !show_cursor; SDL_ShowCursor(show_cursor);