iPhone OS Reference Library Apple Developer Connection spyglass button

Version: 1.7

Posted: 2009-10-02

Build Requirements: iPhone SDK 3.1 and later

Runtime Requirements: iPhone OS 3.1 and later

View Source Code:

Download Sample Code (“GLPaint.zip”, 66.8K)



Description

The GLPaint sample application demonstrates how to support single finger painting using OpenGL ES. This sample also shows how to detect a "shake" motion of the device.

By looking at the code you'll see how to set up an OpenGL ES view and use it for rendering painting strokes. The application creates a brush texture from an image by first drawing the image into a Core Graphics bitmap context. It then uses the bitmap data for the texture. The image used for a texture must have dimensions that are a power of 2.

Document Revision History

Date Notes
2009-10-02Updated for iPhone OS 3.1. Set texture parameters before creating the texture. This will save texture memory and texture loading time. Use the shake API available in iPhone OS 3.0 and later. Made the sample xib-based.
2008-07-02First public release.
Did this document help you? Yes It's good, but... Not helpful...