> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetIndicesCountForPurposes

> Returns the number of Lamp indices on a LampArray that match a given set of LampPurposes flags, used to size buffers for GetIndicesForPurposes.

Returns the number of Lamp indices that support the given set of LampPurposes.

## Syntax

```cpp theme={null}
uint32_t GetIndicesCountForPurposes(
    LampPurposes lampPurposes)
```

### Parameters

*lampPurposes*\
Type: [LampPurposes](https://docs.xbox.com/reference/lighting/lamparray/enums/lamppurposes.md)

The desired set of purposes to query.

### Return value

Type: uint32\_t

The number of Lamps on this ILampArray that support all values marked in LampPurposes.

## Remarks

Call this method prior to using [ILampArray::GetIndicesForPurposes](https://docs.xbox.com/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getindicesforpurposes.md) to determine the maximum buffer size that function will support.

## Requirements

**Header:** LampArray.h

**Library:** xgameplatform.lib

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## See also

[Lighting API Overview](https://docs.xbox.com/build/core-features/common/lighting/gc-lighting-toc.md)\
[ILampArray::GetIndicesForPurposes](https://docs.xbox.com/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getindicesforpurposes.md)\
[ILampArray](https://docs.xbox.com/reference/lighting/lamparray/interfaces/ilamparray/ilamparray.md)


## Related topics

- [GetIndicesForPurposes](https://docs.xbox.com/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getindicesforpurposes.md)
- [LampPurposes Enumeration](https://docs.xbox.com/reference/lighting/lamparray/enums/lamppurposes.md)
- [ILampArray (Interface contents)](https://docs.xbox.com/reference/lighting/lamparray/interfaces/ilamparray/ilamparray.md)
- [SetColorsForIndices](https://docs.xbox.com/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_setcolorsforindices.md)
- [GetLampCount](https://docs.xbox.com/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getlampcount.md)
