Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
NSGLImage
Last Revision: | Version 1.1, 2004-12-01 Minor 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. |
Build Requirements: | Xcode 1.5 or later |
Runtime Requirements: | Mac OS X 10.3 or later |
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.
Copyright © 2004 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2004-12-01