- implemented fullscreen toggle in Cocoa backend

Window size and position are not saved yet
This commit is contained in:
alexey.lysiuk 2018-06-18 22:43:37 +03:00
parent 67733ed6e6
commit 37a0c1d6c1

View file

@ -204,6 +204,7 @@ public:
virtual DFrameBuffer* CreateFrameBuffer();
static void ToggleFullscreen(bool yes);
static bool IsFullscreen();
static void UseHiDPI(bool hiDPI);
static void SetCursor(NSCursor* cursor);
@ -374,6 +375,14 @@ DFrameBuffer* CocoaVideo::CreateFrameBuffer()
return fb;
}
void CocoaVideo::ToggleFullscreen(bool yes)
{
if (CocoaVideo* const video = GetInstance())
{
video->SetMode(yes, video->m_hiDPI);
}
}
bool CocoaVideo::IsFullscreen()
{
CocoaVideo* const video = GetInstance();
@ -555,7 +564,7 @@ bool SystemFrameBuffer::IsFullscreen()
void SystemFrameBuffer::ToggleFullscreen(bool yes)
{
SetMode(...); // todo
CocoaVideo::ToggleFullscreen(yes);
}