SCOpenGLPixelFormat

Inherits From:
NSObject

Conforms To:
NSCopying
NSCoding

Declared In:
Sc21/SCOpenGLPixelFormat.h

Class Description

SCOpenGLPixelFormat is a replacement for NSOpenGLPixelFormat.

The purpose of this class is to be able to set and query any NSOpenGLPixelFormatAttribute. In Sc21, this is used to be able to archive/unarchive these attributes for use in the Interface Builder inspector for SCView.


Method Types

NSOpenGLPixelFormat creation
- pixelFormat
Attribute handling
- setAttribute:
- setAttribute:toValue:
- removeAttribute:
- getValue:forAttribute:

Instance Methods

getValue:forAttribute:

- (BOOL)getValue:(int *)valptr forAttribute:(NSOpenGLPixelFormatAttribute)attr

Copies the value of the given attribute into the integer pointed to by valptr.

Returns YES if the attribute exists or NO otherwise. On return value of NO, the contents of the valptr is not written.

If the attribute is a boolean value the valptr value will be set to 1 if the attribute exists.

Note that this method returns the value previously set with -setAttribute*. If you want the real attribute value of the corresponding NSOpenGLPixelFormat, use its -getValues:forAttribute:forVirtualScreen: method.


pixelFormat

- (NSOpenGLPixelFormat *)pixelFormat

If any attributes have been set, creates and returns a new NSOpenGLPixelFormat instance from these attributes, else return nil.

The returned pixelformat is cached, and the same instance will be returned if the attributes haven't changed since the last invocation of this method.


removeAttribute:

- (void)removeAttribute:(NSOpenGLPixelFormatAttribute)attr

Removes pixel format attribute.

As with NSOpenGLPixelFormat, removing a boolean attribute implies a NO value.


setAttribute:

- (void)setAttribute:(NSOpenGLPixelFormatAttribute)attr

Sets boolean pixel format attribute.

As with NSOpenGLPixelFormat, the existence of a boolean attribute implies a YES value. To set a boolean attribute to NO, use removeAttribute:

See also setAttribute:toValue:


setAttribute:toValue:

- (void)setAttribute:(NSOpenGLPixelFormatAttribute)attr toValue:(int)val

Sets integer pixel format attribute.

See also setAttribute:


Sc21 version 1.0 © 2003-2004 Systems in Motion AS.