Mac Full Screen - How to detect Retina Display

I’m using code to detect available resolutions to the users display. The last one is the largest, and if user is retina, should be well over 1740 in width.

	var resolutions : Resolution[] = Screen.resolutions; 
	var screenSize = 2;
    for (var res2 in resolutions) {
   	if (res2.width >= 1740)
	{
		screenSize = 3; 
	} 

Now, in the unity player, this works fine on a Retina MBP. However, when playing fullscreen in a Mac build, the largest resolution available is 1440x900, and that’s the largest that Screen.resolutions detects.

Is there any way to tell if the player is Retina-capable?

*** NOTE: When the mac resolution is set to the highest setting (that is, non-retina, just native 2880x1800), the build plays at full screen and detects 1920x1200 resolution, which is Unity’s largest it seems, and screenSize = 3 ***

Just bumping this up -- any ideas?

–

nup; seing the same issue. (I know that doesn't really help, but you're not on your own at least. :/)

–

Nope, iPhone.generation just returns "unknown" when run in the editor, and the build won't complete with the code in. The thing is that Apple itself seems to mimic a smaller resolution to deal with, I'm guessing, older software. If I provide a larger resolution image, it displays retina, but the resolution as far as unity is concerned is always 1440x900, both on retina and non-retina macbook pros.

–

Nope, all of those are purple (already clicked). Unfortunately I think just not enough people use Unity for mac programming so there is far less information -- everything links to iOS.

–

Anyone figure anything out on this? I come from Flash/Stage3D world -- where everything renders at retina quality on my MBP (it's gorgeous) -- so it makes me sad seeing Unity only render its games at standard rez. :(

–

2 Answers

2

You must set the MacFullscreenMode to CaptureDisplay in the Player Settings.
Then the native Retina resolution gets available, too. Either choose this in the Player Settings or switch to it via script using Screen.fullscreen(2880,1800,true);

Not an ideal solution but I have been using an App call “Quick Rez” to turn off Retina on my mac and display everything in native standard resolution. This will get you retina quality content and get rid of HiDPI related glitches.