testcustomcursor: Log the current cursor type as it changes.

So you know what you're looking at.
This commit is contained in:
Ryan C. Gordon 2022-05-17 12:49:36 -04:00
parent e9c7b5191c
commit a12ffbd532
1 changed files with 21 additions and 0 deletions

View File

@ -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);