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

# XGameStreamingShowTouchControlsWithStateUpdate

> XGameStreamingShowTouchControlsWithStateUpdate

# XGameStreamingShowTouchControlsWithStateUpdate

연결된 모든 스트리밍 클라이언트 장치가 터치 컨트롤 상태를 업데이트하고 지정한 터치 레이아웃을 표시하도록 요청합니다. 모든 상태 업데이트는 새 터치 레이아웃이 표시되기 전에 수행됩니다.

## 구문

```cpp theme={null}
HRESULT XGameStreamingShowTouchControlsWithStateUpdate(  
         const char* layout,  
         size_t operationCount,  
         const XGameStreamingTouchControlsStateOperation* operations  
)  
```

### 매개 변수

*layout*   \_In\_opt\_z\_\
형식: char\*

표시할 터치 컨트롤 레이아웃의 이름 또는 표준 레이아웃을 표시하려면 `nullptr`입니다.

*operationCount*   \_In\_\
형식: size\_t

전달되는 작업 배열의 크기입니다.

*operations*   \_In\_reads\_opt\_(operationCount)\
형식: [XGameStreamingTouchControlsStateOperation\*](/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstateoperation)

요청되는 모든 상태 변수 업데이트의 배열입니다.

### 반환 값

형식: HRESULT

성공하면 **S\_OK**를 반환하고, 그렇지 않으면 오류 코드를 반환합니다.

#### 잠재적 오류

| 오류 코드                              | 오류 값       | 오류 원인                                                                                                                                                              |
| ---------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | XGameStreaming 런타임이 초기화되지 않았습니다. 다른 API를 호출하기 전에 [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize)를 호출하세요.           |
| E\_INVALIDARG                      | 0x80070057 | 지정한 작업의 데이터가 [XGameStreamingTouchControlsStateValueKind](/reference/system/xgamestreaming/enums/xgamestreamingtouchcontrolsstatevaluekind)에 지정된 데이터 형식과 일치하지 않습니다. |

## 설명

이 API는 게임에서 특정 터치 레이아웃을 표시해야 하며 렌더링에 영향을 줄 수 있는 일부 상태 업데이트가 필요할 때 사용해야 합니다. 새 터치 레이아웃에서 참조되는 변수의 상태를 업데이트하는 **동시에** 연결된 모든 스트리밍 클라이언트 장치에서 해당 터치 레이아웃으로 전환하려는 경우 이 API를 사용하세요. 이 API는 새 레이아웃이 표시되기 전에 모든 상태 업데이트가 이루어지도록 보장합니다.

특정 클라이언트에만 영향을 주려면 [XGameStreamingShowTouchControlsWithStateUpdateOnClient](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrolswithstateupdateonclient)를 사용하세요.

레이아웃만 변경하려는 경우 게임에서 대신 [XGameStreamingShowTouchControlLayout](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrollayout)을 사용해야 합니다.

상태 업데이트가 현재 레이아웃이나 다른 레이아웃에 영향을 줄 수 있고 특정 터치 레이아웃 변경과 관계없이 업데이트가 이루어져야 하는 경우 게임은 대신 [XGameStreamingUpdateTouchControlsState](/reference/system/xgamestreaming/functions/xgamestreamingupdatetouchcontrolsstate)를 사용해야 합니다.

## 예제

```c++ theme={null}
// In this example, the player has just selected a specific building in an strategy game 
// and the game wants to populate the two building specific action slots with the appropriate imagery
// before selecting the layouts
//
// Assumes passing in game structure that refers to the selected building and a game function to get the image
// assets for a particular building capability.


void GameStreamingClientManager::UpdateBuildingStateAndControls(const BuildingProperties& building)
{
    
    

    std::vector<XGameStreamingTouchControlsStateOperation> updateOperations;
    
    // update the image for the first two building slots   
    XGameStreamingTouchControlsStateOperation buildingCapability1Image;
    buildingCapability1Image.operationKind = XGameStreamingTouchControlsStateOperationKind::Replace;
    buildingCapability1Image.path = "/buildingCapability1Image";
    buildingCapability1Image.valueKind = XGameStreamingTouchControlsStateValueKind::String;
    buildingCapability1Image.stringValue =  GetImageName(building.capability[0].id);        
    updateOperations.push_back(buildingCapability1Image);

    XGameStreamingTouchControlsStateOperation buildingCapability2Image;
    buildingCapability2Image.operationKind = XGameStreamingTouchControlsStateOperationKind::Replace;
    buildingCapability2Image.path = "/buildingCapability2Image";
    buildingCapability2Image.valueKind = XGameStreamingTouchControlsStateValueKind::String;
    buildingCapability2Image.stringValue =  GetImageName(building.capability[1].id);        
    updateOperations.push_back(buildingCapability2Image);
    
    // enable the second slot if the building is of level 3 or above, otherwise the third slot will be disabled
    XGameStreamingTouchControlsStateOperation buildingCapability2Enabled;
    buildingCapability2Enabled.operationKind = XGameStreamingTouchControlsStateOperationKind::Replace;
    buildingCapability2Enabled.path = "/buildingCapability2IsEnabled";
    buildingCapability2Enabled.valueKind = XGameStreamingTouchControlsStateValueKind::Boolean;
    buildingCapability2Enabled.booleanValue =  building.level >= 3;
    updateOperations.push_back(buildingCapability2Enabled);
  
    // Switch to the building layout with the state update being sent as well
    XGameStreamingShowTouchControlsWithStateUpdate("building", updateOperations.size(), updateOperations.data());
}

```

## 요구 사항

**헤더:** XGameStreaming.h

**라이브러리:** xgameruntime.lib\
**지원 플랫폼:** Windows, XBOX One 계열 콘솔 및 XBOX Series 콘솔

## 함께 보기

[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members#TouchAdaptation)\
[XGameStreamingTouchControlsStateOperationKind](/reference/system/xgamestreaming/enums/xgamestreamingtouchcontrolsstateoperationkind)\
[XGameStreamingTouchControlsStateOperation](/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstateoperation)\
[XGameStreamingTouchControlsStateValue](/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstatevalue)\
[XGameStreamingShowTouchControlsWithStateUpdateOnClient](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrolswithstateupdateonclient)\
[XGameStreamingUpdateTouchControlsState](/reference/system/xgamestreaming/functions/xgamestreamingupdatetouchcontrolsstate)\
[XGameStreamingUpdateTouchControlsStateOnClient](/reference/system/xgamestreaming/functions/xgamestreamingupdatetouchcontrolsstateonclient)


## Related topics

- [XGameStreamingShowTouchControlsWithStateUpdateOnClient](/ko/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrolswithstateupdateonclient.md)
- [XGameStreamingUpdateTouchControlsState](/ko/reference/system/xgamestreaming/functions/xgamestreamingupdatetouchcontrolsstate.md)
- [XGameStreamingTouchControlsStateOperation](/ko/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstateoperation.md)
- [XGameStreamingTouchControlsStateValue](/ko/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstatevalue.md)
- [XGameStreamingTouchControlsStateOperationKind](/ko/reference/system/xgamestreaming/enums/xgamestreamingtouchcontrolsstateoperationkind.md)
