26 throw Exception(
"Cannot create cursor: %s", SDL_GetError());
32 , systemType(cursortype)
34 if (
auto i = systemCursorEntries.find(cursortype); i != systemCursorEntries.end())
35 cursor = SDL_CreateSystemCursor(i->second);
37 throw Exception(
"Cannot create system cursor: invalid type.");
40 throw Exception(
"Cannot create system cursor: %s", SDL_GetError());
46 SDL_FreeCursor(cursor);
54std::map<std::string, SDL_SystemCursor> Cursor::systemCursorEntries =
56 {
"ARROW", SDL_SYSTEM_CURSOR_ARROW},
57 {
"IBEAM", SDL_SYSTEM_CURSOR_IBEAM},
58 {
"WAIT", SDL_SYSTEM_CURSOR_WAIT},
59 {
"CROSSHAIR", SDL_SYSTEM_CURSOR_CROSSHAIR},
60 {
"WAITARROW", SDL_SYSTEM_CURSOR_WAITARROW},
61 {
"SIZENWSE", SDL_SYSTEM_CURSOR_SIZENWSE},
62 {
"SIZENESW", SDL_SYSTEM_CURSOR_SIZENESW},
63 {
"SIZEWE", SDL_SYSTEM_CURSOR_SIZEWE},
64 {
"SIZENS", SDL_SYSTEM_CURSOR_SIZENS},
65 {
"SIZEALL", SDL_SYSTEM_CURSOR_SIZEALL},
66 {
"NO", SDL_SYSTEM_CURSOR_NO},
67 {
"HAND", SDL_SYSTEM_CURSOR_HAND},