<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCRenderer/init(openGLContext:pixelFormat:file:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(cs)QCRenderer(im)initWithOpenGLContext:pixelFormat:file:"
  },
  "title" : "init(openGLContext:pixelFormat:file:)"
}
-->

# init(openGLContext:pixelFormat:file:)

Creates a  renderer object with an `NSOpenGLContext` object and a composition file.

```
init!(openGLContext context: NSOpenGLContext!, pixelFormat format: NSOpenGLPixelFormat!, file path: String!)
```

## Parameters

`context`

An <doc://com.apple.documentation/documentation/AppKit/NSOpenGLContext> object. The object that you supply must have both a color and a depth buffer.

`format`

An  <doc://com.apple.documentation/documentation/AppKit/NSOpenGLPixelFormat>  object.

`path`

A string that specifies the location of a composition(`.qtz`) file.

## Return Value

An initialized `QCRenderer` object or `nil` if initialization is not successful.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)