4coder»Forums
2 posts
Mac OSX Retina Display Support?
Edited by yisp on 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?
Allen Webster
476 posts / 6 projects
Heyo
Mac OSX Retina Display Support?
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.
Martin Fouilleul
39 posts / 3 projects
PhD student at Ircam, doing research on programming languages for temporal interaction. Former sound engineer and computer music designer.
Mac OSX Retina Display Support?
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 !
Allen Webster
476 posts / 6 projects
Heyo
Mac OSX Retina Display Support?
That does help a lot! I'll bump it to the top of the list.