Added cocoa cursor methods

This commit is contained in:
Jack Andersen 2015-11-29 17:41:03 -10:00
parent 66c2cbdf14
commit 41256d2673
1 changed files with 26 additions and 0 deletions

View File

@ -955,6 +955,7 @@ class WindowCocoa : public IWindow
WindowCocoaInternal* m_nsWindow; WindowCocoaInternal* m_nsWindow;
IGraphicsContext* m_gfxCtx; IGraphicsContext* m_gfxCtx;
EMouseCursor m_cursor = EMouseCursor::None;
public: public:
@ -1020,6 +1021,31 @@ public:
}); });
} }
void setCursor(EMouseCursor cursor)
{
if (cursor == m_cursor)
return;
m_cursor = cursor;
dispatch_async(dispatch_get_main_queue(),
^{
switch (cursor)
{
case EMouseCursor::Pointer:
[[NSCursor arrowCursor] set];
break;
case EMouseCursor::HorizontalArrow:
[[NSCursor resizeLeftRightCursor] set];
break;
case EMouseCursor::VerticalArrow:
[[NSCursor resizeUpDownCursor] set];
break;
default: break;
}
});
}
void setWaitCursor(bool wait) {}
void setWindowFrameDefault() void setWindowFrameDefault()
{ {
dispatch_sync(dispatch_get_main_queue(), dispatch_sync(dispatch_get_main_queue(),