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!
full size picture here:
http://d64i.imgup.net/2016-07-305b57.png
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
I don't understand how did you do that!
ReplyDeleteI've made new video for you. The page have been updated.
DeleteYou can try it by yourself. Just create new console c++ project, put there my code and do not forget to add CoreGriphics framework through project settings.
ReplyDeleteDo you have some guidance, step by step, how to make it work. I dont have any experience with xcode and it is difficult to understand.
DeleteI've made new video for you. The page have been updated.
DeleteIs there any guide how to do this? Step by step.
ReplyDeleteI've made new video for you. The page have been updated.
DeleteI've tried
Deletehttps://postimg.org/image/4rnfr9q2d/
but process failed.
Hi Pavle,
DeleteOn the page where you typed program name choose C++ instead of Swift.
Regards
It passed https://postimg.org/image/c36f72g91/
ReplyDeleteBut, how can I change the resolution of my macbook?
Sorry about the questions, but I'm not a programmer od developer :D.
Congratulations! There is the output on your screenshot: https://s9.postimg.org/3q553mi1r/2016_10_10_21_36_10.png
DeleteThis mean you had top resolution already. Probably this is not retina display.
Best solution here is to recycle your computer as I mentioned here http://specialmeaning.blogspot.com/2016/05/apple-please-sorry.html
Good luck!