blob: b2986b4f42c1d2d87e84c41eb2f92eb9c9012048 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#pragma once
#include "Base.h"
#include <cru/platform/gui/Cursor.h>
#include <SDL3/SDL_mouse.h>
namespace cru::platform::gui::sdl {
class SdlCursor : public SdlResource, public virtual ICursor {
public:
static std::shared_ptr<SdlCursor> CreateSystem(SDL_SystemCursor cursor);
explicit SdlCursor(SDL_Cursor* cursor, bool auto_destroy = true);
~SdlCursor();
SDL_Cursor* GetSdlCursor();
private:
SDL_Cursor* cursor_;
bool auto_destroy_;
};
struct SdlCursorManager : public SdlResource, public virtual ICursorManager {
public:
SdlCursorManager();
std::shared_ptr<ICursor> GetSystemCursor(SystemCursorType type) override;
private:
std::shared_ptr<SdlCursor> arrow_cursor_;
std::shared_ptr<SdlCursor> hand_cursor_;
std::shared_ptr<SdlCursor> ibeam_cursor_;
};
} // namespace cru::platform::gui::sdl
|