64 | | // TODO Implement |
65 | | return ERR::NOT_SUPPORTED; // NOWARN |
| 65 | CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay); |
| 66 | CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(currentMode); |
| 67 | |
| 68 | if(xres) |
| 69 | *xres = (int)CGDisplayPixelsWide(kCGDirectMainDisplay); |
| 70 | if(yres) |
| 71 | *yres = (int)CGDisplayPixelsHigh(kCGDirectMainDisplay); |
| 72 | if(bpp) |
| 73 | // *bpp = (int)CGDisplayBitsPerPixel(kCGDirectMainDisplay); -- CGDisplayBitsPerPixel() deprecated in OS X 10.7 |
| 74 | if (CFStringCompare(pixelEncoding,CFSTR(IO32BitDirectPixels),0)==0) |
| 75 | *bpp = 32; |
| 76 | else if (CFStringCompare(pixelEncoding,CFSTR(IO16BitDirectPixels),0)==0) |
| 77 | *bpp = 16; |
| 78 | else |
| 79 | *bpp = 8; |
| 80 | if(freq) |
| 81 | *freq = (int)CGDisplayModeGetRefreshRate(currentMode); |
| 82 | |
| 83 | return INFO::OK; |