다음을 통해 공유


ILampArray::GetIndicesForPurposes

지정된 LampPurpose 세트를 지원하는 램프 인덱스 버퍼를 채웁니다. 이 메서드를 호출하기 전에 ILampArray::GetIndicesCountForPurposes를 호출하여 최대 버퍼 크기를 가져와야 합니다.

구문

void GetIndicesForPurposes(
    LampPurposes lampPurposes,
    uint32_t lampIndicesCount,
    uint32_t * lampIndices)

매개 변수

lampPurposes 형식: LampPurposes

원하는 LampPurposes 집합입니다.

lampIndicesCount
형식: uint32_t

채울 버퍼의 크기입니다.

lampIndices _Out_writes_(lampIndicesCount) Type: uint32_t*

램프 인덱스 버퍼. 버퍼에 기록된 인덱스는 lampPurposes의 모든 플래그와 일치하는 램프용입니다.

반환 값

형식: void

설명

다음 코드는 ILampArray의 모든 브랜딩 램프에 대한 색상을 설정하는 방법을 보여줍니다.

void UpdateBrandingLamps(ILampArray* lampArray)
{
    // Get the number of Branding lamps
    LampPurposes purposes = LampPurposes::Branding;
    uint32_t indicesCount = lampArray->GetIndicesCountForPurposes(purposes);

    // Allocate and populate a buffer with the indices of those Lamps
    std::vector<uint32_t> indicesBuffer(indicesCount);
    lampArray->GetIndicesForPurposes(purposes, indicesCount, indicesBuffer.data());

    // Set color for all Branding Lamps to red.
    std::vector<LampArrayColor> colorsBuffer(indicesCount);
    for (uint32_t i = 0; i < indicesCount; i++)
    {
        colorsBuffer[i] = { 0xFF /* r */, 0x0 /* g */, 0x0 /* b */, 0xFF /* a */ };
    }

    lampArray->SetColorsForIndices(indicesCount, indicesBuffer.data(), colorsBuffer.data());
}

요구 사항

헤더: LampArray.h

라이브러리: xgameplatform.lib

지원되는 플랫폼: Xbox One 패밀리 콘솔 및 Xbox Series 콘솔

참고 항목

조명 API 개요
ILampArray::GetIndicesCountForPurposes
ILampArray::SetColorsForIndices
ILampArray