Not Recommended Documentclose button

Important: The information in this document is Not Recommended and should not be used for new development.

Current information on this Reference Library topic can be found here:

Version: 1.1

Posted: 2004-12-01

Build Requirements: Xcode 1.5 or later

Runtime Requirements: Mac OS X 10.3 or later

View Source Code:

Download Sample (“”, 116.4K)
Download Sample (“NSGLImage.dmg”, 172.6K)


This sample demonstrates how to use an NSImage and NSBitmapImageRep to get texture data into OpenGL. It will display an image on a polygon that is scaled to the appropriate dimensions for that texture. Help information is available on the primary display. This is essentially the Cocoa OpenGL Window sample with an added class for drawing the NSBitmapImageRep in OpenGL. A few changes have been made to the BasicOpenGLView class to allow it to use the GLImage class (contained in the file(s) GLImage.h/.m). Mouse tracking and clicking behavior was also changed from the default implementation to be more useful with flat, 2D polygon.

To see the changes, simply search the project for the string 'GLImage:'. Note that the help string changes and such are NOT labeled as per the following. This applies only to changes to the view class that allow for the operation of the sample.

Document Revision History

Date Notes
2004-12-01Minor changes and updates. Removed an erroneous section of the help string (the part about 'c' for capabilities), rebuilt the packaged executable and cleaned some comments out of the source files.
2004-11-17Demonstrates how to texture in OpenGL with an NSImage and/or NSBitmapImageRep

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.