Saturday, July 30, 2016

Yes, Apple, I did it

Yes, I bought it and it is absolutely awesome. Thanks to Stieve for his awesome input to pleasent work!
Really lovely thing












Maximum resolution reachable through Xcode









//
//  main.cpp
//  Resolution
//
//  Created by Сергей Кривонос on 28.07.16.
//  Copyright © 2016 Сергей Кривонос. All rights reserved.
//

#include <iostream>
#include <CoreGraphics/CoreGraphics.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    auto mainDisplayId = CGMainDisplayID();
    
    std::cout << "Current resolution was "
    << CGDisplayPixelsWide(mainDisplayId) << 'x'
    << CGDisplayPixelsHigh(mainDisplayId) << std::endl
    << "Supported resolution modes:";
    
    auto modes = CGDisplayCopyAllDisplayModes(mainDisplayId, nullptr);
    auto count = CFArrayGetCount(modes);
    CGDisplayModeRef mode;
    for(auto c=count;c--;){
        mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modes, c);
        auto w = CGDisplayModeGetWidth(mode);
        auto h = CGDisplayModeGetHeight(mode);
        std::cout << std::endl << w << 'x' << h;
    }
    CGDisplaySetDisplayMode(mainDisplayId, mode, nullptr);
    std::cout << " is the selected top one." << std::endl;
    std::cin.get();
    return 0;

}





Do not forget to add CoreGriphics and CoreFoundation frameworks through project setting.






Enjoy!



You know what? Apple even supports higher resolution the was announced!


Current resolution was 1440x900
Supported resolution modes:
640x480
800x600
1024x768
1280x800
1440x900
2048x1280
1152x720
2304x1440 << this was announced

2560x1600 is the selected top one.











full size picture here:
http://d64i.imgup.net/2016-07-305b57.png