55
66#include < utility>
77
8- #include < SDL2 /SDL.h>
8+ #include < SDL3 /SDL.h>
99
1010#include < gf2/core/Log.h>
1111
@@ -21,18 +21,18 @@ namespace gf {
2121
2222 [[maybe_unused]] constexpr void cursor_check ()
2323 {
24- cursor_type_check<CursorType::Arrow, SDL_SYSTEM_CURSOR_ARROW >();
25- cursor_type_check<CursorType::Text, SDL_SYSTEM_CURSOR_IBEAM >();
24+ cursor_type_check<CursorType::Default, SDL_SYSTEM_CURSOR_DEFAULT >();
25+ cursor_type_check<CursorType::Text, SDL_SYSTEM_CURSOR_TEXT >();
2626 cursor_type_check<CursorType::Wait, SDL_SYSTEM_CURSOR_WAIT>();
2727 cursor_type_check<CursorType::Cross, SDL_SYSTEM_CURSOR_CROSSHAIR>();
28- cursor_type_check<CursorType::ArrowWait, SDL_SYSTEM_CURSOR_WAITARROW >();
29- cursor_type_check<CursorType::SizeTopLeftBottomRight, SDL_SYSTEM_CURSOR_SIZENWSE >();
30- cursor_type_check<CursorType::SizeBottomLeftTopRight, SDL_SYSTEM_CURSOR_SIZENESW >();
31- cursor_type_check<CursorType::SizeHorizontal, SDL_SYSTEM_CURSOR_SIZEWE >();
32- cursor_type_check<CursorType::SizeVertical, SDL_SYSTEM_CURSOR_SIZENS >();
33- cursor_type_check<CursorType::SizeAll, SDL_SYSTEM_CURSOR_SIZEALL >();
34- cursor_type_check<CursorType::Hand, SDL_SYSTEM_CURSOR_HAND >();
35- cursor_type_check<CursorType::NotAllowed, SDL_SYSTEM_CURSOR_NO >();
28+ cursor_type_check<CursorType::Progress, SDL_SYSTEM_CURSOR_PROGRESS >();
29+ cursor_type_check<CursorType::SizeTopLeftBottomRight, SDL_SYSTEM_CURSOR_NWSE_RESIZE >();
30+ cursor_type_check<CursorType::SizeBottomLeftTopRight, SDL_SYSTEM_CURSOR_NESW_RESIZE >();
31+ cursor_type_check<CursorType::SizeHorizontal, SDL_SYSTEM_CURSOR_EW_RESIZE >();
32+ cursor_type_check<CursorType::SizeVertical, SDL_SYSTEM_CURSOR_NS_RESIZE >();
33+ cursor_type_check<CursorType::Move, SDL_SYSTEM_CURSOR_MOVE >();
34+ cursor_type_check<CursorType::Pointer, SDL_SYSTEM_CURSOR_POINTER >();
35+ cursor_type_check<CursorType::NotAllowed, SDL_SYSTEM_CURSOR_NOT_ALLOWED >();
3636 }
3737
3838 }
@@ -53,7 +53,7 @@ namespace gf {
5353 Cursor::~Cursor ()
5454 {
5555 if (m_cursor != nullptr ) {
56- SDL_FreeCursor (m_cursor);
56+ SDL_DestroyCursor (m_cursor);
5757 }
5858 }
5959
@@ -65,7 +65,12 @@ namespace gf {
6565
6666 void Cursor::set_mouse_cursor_visible (bool visible)
6767 {
68- SDL_ShowCursor (visible ? SDL_ENABLE : SDL_DISABLE);
68+ // TODO: [SDL3] check return
69+ if (visible) {
70+ SDL_ShowCursor ();
71+ } else {
72+ SDL_HideCursor ();
73+ }
6974 }
7075
7176 void Cursor::set_mouse_cursor (const Cursor* cursor)
0 commit comments