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

Sorted by
Title
Sort by
Topic
Sort by
Date
aglClipBufferRect (HTML) (DMG) (ZIP)
Shows the use of clip regions and buffer rects in AGL.
Carbon, OpenGL 2003-01-14
AGLSurfaceTexture (HTML) (DMG) (ZIP)
Example of render to texture/texture from surface using aglSurfaceTexture.
Carbon, OpenGL 2003-07-07
BasicCocoaAnimations (HTML) (DMG) (ZIP)
"BasicCocoaAnimations" demonstrates the use of the animator proxy to easily animate Cocoa views and windows.
Cocoa 2007-06-11
BlitNoVBL (HTML) (DMG) (ZIP)
Shows how to draw directly to the screen without syncing to the VBL of the monitor.
Hardware & Drivers, Performance, 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.
Hardware & Drivers, Performance, Quartz 2003-01-14
BoingX (HTML) (DMG) (ZIP)
Shows off using Quartz Extreme to provide borderless OpenGL content on the desktop.
Cocoa, OpenGL 2007-11-06
CALayerEssentials (HTML) (DMG) (ZIP)
Demonstrates the basics of setting up various Core Animation layers
Cocoa, Games, OpenGL, Quartz 2008-09-30
Carbon GLSnapshot (HTML) (DMG) (ZIP)
Demonstrates the use of OpenGL with Quicktime to capture OpenGL content.
OpenGL 2003-07-07
CarbonCocoaCoreImageTab (HTML) (DMG) (ZIP)
Carbon-based application creates a Cocoa-based web window which used CoreImage filters to transition between tabbed WebViews
Carbon, Cocoa 2006-07-25
CarbonQuartzComposer_TV (HTML) (DMG) (ZIP)
Demonstrates how to integrate Cocoa based QuartzComposer window into a Carbon based application
Cocoa, Video 2006-10-02
CarbonQuartzDrawingWPrinting (HTML) (DMG) (ZIP)
Deprecated - Demonstrates mixing QuickDraw and Quartz 2D drawing both on screen and during printing.
Carbon, Printing, Quartz 2003-01-14
CarbonSketch (HTML) (DMG) (ZIP)
Core Graphics only example of a Sketch application implemented with HIToolbox. Shows 1x1-CGBitmapContext for hit-testing, printing.
Carbon, Quartz 2005-03-23
CGDrawPicture (HTML) (DMG) (ZIP)
Deprecated - Shows how to use the QDPictDrawToCGContext API.
Cocoa, Quartz 2003-01-14
CGGamma (HTML) (DMG) (ZIP)
Shows how to use CGDirectDisplay calls to manipulate display gamma tables.
Games, Quartz 2003-01-14
CIAnnotation (HTML) (DMG) (ZIP)
Image annotation application using Core Image Filters. Demonstrates creation and usage of Image Units.
Cocoa, OpenGL, Quartz 2005-08-01
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
Carbon, Cocoa, Games, Quartz 2008-04-24
CITransitionSelectorSample2 (HTML) (DMG) (ZIP)
Showing all available Core Image transitions in a scrollable NSOpenGLView
Cocoa, OpenGL, Quartz 2006-09-18
CIVideoDemoGL (HTML) (DMG) (ZIP)
CIVideoDemoGL demonstrates using Core Image with QuickTime and Core Video
QuickTime, Video 2007-10-03
Cocoa CG aliasing demo (HTML) (DMG) (ZIP)
Shows how to draw both aliased and anti-aliased text and graphics using Quartz and Cocoa.
Cocoa, Quartz 2003-07-17
Cocoa CG arc demo (HTML) (DMG) (ZIP)
Shows how to draw both aliased and anti-aliased arcs using Quartz and Cocoa.
Cocoa, Quartz 2003-07-17
Cocoa OpenGL (HTML) (DMG) (ZIP)
Demonstrates using Cocoa with OpenGL, including window setup and event handling.
OpenGL 2007-10-22
Cocoa PDE with Carbon Printing (HTML) (DMG) (ZIP)
Application that uses a Cocoa PDE along with the Carbon Printing APIs.
Printing 2007-07-27
CocoaDVDPlayer (HTML) (DMG) (ZIP)
Demonstrates how to use DVD Playback Services to play DVD-Video media.
Video 2005-11-04
CocoaSlides (HTML) (DMG) (ZIP)
An image browser written using AppKit's Core Animation-based compositing and animation functionality
Cocoa, Quartz 2007-11-02
CollectPictColors (HTML) (DMG) (ZIP)
Deprecated - Uses Picture Utilities package and KnowsPict application to demonstrate collecting colors used by Pict resources.
Carbon 2003-10-10
ColorBars (HTML) (DMG) (ZIP)
Shows how to enumerate, select, capture, manipulate, draw to, and release displays using the CGDirectDisplay API.
Carbon, Cocoa, Quartz 2003-01-14
ColorMatching (HTML) (DMG) (ZIP)
Performs simple color matching of images using ColorSync or the QuickTime 6.4 Graphics Importers.
Cocoa, ColorSync 2003-12-18
ColorSyncDevices (HTML) (DMG) (ZIP)
Demonstrates how to use the new ColorSync Device Support APIs introduced with Mac OS X.
Carbon, ColorSync 2003-01-14
Core Animation QuickTime Layer (HTML) (DMG) (ZIP)
Shows the use of controls in a Layer over a Core Animation QTMovieLayer
Cocoa, QuickTime 2007-09-26
CoreImageGLTextureFBO (HTML) (DMG) (ZIP)
Making OpenGL textures with Core Image
Games, OpenGL, Quartz 2008-07-30
CTMClip (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing with clipping.
Carbon, Cocoa, Quartz 2003-01-14
CTMDemo (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing without clipping.
Carbon, Cocoa, Quartz 2003-01-14
CubePuzzle (HTML) (DMG) (ZIP)
Models a Rubik's Cube using Cocoa and OpenGL
Games, 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, Performance 2006-09-18
Fractal Performance (HTML) (DMG) (ZIP)
Three fractal applications that show various bottlenecks and how they can be fixed.
Java, Performance 2006-04-17
FullScreen (HTML) (DMG) (ZIP)
Shows how to use BeginFullScreen and EndFullScreen to enter and exit full-screen mode.
Carbon 2003-01-14
GeekGameBoard (HTML) (DMG) (ZIP)
Shows how to use Core Animation for the user interface of a board or card game.
Cocoa, Games, Performance, Quartz 2007-12-19
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.
Cocoa, 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
Games, OpenGL, Performance 2007-11-05
GLSLShowpiece (HTML) (DMG) (ZIP)
GLSLShowpiece demonstrates several Vertex and Fragment shaders
Cocoa, Games, 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
Grady (HTML) (DMG) (ZIP)
Demonstrates how to use the NSGradient class.
Cocoa 2007-02-28
icon cache demo (HTML) (DMG) (ZIP)
Demonstrates the use of an icon cache to limit the search for icon resource to one resource file.
Carbon 2003-01-30
IKSlideshowDemo (HTML) (DMG) (ZIP)
This small sample project shows how to use the ImageKit Slideshow to display images or PDFs.
Cocoa, Quartz 2006-08-01
Image Difference (HTML) (DMG) (ZIP)
Demonstrates a way to use Quartz's compositing capability to find the difference between two images.
Cocoa, Quartz 2003-01-30
Image Kit with Core Data (HTML) (DMG) (ZIP)
Using Image Kit's browser view with Core Data content.
Cocoa, Quartz 2008-07-25
ImageApp (HTML) (DMG) (ZIP)
Demonstrates basic image handling using the ImageIO APIs in Mac OS X 10.4 Tiger
Cocoa, ColorSync, Quartz 2008-01-24
ImageBackground (HTML) (DMG) (ZIP)
Shows how to draw an image in the background of an NSOutlineView and NSTableView.
Cocoa 2006-10-02
ImageBrowser (HTML) (DMG) (ZIP)
Demonstrates the ImageKit's IKImageBrowserView to browse images in a basic Cocoa application.
Cocoa 2007-03-13
JustDraw (HTML) (DMG) (ZIP)
Sample code being used in the WWDC 2005 Hands-On session 215 "Moving from QD to Quartz"
Carbon, Quartz 2005-06-01
LayerBackedOpenGLView (HTML) (DMG) (ZIP)
"LayerBackedOpenGLView" provides a simple example of hosting Cocoa controls as subviews of an NSOpenGLView.
Cocoa 2007-06-12
Link Snoop (HTML) (DMG) (ZIP)
Shows how to use PDFKit to scan for and highlight link annotations in PDFs.
Cocoa 2005-06-01
LiveVideoMixer (HTML) (DMG) (ZIP)
LiveVideoMixer demonstrates customized video rendering with QuickTime 7 and CoreVideo and OpenGL.
OpenGL, QuickTime, Video 2008-04-24
LiveVideoMixer2 (HTML) (DMG) (ZIP)
An updated LiveVideoMixer with DV out over FireWire
OpenGL, QuickTime 2006-05-05
LiveVideoMixer3 (HTML) (DMG) (ZIP)
LiveVideoMixer3 is extended to support Video In via QTKit
Cocoa, QuickTime 2006-08-01
MassiveImage (HTML) (DMG) (ZIP)
Shows how to use a CGDataProvider to save a very large image with Image IO
Carbon, Cocoa, Games, Quartz 2007-09-27
Mode (HTML) (DMG) (ZIP)
Shows how to enumerate displays and list the available modes for each display.
Carbon, Games, Quartz 2003-01-14
ModeWhacker (HTML) (DMG) (ZIP)
Shows how to enumerate, select, capture, manipulate, and release displays using the CGDirectDisplay API.
Carbon, Games, Quartz 2003-01-14
MoreIsBetter (HTML) (DMG) (ZIP)
Library providing indispensable wrapers and workarounds for many areas of Mac OS programming.
Carbon 2003-10-27
MouseTracking (HTML) (DMG) (ZIP)
Sample code used in the WWDC 2005 Hands-On session 215 "Moving from QD to Quartz"
Carbon, Quartz 2005-06-01
MyCustomColorPicker (HTML) (DMG) (ZIP)
Shows how to write a custom color picker using Cocoa.
Cocoa 2006-10-09
MyMovieFilter (HTML) (DMG) (ZIP)
How to play a movie into a layer-backed QTMovieView and apply a Core Image filter while the movie plays.
QuickTime 2008-06-02
MyPhoto (HTML) (DMG) (ZIP)
Demonstrates preferred techniques for working with the Image Capture APIs
Carbon, Cocoa 2005-06-01
NamingTableAccess (HTML) (DMG) (ZIP)
Digs out the contents of the NamingTable in a TrueType 'sfnt'.
Typography 2003-01-14
NewCCursor (HTML) (DMG) (ZIP)
Deprecated - Shows how to create a black and white 'CURS' and a color 'crsr' cursor resource by hand.
Carbon 2003-01-14
NSGLImage (HTML) (DMG) (ZIP)
Deprecated - Demonstrates how to texture in OpenGL with an NSImage and/or NSBitmapImageRep
Cocoa, Games, OpenGL 2004-12-01
NSOpenGL Fullscreen (HTML) (DMG) (ZIP)
Demonstrates how to create and switch between windowed and fullscreen OpenGL contexts using NSOpenGL.
Cocoa, 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
Cocoa, Games, OpenGL, Performance 2008-02-06
OpenGL Screensaver (HTML) (DMG) (ZIP)
Demonstrates how to integrate OpenGL drawing into a standard Cocoa screen saver on Mac OS X.
Cocoa, 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.
Cocoa, OpenGL, QuickTime 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
Out of This GWorld (HTML) (DMG) (ZIP)
Deprecated - Demonstrates the use of offscreen GWorlds and palette animation to simulate animation.
Carbon, Games 2003-03-12
Palette and GWorld (HTML) (DMG) (ZIP)
Deprecated - Demonstrates the use of palette and color tables with GWorlds.
Carbon 2003-10-10
PBORenderToVertexArray (HTML) (DMG) (ZIP)
This sample demonstrates render-to-vertex-array using FBO, PBO, and VBO.
OpenGL, Performance 2006-10-02
PDEProject (HTML) (DMG) (ZIP)
Deprecated - Demonstrates an application-hosted printing dialog extension (PDE) that displays a custom pane in the Print dialog.
Carbon, Printing 2003-01-14
PDF Annotation Editor (HTML) (DMG) (ZIP)
Demonstrates how to use PDF Kit to examine, edit, and create PDF annotations.
Cocoa 2006-07-31
PDF Calendar (HTML) (DMG) (ZIP)
Demonstrates how to use PDF Kit to create PDF content.
Cocoa 2006-07-31
PDFKitLinker2 (HTML) (DMG) (ZIP)
Demonstrates many aspects of PDFKit including navigation, display modes, searching, and PDFView subclassing.
Cocoa 2005-08-10
PictureTaker (HTML) (DMG) (ZIP)
Demonstrates the PictureTaker in a basic Cocoa application
Cocoa 2007-04-02
PinBallHighScores (HTML) (DMG) (ZIP)
Demonstrates use of Quartz Composer for displaying data within an application
Quartz 2007-06-11
Play Video Sample (HTML) (DMG) (ZIP)
Deprecated - The sample makes use of the RequestVideo sample code API.
Carbon 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
QCFundamentals (HTML) (DMG) (ZIP)
Demonstrates Coordinate, Interpolation, and Iterative systems in Quartz Composer with an amusing animation
Cocoa, OpenGL, Quartz, Tools 2006-08-07
QCGalaxy (HTML) (DMG) (ZIP)
Demonstrates use of Particle Systems and Core Image Filters in Quartz Composer
Cocoa, OpenGL, Quartz, Tools 2006-08-07
QTCarbonCoreImage101 (HTML) (DMG) (ZIP)
Demonstrates how to render QuickTime Movies using Core Image filters and the new video pipeline.
QuickTime 2006-02-14
QTCoreImage101 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using Core Image filters and the new video pipeline.
Cocoa, Quartz, QuickTime, Video 2005-07-19
QTCoreVideo101 (HTML) (DMG) (ZIP)
Demonstrates (with very little code) how to render a QuickTime Movie using CoreVideo and OpenGL.
OpenGL, QuickTime, Video 2008-04-24
QTCoreVideo102 (HTML) (DMG) (ZIP)
An application demonstrating the use of QTKit, CoreVdeo, and OpenGL.
OpenGL, QuickTime, Video 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, QuickTime, Video 2008-06-06
QTCoreVideo201 (HTML) (DMG) (ZIP)
Demonstrates how to render a QuickTime Movie using OpenGL FBO and the Core Video texture pipeline.
OpenGL, QuickTime, Video 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, QuickTime, Video 2009-04-07