> ## 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.

# IGameInputDevice::ApplyLightingColors

> ステージングされたすべてのライティング カラーを 1 回の更新で入力デバイスに送信します。

ステージングされたすべてのライティング カラーを 1 回の更新で入力デバイスに送信します。

## 構文

```cpp theme={null}
void ApplyLightingColors();
```

### パラメーター

このメソッドにはパラメーターがありません。

### 戻り値

型: void

## 解説

[IGameInputDevice::SetLightingColor](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md) を呼び出して設定したカラーはステージングされるだけで、`ApplyLightingColors` を呼び出すまでランプは変化しません。このメソッドは、すべてのランプのステージングされたカラーを 1 回の書き込みでデバイスに送信するため、複数のグループやランプに対する変更が同時に反映されます。

更新されるのは、ステージングされたカラーがあるランプのみです。カラーがステージングされていない場合、この呼び出しは何の効果もありません。

ステージングされたカラーは、適用された後も有効なままです。後で 1 つのグループを変更するには、そのグループの新しいカラーをステージングし、もう一度 `ApplyLightingColors` を呼び出します。他のランプのカラーは保持されます。ステージングされたすべてのカラーを破棄してランプを既定の動作に戻すには、[IGameInputDevice::ApplyLightingSystemDefault](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingsystemdefault.md) を呼び出します。

デバイスが切断されると、そのデバイスのステージングされたカラーは破棄されます。切断されたデバイスに対する呼び出しは何の効果もありません。

次の例では、コントローラーのフェイス ボタンを赤に、センター ライトを青に設定してから、両方のカラーを 1 回の更新で適用します。

```cpp theme={null}
void SetControllerLighting(IGameInputDevice* device) noexcept
{
    const GameInputLightingGroups groups = device->GetSupportedLightingGroups();

    if ((groups & GameInputLightingGroupFaceButtons) != 0)
    {
        device->SetLightingColor({ 255, 0, 0 }, GameInputLightingGroupFaceButtons);
    }

    if ((groups & GameInputLightingGroupCenterLight) != 0)
    {
        device->SetLightingColor({ 0, 0, 255 }, GameInputLightingGroupCenterLight);
    }

    device->ApplyLightingColors();
}
```

> [!NOTE]
>
> ライティングのサポートは、デバイスとプラットフォームによって異なります。現在、GameInput は、Windows Dynamic Lighting (LampArray) デバイスと DualSense コントローラーのライトバーでのライティングをサポートしています。

## 要件

**ヘッダー:** GameInput.h

**ライブラリ:** gameinput.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体、XBOX Series 本体

## 関連項目

[GameInput の概要](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[IGameInputDevice::SetLightingColor](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)\
[IGameInputDevice::ApplyLightingSystemDefault](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingsystemdefault.md)\
[IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)\
[GameInputColor](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputcolor)\
[GameInputLightingGroups](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/enums/gameinputlightinggroups)

## バージョン履歴

| バージョン | 変更内容 |
| - | - |
| **v4** | 導入されました。 |


## Related topics

- [IGameInputDevice::SetLightingColor](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)
- [IGameInputDevice::ApplyLightingSystemDefault](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingsystemdefault.md)
- [IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)
- [IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md)
- [1 つのアプリケーションで複数の GameInput API バージョンを使用する](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-version-interop.md)
