EAGLDrawable Protocol Reference
| Adopted by | |
| Framework | /System/Library/Frameworks/OpenGLES.framework |
| Availability | Available in iOS 2.0 and later. |
| Companion guide | |
| Declared in | EAGLDrawable.h |
Overview
iOS objects that implement the EAGLDrawable protocol can be used as a rendering surface and displayed to the screen by an EAGLContext object. In iOS 2.0, this protocol is implemented only by the CAEAGLLayer class, but in the future other classes may choose to implement the protocol. The EAGLDrawable protocol is not intended to be implemented by objects outside of the iOS.
Properties
drawableProperties
A dictionary of values that specify the desired characteristics of the drawable surface. (required)
Discussion
The drawableProperties dictionary specifies the properties that are used by this object when it is attached to an OpenGL ES renderbuffer. Your application should set these properties before passing this object into the EAGLContext method renderbufferStorage:fromDrawable:. If you change the drawableProperties dictionary, your application must call renderbufferStorage:fromDrawable: again on the context for the new values to take effect.
Availability
- Available in iOS 2.0 and later.
Declared In
EAGLDrawable.hConstants
Drawable Property Keys
Keys to specify in the drawableProperties dictionary.
EAGL_EXTERN NSString * const kEAGLDrawablePropertyColorFormat; EAGL_EXTERN NSString * const kEAGLDrawablePropertyRetainedBacking;
Constants
kEAGLDrawablePropertyColorFormatThe key specifying the internal color buffer format for the drawable surface. The value for this key is an
NSStringobject that specifies a specific color buffer format. This color buffer format is used by theEAGLContextobject to create the storage for a renderbuffer. The default value iskEAGLColorFormatRGBA8.Available in iOS 2.0 and later.
Declared in
EAGLDrawable.h.kEAGLDrawablePropertyRetainedBackingThe key specifying whether the drawable surface retains its contents after displaying them. The value for this key is an
NSNumberobject containing aBOOLdata type. IfNO, you may not rely on the contents being the same after the contents are displayed. IfYES, then the contents will not change after being displayed. Setting the value toYESis recommended only when you need the content to remain unchanged, as using it can result in both reduced performance and additional memory usage. The default value isNO.Available in iOS 2.0 and later.
Declared in
EAGLDrawable.h.
Color Formats
Color formats that can be specified under the kEAGLDrawablePropertyColorFormat key.
EAGL_EXTERN NSString * const kEAGLColorFormatRGB565; EAGL_EXTERN NSString * const kEAGLColorFormatRGBA8;
Constants
kEAGLColorFormatRGB565Specifies a 16-bit RGB format that corresponds to the OpenGL ES
GL_RGB565format.Available in iOS 2.0 and later.
Declared in
EAGLDrawable.h.kEAGLColorFormatRGBA8Specifies a 32-bit RGBA format that corresponds to the OpenGL ES
GL_RGBA8888format.Available in iOS 2.0 and later.
Declared in
EAGLDrawable.h.
© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-06-11)