ADC Home > Reference Library > Technical Q&As > Graphics & Imaging > Quartz >

How do I tell if a particular display is being hardware accelerated by Quartz Extreme?


Q: How do I tell if a particular display is being hardware accelerated by Quartz Extreme?

A: As of Mac OS X 10.2 (Jaguar), there is a new API in "CGDisplayConfiguration.h" called CGDisplayUsesOpenGLAcceleration for just that purpose. "CGDisplayConfiguration.h" can be found in the Core Graphics framework (CoreGraphics.framework) which is part of the Application Services framework (ApplicationServices.framework). Listing 1 shows the typical usage for CGDisplayUsesOpenGLAcceleration.



/*
 CGDisplayUsesOpenGLAcceleration() takes a CGDirectDisplayID
 parameter and returns a boolean_t result
 */



    /* Prototype for CGDisplayUsesOpenGLAcceleration() */
#include <ApplicationServices/ApplicationServices.h>


    /* Code that cares whether or not the display is accelerated */

if ( CGDisplayUsesOpenGLAcceleration( displayID ) )
{
    /* Provide full graphics */
}
else
{
    /* Provide reduced graphics */
}

Listing 1. Checking for OpenGL acceleration




[Dec 03 2002]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.