4coder » Forums » Mac OSX Retina Display Support?
yisp
2 posts
#13971 Mac OSX Retina Display Support?
1 week ago Edited by on Jan. 10, 2018, 4:04 a.m. Reason: Initial post

Does the paid version have support for Retina displays? I tried the demo on itch.io and it doesn't seem to work w/ my Macbook Retina display, unless I'm missing some flags I should pass in or something?
Mr4thDimention
Allen Webster
304 posts
2 projects

Heyo

#13974 Mac OSX Retina Display Support?
6 days, 22 hours ago

No it doesn't do anything to work with retina displays right now. It's on my todo list but not too close to the top at the moment.
forkingpaths
Martin Fouilleul
22 posts
1 project
I started programming and teaching myself the workings of computers in parallel ...
#13975 Mac OSX Retina Display Support?
6 days, 22 hours ago

Hi,

If you are using a custom NSView and NSOpenGLContext, it shouldn't be too hard to make it work for retina, you would want to set :

1
[view  setWantsBestResolutionOpenGLSurface:YES];


Then you want to save your backing store scaling :

1
2
3
4
5
NSRect bounds = [view bounds];
NSRect backingBounds = [view convertRectToBacking:bounds];

float scaleX = backingBounds.size.width/bounds.size.width;
float scaleY = backingBounds.size.height/bounds.size.height;


Then you can use it to adapt your opengl viewport accordingly :

1
glViewport(0, 0, width*scaleX, height*scaleY);


That should be sufficient to benefit for the high res on retina displays (ie there should be no need to modify your rendering code)

Hope that helps !
Mr4thDimention
Allen Webster
304 posts
2 projects

Heyo

#13980 Mac OSX Retina Display Support?
5 days, 23 hours ago

That does help a lot! I'll bump it to the top of the list.