---
title: NSOpenGLPixelBuffer
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsopenglpixelbuffer
---

# NSOpenGLPixelBuffer

An object that provides access to accelerated offscreen rendering.

## Declaration

```occ
@interface NSOpenGLPixelBuffer : NSObject
```

## Overview

Overview note: The OpenGL API is deprecated. Use Metal and MetalKit instead. Using offscreen rendering you could, for example, 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.

## Topics

### Initializing an OpenGL Pixel Buffer

- [initWithTextureTarget:textureInternalFormat:textureMaxMipMapLevel:pixelsWide:pixelsHigh:](appkit/nsopenglpixelbuffer/initwithtexturetarget:textureinternalformat:texturemaxmipmaplevel:pixelswide:pixelshigh:.md)
- [initWithCGLPBufferObj:](appkit/nsopenglpixelbuffer/initwithcglpbufferobj:.md)

### Getting OpenGL Pixel Buffer Information

- [CGLPBufferObj](appkit/nsopenglpixelbuffer/cglpbufferobj.md)
- [pixelsHigh](appkit/nsopenglpixelbuffer/pixelshigh.md)
- [pixelsWide](appkit/nsopenglpixelbuffer/pixelswide.md)
- [textureInternalFormat](appkit/nsopenglpixelbuffer/textureinternalformat.md)
- [textureMaxMipMapLevel](appkit/nsopenglpixelbuffer/texturemaxmipmaplevel.md)
- [textureTarget](appkit/nsopenglpixelbuffer/texturetarget.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

## See Also

### Classes

- [NSOpenGLView](appkit/nsopenglview.md)
- [NSOpenGLContext](appkit/nsopenglcontext.md)
- [NSOpenGLLayer](appkit/nsopengllayer.md)
- [NSOpenGLPixelFormat](appkit/nsopenglpixelformat.md)
- [NSCachedImageRep](appkit/nscachedimagerep.md)
- [NSDrawer](appkit/nsdrawer.md)
- [NSForm](appkit/nsform.md)
- [NSFormCell](appkit/nsformcell.md)
- [NSMenuItemCell](appkit/nsmenuitemcell.md)
- [NSInputManager](appkit/nsinputmanager.md)
- [NSInputServer](appkit/nsinputserver.md)
- [NSMovie](appkit/nsmovie.md)
