From 0406c899085a3e77a38520ede2c32bafa8f7c7f9 Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Sun, 26 Jan 2014 23:03:45 +0000 Subject: [PATCH] Implements GetMonitorSize for OS X, patch by Echelon9, fixes #2390 This was SVN commit r14690. --- source/lib/sysdep/os/osx/osx.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/lib/sysdep/os/osx/osx.cpp b/source/lib/sysdep/os/osx/osx.cpp index 046c262847..6da99db7b1 100644 --- a/source/lib/sysdep/os/osx/osx.cpp +++ b/source/lib/sysdep/os/osx/osx.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Wildfire Games +/* Copyright (c) 2014 Wildfire Games * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -145,10 +145,17 @@ Status GetVideoMode(int* xres, int* yres, int* bpp, int* freq) return INFO::OK; } -Status GetMonitorSize(int* xres, int* yres, int* bpp, int* freq) +Status GetMonitorSize(int& width_mm, int& height_mm) { - // TODO Implement - return ERR::NOT_SUPPORTED; // NOWARN + CGSize screenSize = CGDisplayScreenSize(kCGDirectMainDisplay); + + if (screenSize.width == 0 || screenSize.height == 0) + return ERR::FAIL; + + width_mm = screenSize.width; + height_mm = screenSize.height; + + return INFO::OK; } } // namespace gfx