---
title: textureIndex
framework: compositorservices
role: symbol
role_heading: Instance Property
path: compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/textureindex
---

# textureIndex

The index of the view’s textures in the drawable.

## Declaration

```swift
var textureIndex: Int { get }
```

## Discussion

Discussion Compositor Services places the color and depth textures for this view at same index number in the drawable. Use the returned index to the colorTextures or depthTextures properties to retrieve the appropriate texture. Compositor Services places the color and depth textures for this view at same index number in the drawable. In Swift, the index applies to the colorTexturesand depthTextures properties. In ObjectiveC, the index applies to the cp_drawable_get_color_texture and cp_drawable_get_depth_texture functions. note: If you draw with array-based textures, retrieve and apply the index from sliceIndex instead.

## See Also

### Getting the view’s texture map

- [textureMap](compositorservices/layerrenderer/drawable/view/texturemap-swift.property.md)
- [sliceIndex](compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/sliceindex.md)
- [viewport](compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/viewport.md)
