XGameStreamingRegisterClientPropertiesChanged

스트리밍 클라이언트 장치의 속성이 변경될 때 호출될 콜백을 등록합니다.

참고 항목

등록 시 클라이언트 장치의 현재 클라이언트 속성에 대해 콜백이 호출됩니다.

구문

HRESULT XGameStreamingRegisterClientPropertiesChanged(  
         XGameStreamingClientId client,  
         XTaskQueueHandle queue,  
         void* context,  
         XGameStreamingClientPropertiesChangedCallback* callback,  
         XTaskQueueRegistrationToken* token  
)  

매개 변수

client _In_
형식: XGameStreamingClientId

콜백을 가져오기 위해 등록하는 게임 스트리밍 클라이언트의 ID입니다.

queue _In_opt_
형식: XTaskQueueHandle

변경 콜백을 배치할 비동기 큐에 대한 핸들입니다.

context _In_opt_
형식: void*

콜백 함수에 전달할 컨텍스트에 대한 선택적 포인터입니다.

callback _In_
형식: XGameStreamingClientPropertiesChangedCallback*

클라이언트의 속성이 변경될 때 호출되는 콜백 함수

token _Out_
형식: XTaskQueueRegistrationToken*

이벤트의 등록을 취소하는 데 사용할 수 있는 등록 토큰에 대한 포인터

반환 값

형식: HRESULT

성공한 경우 S_OK를 반환하고, 그렇지 않으면 오류 코드를 반환합니다.

잠재적인 오류

오류 코드 오류 값 오류 발생 원인
E_GAMESTREAMING_NOT_INITIALIZED 0x89245400 XGameStreaming 런타임이 아직 초기화되지 않았습니다. 다른 API를 호출하기 전에 XGameStreamingInitialize를 호출합니다.
E_GAMESTREAMING_CLIENT_NOT_CONNECTED 0x89245401 지정된 클라이언트가 연결되어 있지 않습니다.

오류 코드 목록은 오류 코드를 참조하세요.

설명

참고 항목

이 함수는 시간에 민감한 스레드에서 호출하는 것이 안전하지 않습니다. 자세한 내용은 시간에 민감한 스레드를 참조하세요.

이 API를 사용하면 스트림 물리적 차원과 같은 XGameStreamingClientProperty가 변경될 때마다 게임에서 XGameStreamingClientPropertiesChangedCallback을(를) 받을 수 있습니다.

등록하면 모든 해당되는 XGameStreamingClientProperty을(를) 통해 콜백이 발생하게 되어 현재 속성 세부 정보에 대한 쿼리가 완료될 수 있습니다.

스트리밍 클라이언트 장치 연결이 끊어지면 XGameStreamingUnregisterClientPropertiesChanged를 사용하여 콜백의 등록을 취소하세요.

예제

    // On client connection maintain a list of clients and do per client initialization
    void GameStreamingClientManager::OnClientConnected(XGameStreamingClientId client)
    {
        StreamingClient connectedClient;
        connectedClient.clientId = client;
        connectedClient.propertiesChangedToken = token;

        // Do per-client initialization
        XGameStreamingClientPropertiesChangedRegistrationToken token = {0};
        XGameStreamingRegisterClientPropertiesChanged(
            client, m_taskQueue, this, &OnClientPropertiesChanged, &token);        

        connectedClient.propertiesChangedToken = token;
        m_streamingClients.push_back(connectedClient);
    }

    // Some of the properties of our streaming client have changed, react to any of the changes which apply to our game
    void GameStreamingClientManager::OnClientPropertiesChanged(
        void* context,
        XGameStreamingClientId client,
        uint32_t updatedPropertiesCount,
        XGameStreamingClientProperty* updatedProperties)
    {
        GameStreamingClientManager* gsClientManager = reinterpret_cast<GameStreamingClientManager*>(context);

        for (uint32_t i = 0; i < updatedPropertiesCount; ++i)
        {
            switch (updatedProperties[i])
            {
                // The client now has a new physical size of the game stream - update our list of stream
                // sizes to reflect this.
            case XGameStreamingClientProperty::StreamPhysicalDimensions:
                gsClientManager->UpdateClientPhysicalDimensions(client); 
                break;

            case XGameStreamingClientProperty::TouchInputEnabled: 
                gsClientManager->UpdateClientTouchEnabled(client); 
                break;

            default:
                // A characteristic we are not tracking - do nothing
                break;
            }
        }
    }

요구 사항

헤더: xgamestreaming.h

라이브러리: xgameruntime.lib

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

참고 항목

XGameStreamingClientProperty
XGameStreamingClientPropertiesChangedCallback
XGameStreamingUnregisterClientPropertiesChanged
XGameStreaming