Add Cursor activating method.

This commit is contained in:
Kirigaya Kazuto 2017-04-22 10:33:18 +08:00
parent 0c5186c11a
commit 76010ebd43
2 changed files with 7 additions and 0 deletions

View File

@ -864,6 +864,11 @@ namespace MiniEngine
SDL_ShowCursor(Settings?SDL_ENABLE:SDL_DISABLE); SDL_ShowCursor(Settings?SDL_ENABLE:SDL_DISABLE);
} }
void Cursor::activate()
{
SDL_SetCursor(_get());
}
bool Renderer::isReady() bool Renderer::isReady()
{ {
return (_get() != nullptr); return (_get() != nullptr);

View File

@ -252,6 +252,8 @@ namespace MiniEngine
static void show(bool); static void show(bool);
static bool isShow(); static bool isShow();
void activate();
private: private:
std::shared_ptr<SDL_Cursor> _cur; std::shared_ptr<SDL_Cursor> _cur;
void _set(SDL_Cursor*); void _set(SDL_Cursor*);