[Interest] High-dpi fixing for Qt 5.5

Till Oliver Knoll till.oliver.knoll at gmail.com
Tue Mar 24 15:05:32 CET 2015



> Am 24.03.2015 um 14:39 schrieb Eddie Sutton <edsutton at gmail.com>:
> 
>> >My knowledge of available "HiDPI" APIs is currently based on your (excellent) blog post, which does not seem to mention that use case:
>> 
>>  >http://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/
> 
> Thanks for posting the excellent link.  It may help me find a work-around for a Qt3D windows scaling issue that affects OS X and iOS as well.

This, plus the Apple Developer docs may help as well, see "Enable OpenGL for High-Resolution Drawing"

 https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW1

"OpenGL is a pixel-based API. The NSOpenGLView class does not provide high-resolution surfaces by default. Because adding more pixels to renderbuffers has performance implications, you must explicitly opt in to support high-resolution screens.

You can opt in to high resolution by calling the method setWantsBestResolutionOpenGLSurface: when you initialize the view, and supplying YES as an argument:

[self  setWantsBestResolutionOpenGLSurface:YES];

If you don't opt in, the system magnifies the rendered results."

/quote

Basically the docs say that OpenGL is a pixel-based drawing system, so any conversions between "points" and "pixels" needs to be done explicitly by the application itself, e.g. when resizing a window. And that you have to explicitly enable the "HiDPI" mode for the OpenGL context first.

How much that helps you to fix problems with the Qt3D module I can't say, but it is generally something you have to keep in mind when developing your own OpenGL based application (under OS X - on other OSes similar rules probably apply, too).

Cheers, Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150324/df56103b/attachment.html>


More information about the Interest mailing list