Contents

wantsBestResolutionOpenGLSurface

A Boolean value indicating whether the view wants an OpenGL backing surface with a resolution greater than 1 pixel per point.

Declaration

var wantsBestResolutionOpenGLSurface: Bool { get set }

Return Value

true if the view wants a high resolution backing surface or false if it does not.

Discussion

This property is relevant only for views bound to an NSOpenGLContext object (including, but not limited to, NSOpenGLView objects). Layer-backed views ignore the value in this property and configure their own backing surface at an appropriate resolution.

When this property is false, the view uses a 1 pixel per point framebuffer regardless of the backing scale factor for the targeted display. When the backing scale factor is greater than 1.0, the rendered surface contents are also magnified to the appropriate user size.

When this property is true, AppKit has permission to allocate a higher resolution frame buffer for the view. AppKit uses the backing scale factor and the targeted display to determine whether a higher resolution buffer is appropriate, and it may change the surface resolution when the display mode changes or the view moves to a different display. The view must be able to convert between view units and pixel units when needed. For example, passing the view’s bounds unmodified to the glViewport function yields incorrect results at backing scale factors other than 1.0. You can use the convertToBacking(_:), convertToBacking(_:), and convertToBacking(_:) methods to convert coordinate values to the resolution of the backing store.

To learn more about using OpenGL in your Mac app, see OpenGL Programming Guide for Mac.

See Also

Properties