载入中...
搜索中...
未找到
Cursor.h
浏览该文件的文档.
1#pragma once
2#include "mouse/Cursor.h"
3#include <SDL2/SDL_mouse.h>
4#include <map>
5
6namespace eve::image {
7 class ImageData;
8}
9
10namespace eve::mouse::sdl {
11
14{
15public:
17 Cursor(image::ImageData *imageData, int hotx, int hoty);
19 Cursor(std::string cursortype);
21 ~Cursor();
22
24 void *getHandle() const;
26 bool isCustom() const override { return is_custom; }
28 std::string getSystemType() const override { return systemType; }
29
30private:
31 SDL_Cursor *cursor;
32 bool is_custom;
33 std::string systemType;
34
35 static std::map<std::string, SDL_SystemCursor> systemCursorEntries;
36};
37
38} // eve::mouse::sdl
Represents raw pixel data.
Definition ImageData.h:38
Opaque mouse cursor (system-defined or custom image).
Definition Cursor.h:12
SDL mouse cursor (custom image or named system cursor).
Definition Cursor.h:14
~Cursor()
Frees the underlying SDL_Cursor.
Definition Cursor.cpp:43
void * getHandle() const
Underlying SDL_Cursor handle.
Definition Cursor.cpp:49
std::string getSystemType() const override
System cursor type name, or empty for custom cursors.
Definition Cursor.h:28
bool isCustom() const override
True when this cursor was built from custom image data.
Definition Cursor.h:26