|
|
Version: 1.0 Posted: 2004-03-24 Build Requirements: Xcode Runtime Requirements: Mac OS X v10.3 Download Sample (GLCarbonAGLWindow.zip, 211.3K) |
||||
DescriptionThis sample demonstrates three basic elements. - First and foremost it is a reasonably complete correctly formed Carbon Event based application which can be used as a starting point for Carbon based OpenGL application. Time was taken to ensure the display related events were handled correctly and that developers could use the structure presented here in their applications. This includes correctly handling display configuration changes, which all applications should strive to do. The structure is window based thus each window maintains it's own state, camera, rotations, etc. Lastly, the camera design is a reasonable starting point for developers who want to work with camera based projections. - Second the application includes a well structured virtual track ball, including handling of pan, dolly and zoom. This code is presented in the track ball.c file and is applicable to Carbon or Cocoa applications, though Cocoa applications my want to use the Objective-C version contained in the Teapot sample (on which this code was based). This sample shows a full Carbon Event interface to this track ball code using primary, secondary and tertiary mouse buttons for rotation, pan and dolly respectively. The scroll wheel is designated as a zoom control. - Lastly, this sample contains stand alone code for retrieving OpenGL capabilities and associating these with graphics device. Capabilities collected include; device identification from OpenGL, CoreGraphics and Carbon, device geometry and refresh rates, VRAM and texture RAM, texture units and texture limits, OpenGL version, and OpenGL functionality. The OpenGL functionality collected is set up to correct coalesce extension and version information into one capability flag allowing developers to quickly determine if a renderer has a specific capability, whether it is exposed via OpenGL extensions or in the core functionality. Furthermore this functional information represents the full set of functionality for OpenGL on Mac OS X at the time of the sample posting. Developers are free to add additional checks or remove unneeded ones to fit their intended OpenGL usage. Document Revision History
|
|