Coder Social home page Coder Social logo

Comments (8)

codeservice avatar codeservice commented on August 15, 2024

Also I have suggestions from developers for how we can support Retina Mac display:

  1. In the code where you initialize an NSOpenGLView you need to do this:

    [self setWantsBestResolutionOpenGLSurface:YES];

More details here:
https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/EnablingOpenGLforHighResolution/EnablingOpenGLforHighResolution.html

  1. In your app's Info.plist file you need to add this:

    <key>NSHighResolutionCapable</key>
    <true/>

Do we need this Retina display support in NME?

P.S. in case of SDL it can be missing flag:
SDL_WINDOW_ALLOW_HIGHDPI

https://stackoverflow.com/questions/17918921/retina-display-support-with-sdl

from nme.

hughsando avatar hughsando commented on August 15, 2024

Yes, the current settings use a lower-res backbuffer on mac SDL, but the dpi should get reported relative to this backbuffer and so the font sizes can be made correct.
When the high DPI flag is added SDL_WINDOW_ALLOW_HIGHDPI, a few more adjustments need to be made to get the viewport, dpi and mouse coordinates correct.
There is working code in there for ios/android/windows but mac goes to some lengths to make getting the best resolution difficult.
Are you using a DPI scale for fonts etc? Do you set the app to high DPI mode yourself, or just use what nme uses?

from nme.

codeservice avatar codeservice commented on August 15, 2024

I am using NME without high dpi flag and my app scaled using DPI. Users complained font size small other time that resolution to low.
It’s possible print DPI value from my app and user reported these values:
110.50000165954 - DPI
1440 - resX
900 - resY
Twice less then Retina display on Mac can provide.
https://support.apple.com/en-au/HT202471
I don’t have Retina display and can’t try any experiments here. Do you think NME need to support Mac high resolution DPI or current method acceptable?

from nme.

hughsando avatar hughsando commented on August 15, 2024

I think both can be supported. I have been using NME on mac with the OS background scaling and I use nme.ui.Scale.getFontScale(); and things generally seem good. But I will add the Hires as an option (or maybe default) like it is on IOS because it makes me a bit sad to have unused resolution. There may be some performance implications - bit not too sure if it will be noticeable.

from nme.

codeservice avatar codeservice commented on August 15, 2024

Thanks! User who asked for high resolution support, promise me to provide complete testing for new app version, because I don’t have this type of Mac. Hope it will work well and performance not downgrade to much.

from nme.

hughsando avatar hughsando commented on August 15, 2024

So I have added an nmml flag, like <window highDpi="true" /> which does make things look better on a macbook.
You should probably check your font scales etc. but you may have already have done this on IOS.
One thing to watch out for is SDL window sizes are in "virtual pixels" so your render pixels may not match in some of the SDL window API calls if you are using them directly (or indirectly in a way I have not tested)

from nme.

codeservice avatar codeservice commented on August 15, 2024

Checked on my old Mac(highDpi="true"). Everything works as before with this. Going to send app for testing on Retina display when its ready. Wondering if 3D rendering going to work properly. Will see how user respond.
Thank you for including this high res support in NME!

from nme.

codeservice avatar codeservice commented on August 15, 2024

So I have response from user after testing high res DPI feature:

"This version is better, but still has a few problems.
As mentioned in an earlier email, the app's Info.plist file needs this:

<key>NSHighResolutionCapable</key>
<true/>

Without this, the app will only open in Low Resolution mode. After adding this
setting to your app it correctly opens in High Resolution mode on a Retina display.
(Note that it can also be switched to open in Low Res mode by selecting the app in the
Finder, choosing File > Get info and ticking the appropriate box.)"

and more:

screenDPI = 221.00000331909
screenResolutionX = 1440 (should be 2880?)
screenResolutionY = 900 (should be 1800?)

Everything else seams works correctly 2D and 3D app graphics renders correctly.

from nme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.