30-bit Color Depth on the Mac

This morning I was trying to find information about 30-bit (10 bits per component) color depth support on Macs. As you might guess, I found nothing usable. Although high-end graphics cards from both AMD and NVIDIA support the OpenGL extension for 10 bpc color, Apple does not advertise their machines as such.

So I ended up creating a little tool for assessing 10 bpc color capability. The following code tries to create a window with 10 bpc and queries the result (this code is highly similar to those found in AMD’s and NVIDIA’s 10 bpc guides).

#include <stdio.h>
#include <GLUT/GLUT.h>

int main (int argc, char *argv[])
{
    glutInit (&argc, argv);

    //
    // Request a 10-bit per component bit depth and create
    // the window.
    //

    glutInitDisplayString ("red=10 green=10 blue=10 alpha=2");
    glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    int window = glutCreateWindow ("bitdepth");

    //
    // Check how many bits we have.
    //

    GLint red, green, blue;
    glGetIntegerv (GL_RED_BITS, &red);
    glGetIntegerv (GL_GREEN_BITS, &green);
    glGetIntegerv (GL_BLUE_BITS, &blue);

    //
    // Clean up and show results.
    //

    glutDestroyWindow (window);

    printf ("Bit depth is %d/%d/%d\n", red, green, blue);

    return 0;
}

You should link with the OpenGL and GLUT frameworks.

Or you can grab the compiled executable here. It runs on 10.5 and up. Just run it and it will display the assessment result:

Bit depth is 8/8/8

I currently have no access to newer Mac Pros, which I suspect to have 30-bit support. So if you have and got 10/10/10, please let us know in the comments!