---
title: "setPixelBuffer:cubeMapFace:mipMapLevel:currentVirtualScreen:"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsopenglcontext/setpixelbuffer:cubemapface:mipmaplevel:currentvirtualscreen:"
---

# setPixelBuffer:cubeMapFace:mipMapLevel:currentVirtualScreen:

Attaches the specified pixel buffer to the OpenGL context.

## Declaration

```occ
- (void) setPixelBuffer:(NSOpenGLPixelBuffer *) pixelBuffer cubeMapFace:(GLenum) face mipMapLevel:(GLint) level currentVirtualScreen:(GLint) screen;
```

## Parameters

- `pixelBuffer`: The pixel buffer to attach.
- `face`: For pixel buffers with a texture target of GL_CUBE_MAP, this parameter should be zero or one of the following values: GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_POSITIVE_Y GL_TEXTURE_CUBE_MAP_POSITIVE_Z GL_TEXTURE_CUBE_MAP_NEGATIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_Y GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
- `level`: The desired mipmap level for rendering. This value must be less than or equal to the maximum texture mipmap level of pixelBuffer (accessible through an NSOpenGLPixelBuffer object’s doc://com.apple.appkit/documentation/AppKit/NSOpenGLPixelBuffer/textureMaxMipMapLevel method).
- `screen`: The virtual screen of the receiver (if applicable) should be set to the same value as the current virtual screen you are using for rendering onscreen

## Discussion

Discussion The NSOpenGLPixelBuffer object gives the receiver access to accelerated offscreen rendering in the pixel buffer, which is primarily used for textures.

## See Also

### Related Documentation

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

### Working with Pixel Buffers

- [pixelBuffer](appkit/nsopenglcontext/pixelbuffer.md)
- [pixelBufferCubeMapFace](appkit/nsopenglcontext/pixelbuffercubemapface.md)
- [pixelBufferMipMapLevel](appkit/nsopenglcontext/pixelbuffermipmaplevel.md)
- [setTextureImageToPixelBuffer:colorBuffer:](appkit/nsopenglcontext/settextureimagetopixelbuffer:colorbuffer:.md)
