COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 08-31-2017, 06:51 AM   #1
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 542
Default How to get the system GUI scale ratio for mac

I am kinda stuck here. I need that to update my framework to support true retina...
__________________
Website | Facebook Page | IPlug-Youlean
Youlean is online now   Reply With Quote
Old 08-31-2017, 11:47 AM   #2
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,017
Default

might find something here:

https://github.com/olilarkin/wdl-ol/pull/38

or my old retina implementation which i removed from next branch, can't remember the exact details

https://github.com/AlexHarker/wdl-ol...7c74b266982b62

bool isRetina = CGContextConvertSizeToDeviceSpace(pCGC, CGSizeMake(1,1)).width > 1.9;
__________________
VirtualCZ | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 08-31-2017, 12:50 PM   #3
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 542
Default

Quote:
Originally Posted by olilarkin View Post
bool isRetina = CGContextConvertSizeToDeviceSpace(pCGC, CGSizeMake(1,1)).width > 1.9;
Thanks Oli. This is first thing I tried out it this doesn't give us right GUI scaling. For example if I set lower resolution on my 1080p monitor connected to my non retina macbook function returns 300. Also this function requires mGraphicsCocoa which is not available until we open the window which is not a deal breaker but it would be nice to have option to get correct scaling even before you open the window. On windows this is handled by getting main window and returning it's DPI. I have already implement this on windows side (though I still have to test this more), now only to figure this on mac side. Did I mention that I hate doing objective c btw..
__________________
Website | Facebook Page | IPlug-Youlean
Youlean is online now   Reply With Quote
Old 09-03-2017, 05:11 PM   #4
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 542
Default

I found a simple way to get system gui scaling but mac is giving me a lot of trouble because it automatically resizes window if HiDPI mode is enabled. Not sure how to prevent that...
__________________
Website | Facebook Page | IPlug-Youlean
Youlean is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.