The NSOpenGLPixelBuffer class gives Cocoa OpenGL implementations access to accelerated offscreen rendering. With this offscreen rendering you could, for instance, draw into the pixel buffer, then use the contents as a texture map elsewhere. Typically you initialize an NSOpenGLPixelBuffer object using the initWithTextureTarget:textureInternalFormat:textureMaxMipMapLevel:pixelsWide:pixelsHigh: method and attach the resulting object to an OpenGL context with the setPixelBuffer:cubeMapFace:mipMapLevel:currentVirtualScreen: method of NSOpenGLContext.


Every NSOpenGLPixelBuffer object wraps a low-level, platform-specific Core OpenGL (CGL) pixel buffer object. Your application can retrieve the CGL pixel buffer by calling the CGLPBufferObj method. For more information on the underling CGL pixel buffer, see CGL.


Initializing an OpenGL Pixel Buffer

- initWithTextureTarget:textureInternalFormat:textureMaxMipMapLevel:pixelsWide:pixelsHigh:

Returns an NSOpenGLPixelBuffer object initialized with the specified parameters.

- initWithCGLPBufferObj:

Initializes and returns an NSOpenGLPixelBuffer object that encapsulates an existing CGL pixel buffer object.

Obtaining Information About an OpenGL Pixel Buffer

- CGLPBufferObj

Returns the underlying CGLPBufferObj object associated with the NSOpenGLPixelBuffer object.

- pixelsHigh

Returns the height of the receiver’s texture (in pixels).

- pixelsWide

Returns the width of the receiver’s texture (in pixels).

- textureInternalFormat

Returns the internal format of the receiver’s texture.

- textureMaxMipMapLevel

Returns the maximum mipmap level of the receiver’s texture.

- textureTarget

Returns the texture target of the receiver.


Inherits From