mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
kiritow
002617a557
We decide to use shared_ptr instead. And we will treat a resource class as a reference. (instead of object)
39 lines
730 B
C++
39 lines
730 B
C++
#pragma once
|
|
#include "include.h"
|
|
#include "__Noncopyable.h"
|
|
#include "_SystemCursorType.h"
|
|
#include "Point.h"
|
|
#include "Surface.h"
|
|
#include "__Plugin.h"
|
|
#include <memory>
|
|
namespace MiniEngine
|
|
{
|
|
class Cursor
|
|
{
|
|
public:
|
|
Cursor()=default;
|
|
Cursor(SystemCursorType);
|
|
Cursor(Surface surf,Point hotspot= {0,0});
|
|
|
|
static Cursor&& GetActiveCursor();
|
|
static Cursor&& GetDefaultCursor();
|
|
|
|
static void setShow(bool);
|
|
static bool isShow();
|
|
|
|
void activate();
|
|
|
|
void release();
|
|
private:
|
|
std::shared_ptr<SDL_Cursor> _cur;
|
|
|
|
void _set(SDL_Cursor*);
|
|
void _set_no_delete(SDL_Cursor*);
|
|
SDL_Cursor* _get();
|
|
void _clear();
|
|
|
|
friend class _internal::Plugin;
|
|
};
|
|
} /// End of namespace MiniEngine
|
|
|