Detecting OpenGL Renderer Changes

Last Revision:
Version 1.3, 2014-06-25
Replaced deprecated calls.
(Full Revision History)
Build Requirements:
OS X v10.9 or later
Runtime Requirements:
OS X v10.8 or later

This sample demonstrates what an OpenGL application should do to detect possible renderer changes. When running on a multi-GPU system, in order to render the OpenGL content correctly on all hardware, your application needs to be able to detect renderer changes. Whenever the virtual screen changes, the capabilities of the video card you are currently rendering to can change, so you must re-query those capabilities (such as max texture size) and adjust your drawing paths as necessary to support the newly active GPU.

This sample demonstrates how to detect and respond to renderer changes in both an NSOpenGLView subclass and an NSView subclass. It also demonstrates how to enable the usage of offline renderers (renderers that are not connected to a display).