---
title: "setTextureImageToPixelBuffer:colorBuffer:"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsopenglcontext/settextureimagetopixelbuffer:colorbuffer:"
---

# setTextureImageToPixelBuffer:colorBuffer:

Attaches the image data in the specified pixel buffer to the texture object currently bound by the OpenGL context.

## Declaration

```occ
- (void) setTextureImageToPixelBuffer:(NSOpenGLPixelBuffer *) pixelBuffer colorBuffer:(GLenum) source;
```

## Parameters

- `pixelBuffer`: The pixel buffer to attach.
- `source`: An OpenGL constant indicating which of the pixel buffer’s color buffers to use. Potential values for this parameter include GL_FRONT, GL_BACK, and GL_AUX0.

## Discussion

Discussion This method corresponds to the Core OpenGL method CGLTexImagePBuffer.

## See Also

### Working with Pixel Buffers

- [setPixelBuffer:cubeMapFace:mipMapLevel:currentVirtualScreen:](appkit/nsopenglcontext/setpixelbuffer:cubemapface:mipmaplevel:currentvirtualscreen:.md)
- [pixelBuffer](appkit/nsopenglcontext/pixelbuffer.md)
- [pixelBufferCubeMapFace](appkit/nsopenglcontext/pixelbuffercubemapface.md)
- [pixelBufferMipMapLevel](appkit/nsopenglcontext/pixelbuffermipmaplevel.md)
