<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKRenderer/init(device:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKRenderer(cm)rendererWithDevice:"
  },
  "title" : "init(device:)"
}
-->

# init(device:)

Initializes with a specific GPU to render into.

```
init(device: any MTLDevice)
```

## Parameters

`device`

A Metal device.

## Return Value

A new renderer object.

## Discussion

Pass in the same Metal device that is associated to the Metal command buffer passed into [`render(withViewport:commandBuffer:renderPassDescriptor:)`](/documentation/SpriteKit/SKRenderer/render(withViewport:commandBuffer:renderPassDescriptor:)).

---

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)