Seg3D
Seg3D copied to clipboard
Support high-dpi rendering
Support high-dpi rendering on retina displays and other such displays. Investigate what this requires, being careful with pixel vs point transformations.
Recommend starting with https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html and also looking at whether glewExperimental = GL_TRUE is necessary.
It's possible that this will be fixed or at least handled differently with Qt5.
To get high-dpi working on Mac with Qt 5.4 or greater:
- set NSHighResolutionCapable to true in CMake/Modules/MacOSXBundleInfo.plist.in. This will get the fonts rendered appropriately.
- scale opengl rendering, converting to/from points appropriately. Be sure that mouse picking is also scaled appropriately
- Connect to the signal indicating the window has been dragged to a display with different dpi, and adjust the scale factor in the opengl rendering appropriately.
Follow these guides for Linux, Windows: http://doc.qt.io/qt-5/highdpi.html.
For Qt5.4 or Qt5.5 on other OS:
- Do the changes as for Mac, Qt5.4
- Set the environment variable QT_DEVICE_PIXEL_RATIO to 2 (or possibly auto)
For Qt5.6 on other OS, the behavior should be the same as for Mac, Qt5.4 and should no longer need that environment variable set.
This is still a problem on hi dpi displays in windows and linux. On OS X the resolution scales fine, though some text is rendered a little blurry.
#349 is related