SDL: implement cursor icon API (#135)

This commit is contained in:
DS
2022-11-12 15:52:39 +01:00
committed by GitHub
parent b9e0641203
commit 1579ce2740
2 changed files with 49 additions and 0 deletions

View File

@ -1197,6 +1197,25 @@ void CIrrDeviceSDL::createKeyMap()
KeyMap.sort();
}
void CIrrDeviceSDL::CCursorControl::initCursors()
{
Cursors.reserve(gui::ECI_COUNT);
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW)); // ECI_NORMAL
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_CROSSHAIR)); // ECI_CROSS
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_HAND)); // ECI_HAND
Cursors.emplace_back(nullptr); // ECI_HELP
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_IBEAM)); // ECI_IBEAM
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_NO)); // ECI_NO
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_WAIT)); // ECI_WAIT
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEALL)); // ECI_SIZEALL
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENESW)); // ECI_SIZENESW
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENWSE)); // ECI_SIZENWSE
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENS)); // ECI_SIZENS
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEWE)); // ECI_SIZEWE
Cursors.emplace_back(nullptr); // ECI_UP
}
} // end namespace irr
#endif // _IRR_COMPILE_WITH_SDL_DEVICE_