Version: 1.0

Posted: 2008-02-06

Build Requirements: Mac OS X 10.5 and Xcode 3.0

Runtime Requirements: Mac OS X 10.5

View Source Code:

Download Sample (“OpenGLFilterBasicsCocoa.zip”, 652.0K)
Download Sample (“OpenGLFilterBasicsCocoa.dmg”, 968.0K)



Description

This application demonstrates how to install a filter in an OpenGL pipeline using Objective-C and MVC design pattern. Here our model in the MVC design pattern is the filter object that encapsulates the OpenGL algorithmic workflows of loading, compiling, linking and binding of a fragment shader to a program object; texture initialization; framebuffer object instantiation and binding to a texture. The data generation for the filter is encapsulated in the object that produces the rotating 3D models. The controller here acts as a request broker between the filter and the view, and thus feeds the data into the filter and visualizes the results of the computation by updating an OpenGL view. This application further takes advantage of dictionaries to encapsulate the process of initialization of OpenGL view’s pixel format attributes. Dictionaries are also used to abstract the process of initializing GLSL fragment shader uniforms. Furthermore, this application also makes use of the multithreaded OpenGL engine.

Document Revision History

Date Notes
2008-02-06How to use Objective-C and MVC design patterns in installing and utilizing filters in an OpenGL rendering pipeline

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.