Ticket #847: t847_osx-getvideomode-v1.patch

File t847_osx-getvideomode-v1.patch, 821 bytes (added by Echelon9, 12 years ago)

First proposed patch

  • source/lib/sysdep/os/osx/osx.cpp

     
    6161
    6262Status GetVideoMode(int* xres, int* yres, int* bpp, int* freq)
    6363{
    64     // TODO Implement
    65     return ERR::NOT_SUPPORTED;  // NOWARN
     64    // CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay);
     65   
     66    if(xres)
     67        *xres = (int)CGDisplayPixelsWide(kCGDirectMainDisplay);
     68    if(yres)
     69        *yres = (int)CGDisplayPixelsHigh(kCGDirectMainDisplay);
     70    if(bpp)
     71        *bpp  = (int)CGDisplayBitsPerPixel(kCGDirectMainDisplay);
     72    if(freq)
     73        *freq = (int)CGDisplayModeGetRefreshRate(currentMode);
     74   
     75    return INFO::OK;
    6676}
    6777
    6878Status GetMonitorSize(int* xres, int* yres, int* bpp, int* freq)