# CardboardMetalDistortionRendererConfig


`#include <cardboard.h>`

Struct to set Metal distortion renderer configuration.

## Summary

| ### Public attributes ||
|---|---|
| `https://developers.google.com/cardboard/reference/c/struct/cardboard-metal-distortion-renderer-config#struct_cardboard_metal_distortion_renderer_config_1a3ef55238343385b7ab0a27f93a6aaf9a` | `uint64_t` Color attachment pixel format. |
| `https://developers.google.com/cardboard/reference/c/struct/cardboard-metal-distortion-renderer-config#struct_cardboard_metal_distortion_renderer_config_1ae3d7941b07415a265ca32921626bc48b` | `uint64_t` Depth attachment pixel format. |
| `https://developers.google.com/cardboard/reference/c/struct/cardboard-metal-distortion-renderer-config#struct_cardboard_metal_distortion_renderer_config_1a3211134e035fc2108c7f468302d7e4dc` | `uint64_t` MTLDevice id. |
| `https://developers.google.com/cardboard/reference/c/struct/cardboard-metal-distortion-renderer-config#struct_cardboard_metal_distortion_renderer_config_1ad1c95a38f72fcd40f0cbc1f96f4365ad` | `uint64_t` Stencil attachment pixel format. |

## Public attributes

### color_attachment_pixel_format

```
uint64_t CardboardMetalDistortionRendererConfig::color_attachment_pixel_format
```
Color attachment pixel format.

This field holds a [MTLPixelFormat enum value](https://developer.apple.com/documentation/metalkit/mtkview/1535940-colorpixelformat?language=objc).

### depth_attachment_pixel_format

```
uint64_t CardboardMetalDistortionRendererConfig::depth_attachment_pixel_format
```
Depth attachment pixel format.

This field holds a [MTLPixelFormat enum value](https://developer.apple.com/documentation/metalkit/mtkview/1535940-colorpixelformat?language=objc).

### mtl_device

```
uint64_t CardboardMetalDistortionRendererConfig::mtl_device
```
MTLDevice id.

This field holds a CFTypeRef variable pointing to a MTLDevice object. The SDK client is expected to manage the object ownership and to guarantee the pointer validity during the CardboardMetalDistortionRenderer_create function execution to ensure it is properly retained. Usage example:


```
CardboardMetalDistortionRendererConfig config;
config.mtl_device = CFBridgingRetain(mtlDevice);
CardboardDistortionRenderer *distortionRenderer =
    CardboardMetalDistortionRenderer_create(&config);
CFBridgingRelease(config.mtl_device);
```

<br />

### stencil_attachment_pixel_format

```
uint64_t CardboardMetalDistortionRendererConfig::stencil_attachment_pixel_format
```
Stencil attachment pixel format.

This field holds a [MTLPixelFormat enum value](https://developer.apple.com/documentation/metalkit/mtkview/1535940-colorpixelformat?language=objc).