Comments (8)
Also I have suggestions from developers for how we can support Retina Mac display:
-
In the code where you initialize an NSOpenGLView you need to do this:
[self setWantsBestResolutionOpenGLSurface:YES];
-
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.
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.
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.
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.
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.
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.
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.
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)
- JNI callbacks via HaxeObject crash HOT 5
- Building android fails on linux because of change the FileSystem.fullPath behaviour in haxe 4.1.4
- Crash caused by preemptive mode HOT 2
- fix continues integration HOT 3
- make tooling lix compatible HOT 2
- [QUESTION] Flash Player Emulator HOT 3
- relatively rare timer crash. can't get why yet HOT 7
- [QUESTION] How accurate cubicTo method? HOT 2
- Issue with clipboard getdata on Android HOT 2
- Window close events
- Incompatibility with SWF library HOT 4
- Unable to run sample project on Linux HOT 3
- nme setup fails on M1 Mac
- Video player on android 11 issue HOT 1
- nme build is adding empty `-cp`s
- Build Error: Invalid character: / HOT 3
- nme build neko create an empty output file.
- xcode 14.0.1 NME app hang risk warning
- Cant compile NME for android with latest hxcpp changes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nme.