Jump To:
Leopard Sample Code
Graphics and imaging on Mac OS X consists of three main developer technologies: Quartz, an advanced drawing engine and windowing environment; OpenGL, an Apple implementation of this 3D graphics industry-standard API; and QuickTime, the cross-platform multimedia technology for handling video, sound, and text.

A guided introduction for developers new to Mac OS X graphics and imaging.   Essential information for developers working with graphics and imaging.   C and Objective-C API references organized by framework.
Document Descriptions
On Off
Display

Sort by
Title
Sorted by
Topic
Sort by
Date
VideoHardwareInfo (HTML) (DMG) (ZIP)
Query VRAM, Quartz Extreme support, OpenGL extensions and renderer, GLSL version and support.
Cocoa 2007-05-14
Worm (HTML) (DMG) (ZIP)
NSView performance demonstration. Uses a periodic timer to get best performance with Coalesced Update feature.
Cocoa 2005-06-01
ColorMatching (HTML) (DMG) (ZIP)
Performs simple color matching of images using ColorSync or the QuickTime 6.4 Graphics Importers.
ColorSync 2003-12-18
ColorSyncDevices (HTML) (DMG) (ZIP)
Demonstrates how to use the new ColorSync Device Support APIs introduced with Mac OS X.
ColorSync 2003-01-14
ImageApp (HTML) (DMG) (ZIP)
Demonstrates basic image handling using the ImageIO APIs in Mac OS X 10.4 Tiger
ColorSync 2008-01-24
CALayerEssentials (HTML) (DMG) (ZIP)
Demonstrates the basics of setting up various Core Animation layers
Games 2008-09-30
CGGamma (HTML) (DMG) (ZIP)
Shows how to use CGDirectDisplay calls to manipulate display gamma tables.
Games 2003-01-14
CIColorTracking (HTML) (DMG) (ZIP)
An Objective-C applicaton that implements a GPU-based technique to find the location of a uniquely colored object in a scene
Games 2008-04-24
CoreImageGLTextureFBO (HTML) (DMG) (ZIP)
Making OpenGL textures with Core Image
Games 2008-07-30
CubePuzzle (HTML) (DMG) (ZIP)
Models a Rubik's Cube using Cocoa and OpenGL
Games 2003-04-21
GeekGameBoard (HTML) (DMG) (ZIP)
Shows how to use Core Animation for the user interface of a board or card game.
Games 2007-12-19
GLSL Showpiece Lite (HTML) (DMG) (ZIP)
Using GLSL from a Cocoa application
Games 2007-11-05
GLSLShowpiece (HTML) (DMG) (ZIP)
GLSLShowpiece demonstrates several Vertex and Fragment shaders
Games 2006-07-17
MassiveImage (HTML) (DMG) (ZIP)
Shows how to use a CGDataProvider to save a very large image with Image IO
Games 2007-09-27
Mode (HTML) (DMG) (ZIP)
Shows how to enumerate displays and list the available modes for each display.
Games 2003-01-14
ModeWhacker (HTML) (DMG) (ZIP)
Shows how to enumerate, select, capture, manipulate, and release displays using the CGDirectDisplay API.
Games 2003-01-14
NSGLImage (HTML) (DMG) (ZIP)
Deprecated - Demonstrates how to texture in OpenGL with an NSImage and/or NSBitmapImageRep
Games 2004-12-01
OpenGL Filter Basics Cocoa (HTML) (DMG) (ZIP)
How to use Objective-C and MVC design patterns in installing and utilizing filters in an OpenGL rendering pipeline
Games 2008-02-06
Out of This GWorld (HTML) (DMG) (ZIP)
Deprecated - Demonstrates the use of offscreen GWorlds and palette animation to simulate animation.
Games 2003-03-12
Quartz Composer Texture (HTML) (DMG) (ZIP)
Shows how to use a Quartz Composer composition as an OpenGL texture.
Games 2005-06-01
TexturePerformanceDemo (HTML) (DMG) (ZIP)
OpenGL texture optimization demo for WWDC Session 214
Games 2005-06-01
VertexPerformanceDemo (HTML) (DMG) (ZIP)
Vertex optimization demo for WWDC Session 214
Games 2005-06-01
VideoHardwareInfo (HTML) (DMG) (ZIP)
Query VRAM, Quartz Extreme support, OpenGL extensions and renderer, GLSL version and support.
Games 2007-05-14
BlitNoVBL (HTML) (DMG) (ZIP)
Shows how to draw directly to the screen without syncing to the VBL of the monitor.
Hardware & Drivers 2003-01-14
BlitVBL (HTML) (DMG) (ZIP)
Shows how to have Mac OS X try its best to sync to the VBL for you.
Hardware & Drivers 2003-01-14
VideoHardwareInfo (HTML) (DMG) (ZIP)
Query VRAM, Quartz Extreme support, OpenGL extensions and renderer, GLSL version and support.
Hardware & Drivers 2007-05-14
Fractal Performance (HTML) (DMG) (ZIP)
Three fractal applications that show various bottlenecks and how they can be fixed.
Java 2006-04-17
aglClipBufferRect (HTML) (DMG) (ZIP)
Shows the use of clip regions and buffer rects in AGL.
OpenGL 2003-01-14
AGLSurfaceTexture (HTML) (DMG) (ZIP)
Example of render to texture/texture from surface using aglSurfaceTexture.
OpenGL 2003-07-07
BoingX (HTML) (DMG) (ZIP)
Shows off using Quartz Extreme to provide borderless OpenGL content on the desktop.
OpenGL 2007-11-06
CALayerEssentials (HTML) (DMG) (ZIP)
Demonstrates the basics of setting up various Core Animation layers
OpenGL 2008-09-30
Carbon GLSnapshot (HTML) (DMG) (ZIP)
Demonstrates the use of OpenGL with Quicktime to capture OpenGL content.
OpenGL 2003-07-07
CIAnnotation (HTML) (DMG) (ZIP)
Image annotation application using Core Image Filters. Demonstrates creation and usage of Image Units.
OpenGL 2005-08-01
CITransitionSelectorSample2 (HTML) (DMG) (ZIP)
Showing all available Core Image transitions in a scrollable NSOpenGLView
OpenGL 2006-09-18
Cocoa OpenGL (HTML) (DMG) (ZIP)
Demonstrates using Cocoa with OpenGL, including window setup and event handling.
OpenGL 2007-10-22
CoreImageGLTextureFBO (HTML) (DMG) (ZIP)
Making OpenGL textures with Core Image
OpenGL 2008-07-30
CubePuzzle (HTML) (DMG) (ZIP)
Models a Rubik's Cube using Cocoa and OpenGL
OpenGL 2003-04-21
Draw Pixels (HTML) (DMG) (ZIP)
An example of the correct use of DrawPixels.
OpenGL 2003-07-16
FBOBunnies (HTML) (DMG) (ZIP)
Demonstrates how to use framebuffer objects (FBO)
OpenGL 2006-09-18
GLCarbon1ContextPbuffer (HTML) (DMG) (ZIP)
Demostrates using OpenGL pixel buffers with a single shared context.
OpenGL 2004-03-26
GLCarbonSharedPbuffer (HTML) (DMG) (ZIP)
Demostrates sharing a single OpenGL pixel buffer with multiple other contexts.
OpenGL 2004-03-26
GLChildWindowDemo (HTML) (DMG) (ZIP)
Shows using Cocoa's child windows and Quartz Extreme to provide 2D/3D overlays above 3D content.
OpenGL 2003-04-21
GLSL Basics Cocoa (HTML) (DMG) (ZIP)
GLSL fundamentals using NSOpenGLView
OpenGL 2008-07-30
GLSL Showpiece Lite (HTML) (DMG) (ZIP)
Using GLSL from a Cocoa application
OpenGL 2007-11-05
GLSLShowpiece (HTML) (DMG) (ZIP)
GLSLShowpiece demonstrates several Vertex and Fragment shaders
OpenGL 2006-07-17
GLUT (HTML) (DMG) (ZIP)
The OpenGL Utility Toolkit (GLUT) for Mac OS X version 3.4.0 (supporting the GLUT 3.7 API)
OpenGL 2008-02-08
GLUTBasics (HTML) (DMG) (ZIP)
Simple GLUT example which can be used as starter code.
OpenGL 2004-03-26
GLUTStereo (HTML) (DMG) (ZIP)
Shows how to use stereo with GLUT under Mac OS X v10.2.3 or later.
OpenGL 2003-02-20
GLUTSurfaceTexture (HTML) (DMG) (ZIP)
Example of using the new glutSurfaceTexture.
OpenGL 2004-03-26
LiveVideoMixer (HTML) (DMG) (ZIP)
LiveVideoMixer demonstrates customized video rendering with QuickTime 7 and CoreVideo and OpenGL.
OpenGL 2008-04-24
LiveVideoMixer2 (HTML) (DMG) (ZIP)
An updated LiveVideoMixer with DV out over FireWire
OpenGL 2006-05-05
NSGLImage (HTML) (DMG) (ZIP)
Deprecated - Demonstrates how to texture in OpenGL with an NSImage and/or NSBitmapImageRep
OpenGL 2004-12-01
NSOpenGL Fullscreen (HTML) (DMG) (ZIP)
Demonstrates how to create and switch between windowed and fullscreen OpenGL contexts using NSOpenGL.
OpenGL 2004-02-11
NURBSSurfaceVertexProg (HTML) (DMG) (ZIP)
Uses a vertex program to compute the vertex position for a NURB surface.
OpenGL 2003-07-07
OpenGL Filter Basics Cocoa (HTML) (DMG) (ZIP)
How to use Objective-C and MVC design patterns in installing and utilizing filters in an OpenGL rendering pipeline
OpenGL 2008-02-06
OpenGL Screensaver (HTML) (DMG) (ZIP)
Demonstrates how to integrate OpenGL drawing into a standard Cocoa screen saver on Mac OS X.
OpenGL 2003-12-10
OpenGLCaptureToMovie (HTML) (DMG) (ZIP)
How to capture the screen on Mac OS X using OpenGL and save to a QuickTime movie.
OpenGL 2007-08-30
OpenGLCompositorLab (HTML) (DMG) (ZIP)
Demonstrates using OpenGL to composite multiple sources in hardware. Requires NVIDIA GeForce 4 Ti hardware.
OpenGL 2003-04-21
OpenGLScreenSnapshot (HTML) (DMG) (ZIP)
Demonstrates how to get the screen pixels using OpenGL and save them to an image file.
OpenGL 2008-08-14
PBORenderToVertexArray (HTML) (DMG) (ZIP)
This sample demonstrates render-to-vertex-array using FBO, PBO, and VBO.
OpenGL 2006-10-02
QCFundamentals (HTML) (DMG) (ZIP)
Demonstrates Coordinate, Interpolation, and Iterative systems in Quartz Composer with an amusing animation
OpenGL 2006-08-07
QCGalaxy (HTML) (DMG) (ZIP)
Demonstrates use of Particle Systems and Core Image Filters in Quartz Composer
OpenGL 2006-08-07
QTCoreVideo101 (HTML) (DMG) (ZIP)
Demonstrates (with very little code) how to render a QuickTime Movie using CoreVideo and OpenGL.
OpenGL 2008-04-24
QTCoreVideo102 (HTML) (DMG) (ZIP)
An application demonstrating the use of QTKit, CoreVdeo, and OpenGL.
OpenGL 2008-06-06
QTCoreVideo103 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL texture range and the Core Video pixel buffer pipeline.
OpenGL 2008-06-06
QTCoreVideo201 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL FBO and the Core Video texture pipeline.
OpenGL 2008-06-06
QTCoreVideo202 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL PBO and the Core Video pixel buffer pipeline.
OpenGL 2009-04-07
QTCoreVideo301 (HTML) (DMG) (ZIP)
Demonstrates adding of effects & filters to QuickTime Movies in realtime using GLSL shaders and the Core Video texture pipeline.
OpenGL 2009-04-07
Quartz Composer Live DV (HTML) (DMG) (ZIP)
Shows how to export a Quartz Composer composition as a real-time DV stream on the FireWire port.
OpenGL 2005-06-01
Quartz Composer Matrix (HTML) (DMG) (ZIP)
Shows how to use Quartz Composer to display a QuickTime movie as a series of frames in a 3D world.
OpenGL 2005-06-01
Quartz Composer Offline Rendering (HTML) (DMG) (ZIP)
Shows how to render a Quartz Composer composition as a series of images using an OpenGL pBuffer.
OpenGL 2005-06-01
Quartz Composer QCTV (HTML) (DMG) (ZIP)
Shows how to build a fake TV system using Quartz Composer as the foundation motion graphics.
OpenGL 2005-07-06
Quartz Composer Texture (HTML) (DMG) (ZIP)
Shows how to use a Quartz Composer composition as an OpenGL texture.
OpenGL 2005-06-01
SurfaceVertexProgram (HTML) (DMG) (ZIP)
Vertex program that demonstrates the use of a UV mesh to draw an implicit surface.
OpenGL 2003-07-07
TexturePerformanceDemo (HTML) (DMG) (ZIP)
OpenGL texture optimization demo for WWDC Session 214
OpenGL 2005-06-01
TextureRange (HTML) (DMG) (ZIP)
Shows the fundamental techniques required to fast texture upload performance.
OpenGL 2003-07-16
VBL (HTML) (DMG) (ZIP)
A simple example of how to create an OpenGLView in AppKit.
OpenGL 2003-07-07
Vertex Optimization (HTML) (DMG) (ZIP)
Shows examples of optimized vertex throughput.
OpenGL 2003-07-07
VertexPerformanceDemo (HTML) (DMG) (ZIP)
Vertex optimization demo for WWDC Session 214
OpenGL 2005-06-01
VertexPerformanceTest (HTML) (DMG) (ZIP)
A tool that measures triangle throughput and allows comparison of different methods.
OpenGL 2003-01-14
VideoHardwareInfo (HTML) (DMG) (ZIP)
Query VRAM, Quartz Extreme support, OpenGL extensions and renderer, GLSL version and support.
OpenGL 2007-05-14
WebKitCIPlugIn (HTML) (DMG) (ZIP)
This sample WebKit plugin for Safari demonstrate how to use CoreImage in a HTML page.
OpenGL 2005-11-28
BlitNoVBL (HTML) (DMG) (ZIP)
Shows how to draw directly to the screen without syncing to the VBL of the monitor.
Performance 2003-01-14
BlitVBL (HTML) (DMG) (ZIP)
Shows how to have Mac OS X try its best to sync to the VBL for you.
Performance 2003-01-14
FBOBunnies (HTML) (DMG) (ZIP)
Demonstrates how to use framebuffer objects (FBO)
Performance 2006-09-18
Fractal Performance (HTML) (DMG) (ZIP)
Three fractal applications that show various bottlenecks and how they can be fixed.
Performance 2006-04-17
GeekGameBoard (HTML) (DMG) (ZIP)
Shows how to use Core Animation for the user interface of a board or card game.
Performance 2007-12-19
GLSL Showpiece Lite (HTML) (DMG) (ZIP)
Using GLSL from a Cocoa application
Performance 2007-11-05
OpenGL Filter Basics Cocoa (HTML) (DMG) (ZIP)
How to use Objective-C and MVC design patterns in installing and utilizing filters in an OpenGL rendering pipeline
Performance 2008-02-06
PBORenderToVertexArray (HTML) (DMG) (ZIP)
This sample demonstrates render-to-vertex-array using FBO, PBO, and VBO.
Performance 2006-10-02
QuartzCache (HTML) (DMG) (ZIP)
Demonstrates several caching techniques using CGBitmapContext, CGImageRef re-use, CGLayerRefs, CGImageSource.
Performance 2005-06-01
VideoViewer (HTML) (DMG) (ZIP)
Simple example of video rendering using QuickTime visual contexts, OpenGL, Core Video and Core Image.
Performance 2005-08-01
Worm (HTML) (DMG) (ZIP)
NSView performance demonstration. Uses a periodic timer to get best performance with Coalesced Update feature.
Performance 2005-06-01
CarbonQuartzDrawingWPrinting (HTML) (DMG) (ZIP)
Deprecated - Demonstrates mixing QuickDraw and Quartz 2D drawing both on screen and during printing.
Printing 2003-01-14
Cocoa PDE with Carbon Printing (HTML) (DMG) (ZIP)
Application that uses a Cocoa PDE along with the Carbon Printing APIs.
Printing 2007-07-27
PDEProject (HTML) (DMG) (ZIP)
Deprecated - Demonstrates an application-hosted printing dialog extension (PDE) that displays a custom pane in the Print dialog.
Printing 2003-01-14
PMPrinterPrintWithFile (HTML) (DMG) (ZIP)
How to send files, for example PostScript and PDF, directly to the printer. Replaces the pict-ps path.
Printing 2006-07-18
BlitNoVBL (HTML) (DMG) (ZIP)
Shows how to draw directly to the screen without syncing to the VBL of the monitor.
Quartz 2003-01-14
BlitVBL (HTML) (DMG) (ZIP)
Shows how to have Mac OS X try its best to sync to the VBL for you.
Quartz 2003-01-14
CALayerEssentials (HTML) (DMG) (ZIP)
Demonstrates the basics of setting up various Core Animation layers
Quartz 2008-09-30