diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index 628f11cec..535f724b3 100644 --- a/stella/src/emucore/FrameBuffer.cxx +++ b/stella/src/emucore/FrameBuffer.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.cxx,v 1.61 2005-08-23 18:32:51 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.62 2005-08-24 05:29:59 markgrebe Exp $ //============================================================================ #include @@ -31,6 +31,12 @@ #include "Launcher.hxx" #include "Debugger.hxx" #include "OSystem.hxx" +#ifdef MAC_OSX +extern "C" { +uInt16 macOSXDisplayWidth(void); +uInt16 macOSXDisplayHeight(void); +} +#endif #include "stella.xpm" // The Stella icon @@ -98,10 +104,12 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height, #elif defined(WIN32) myDesktopDim.w = (uInt16) GetSystemMetrics(SM_CXSCREEN); myDesktopDim.h = (uInt16) GetSystemMetrics(SM_CYSCREEN); -#elif defined(MAC_OSX) - // FIXME - add OSX Desktop code here (I don't think SDL supports it yet) -#endif +#endif } +#if defined(MAC_OSX) + myDesktopDim.w = macOSXDisplayWidth(); + myDesktopDim.h = macOSXDisplayHeight(); +#endif // Set fullscreen flag mySDLFlags = myOSystem->settings().getBool("fullscreen") ? SDL_FULLSCREEN : 0; diff --git a/stella/src/macosx/SDLMain.m b/stella/src/macosx/SDLMain.m index aa0aa93b0..bea869fe3 100755 --- a/stella/src/macosx/SDLMain.m +++ b/stella/src/macosx/SDLMain.m @@ -4,7 +4,7 @@ Feel free to customize this file to suit your needs */ -/* $Id: SDLMain.m,v 1.4 2005-05-28 21:06:41 markgrebe Exp $ */ +/* $Id: SDLMain.m,v 1.5 2005-08-24 05:30:00 markgrebe Exp $ */ #import "SDL.h" #import "SDLMain.h" @@ -23,6 +23,17 @@ static char startupFile[FILENAME_MAX]; int fileToLoad = FALSE; char parentdir[MAXPATHLEN]; +unsigned short macOSXDisplayWidth(void) +{ + return(CGDisplayPixelsWide(kCGDirectMainDisplay)); +} + +unsigned short macOSXDisplayHeight(void) +{ + return(CGDisplayPixelsHigh(kCGDirectMainDisplay)); +} + + /* A helper category for NSString */ @interface NSString (ReplaceSubString) - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;