---
title: QCRenderer
framework: quartz
role: symbol
role_heading: Class
path: quartz/qcrenderer
---

# QCRenderer

A base class for low-level rendering.

## Declaration

```swift
class QCRenderer
```

## Overview

Overview A QCRenderer class is designed for low-level rendering of Quartz Composer compositions. This is the class to use if you want to be in charge of rendering a composition to a specific OpenGL context—either using the NSOpenGLContext class or a CGLContextObj object. QCRenderer also allows you to load, play, and control a composition. To render a composition to a specific OpenGL context: Create an instance of QCRenderer using one of the initialization methods, such as init(openGLContext:pixelFormat:file:). Render frames by calling the method render(atTime:arguments:) If you use double buffering in OpenGL, you must swap the OpenGL buffers. Release the renderer when you no longer need it. This code snippet shows how to implement these tasks: NSOpenGLContext*     context = [myNSOpenGLView openGLContext]; NSOpenGLPixelFormat*  format = [myNSOpenGLView pixelFormat]; NSString*               path = @"/Users/MyName/MyComposition.qtz"; QCRenderer* myRenderer; // Create a Quartz Composer renderer. myRenderer = [[QCRenderer alloc] initWithOpenGLContext:context                                            pixelFormat:format                                                   file:path]; // Render the first 10 seconds of the composition with steps of 1/25s. for(double t = 0.0; t <= 10.0; t += 1.0/25.0) {   [myRenderer renderAtTime:t arguments:nil];   [context flushBuffer]; //Required on double-buffered contexts } // Clean up  [renderer release];

## Topics

### Creating and Initializing a Renderer

- [init(composition:colorSpace:)](quartz/qcrenderer/init(composition:colorspace:).md)
- [init(openGLContext:pixelFormat:file:)](quartz/qcrenderer/init(openglcontext:pixelformat:file:).md)
- [init(cglContext:pixelFormat:colorSpace:composition:)](quartz/qcrenderer/init(cglcontext:pixelformat:colorspace:composition:)-7at42.md)
- [init(offScreenWith:colorSpace:composition:)](quartz/qcrenderer/init(offscreenwith:colorspace:composition:).md)

### Rendering a Composition

- [render(atTime:arguments:)](quartz/qcrenderer/render(attime:arguments:).md)

### Getting the Composition Object

- [composition()](quartz/qcrenderer/composition().md)

### Taking Snapshot Images

- [snapshotImage()](quartz/qcrenderer/snapshotimage().md)
- [createSnapshotImage(ofType:)](quartz/qcrenderer/createsnapshotimage(oftype:).md)

### Constants

- [Rendering Arguments](quartz/rendering-arguments.md)

### Initializers

- [init(CGLContext:pixelFormat:colorSpace:composition:)](quartz/qcrenderer/init(cglcontext:pixelformat:colorspace:composition:)-8rq7j.md)
- [init(offScreenWithSize:colorSpace:composition:)](quartz/qcrenderer/init(offscreenwithsize:colorspace:composition:).md)

### Instance Methods

- [renderingTime(forTime:arguments:)](quartz/qcrenderer/renderingtime(fortime:arguments:).md)

## Relationships

### Inherits From

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

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [QCCompositionRenderer](quartz/qccompositionrenderer.md)

## See Also

### Classes

- [QCComposition](quartz/qccomposition.md)
- [QCCompositionLayer](quartz/qccompositionlayer.md)
- [QCCompositionParameterView](quartz/qccompositionparameterview.md)
- [QCCompositionPickerPanel](quartz/qccompositionpickerpanel.md)
- [QCCompositionPickerView](quartz/qccompositionpickerview.md)
- [QCCompositionRepository](quartz/qccompositionrepository.md)
- [QCPatchController](quartz/qcpatchcontroller.md)
- [QCPlugIn](quartz/qcplugin.md)
- [QCPlugInViewController](quartz/qcpluginviewcontroller.md)
- [QCView](quartz/qcview.md)
