2017-06-18 17:43:23 +08:00
|
|
|
#pragma once
|
|
|
|
#include "include.h"
|
2017-07-30 17:48:22 +08:00
|
|
|
#include "__Noncopyable.h"
|
|
|
|
#include "_handler.h"
|
2017-06-18 20:37:45 +08:00
|
|
|
#include "_SystemCursorType.h"
|
|
|
|
#include "Point.h"
|
|
|
|
#include "Surface.h"
|
2017-07-01 17:11:06 +08:00
|
|
|
#include "__Plugin.h"
|
2017-07-31 00:18:10 +08:00
|
|
|
namespace MiniEngine
|
|
|
|
{
|
2017-07-30 17:48:22 +08:00
|
|
|
class Cursor : public NonCopyable
|
2017-06-18 17:43:23 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
Cursor()=default;
|
|
|
|
Cursor(SystemCursorType);
|
|
|
|
Cursor(Surface surf,Point hotspot= {0,0});
|
|
|
|
|
2017-07-30 17:48:22 +08:00
|
|
|
static Cursor&& GetActiveCursor();
|
|
|
|
static Cursor&& GetDefaultCursor();
|
2017-06-18 17:43:23 +08:00
|
|
|
|
|
|
|
static void setShow(bool);
|
|
|
|
static bool isShow();
|
|
|
|
|
|
|
|
void activate();
|
|
|
|
|
|
|
|
void release();
|
|
|
|
private:
|
2017-07-30 17:48:22 +08:00
|
|
|
res_ptr<SDL_Cursor> _cur;
|
|
|
|
|
2017-06-18 17:43:23 +08:00
|
|
|
void _set(SDL_Cursor*);
|
|
|
|
void _set_no_delete(SDL_Cursor*);
|
|
|
|
SDL_Cursor* _get();
|
|
|
|
void _clear();
|
2017-07-01 17:11:06 +08:00
|
|
|
|
|
|
|
friend class _internal::Plugin;
|
2017-06-18 17:43:23 +08:00
|
|
|
};
|
2017-07-31 00:18:10 +08:00
|
|
|
} /// End of namespace MiniEngine
|
|
|
|
|