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

# XGameRuntimeUninitialize

> XGameRuntimeUninitialize

# XGameRuntimeUninitialize

Cancela a inicialização do Gaming Runtime.

## Sintaxe

```cpp theme={null}
void XGameRuntimeUninitialize(  
)  
```

### Parâmetros

Nenhum.

### Valor retornado

Tipo: void

## Comentários

Para usar os recursos do Gaming Runtime em seu jogo, primeiro inicialize o Gaming Runtime invocando a função [XGameRuntimeInitialize](/pt-BR/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize). Quando o jogo terminar de usar o Gaming Runtime e estiver pronto para ser encerrado, cancele a inicialização do Gaming Runtime invocando a função **XGameRuntimeUninitialize**. Invoque a função **XGameRuntimeUninitialize** o mais tarde possível, mas antes de o jogo ser encerrado, normalmente dentro da função de ponto de entrada do seu jogo.

O exemplo a seguir demonstra como usar as funções [XGameRuntimeInitialize](/pt-BR/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize) e **XGameRuntimeUninitialize** dentro da função de ponto de entrada de um jogo baseado no modelo **Direct3D 12 Desktop Game** no Visual Studio. A função **XGameRuntimeInitialize** é invocada antes de o objeto **Game** ser instanciado e registrado, e a função **XGameRuntimeUninitialize** é invocada depois que o objeto **Game** é redefinido, mas antes que a função de ponto de entrada retorne.

```cpp theme={null}
// Entry point
int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    // Initialize the Gaming Runtime before
    // performing any other activity.
    if (FAILED(XGameRuntimeInitialize()))
        return 1;

    if (!XMVerifyCPUSupport())
        return 1;

    g_game = std::make_unique<Game>();

    // Register class and create window
    {
        // Code omitted for brevity.
        ...
    }

    // Main message loop
    MSG msg = {};
    while (WM_QUIT != msg.message)
    {
        // Code omitted for brevity.
        ...
    }

    g_game.reset();

    // Uninitialize the Gaming Runtime after
    // all other activity has been completed.
    XGameRuntimeUninitialize();

    return (int) msg.wParam;
}
```

## Requisitos

**Cabeçalho:** XGameRuntimeInit.h

**Biblioteca:** xgameruntime.lib

**Plataformas com suporte:** Windows, consoles da família XBOX One e consoles XBOX Series

## Documentação conceitual

* [O que é o Microsoft Game Development Kit?](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/intro/introduction)

## Confira também

[XGameRuntimeInitialize](/pt-BR/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize)
[XGameRuntimeInit](/pt-BR/reference/system/xgameruntimeinit/xgameruntimeinit_members)
[Desenvolvendo novos títulos usando o Gaming Runtime](/pt-BR/build/gdk-and-engines/guides/gdk-project-templates)


## Related topics

- [XGameRuntimeInit](/pt-BR/reference/system/xgameruntimeinit/xgameruntimeinit_members.md)
- [XGameRuntimeInitialize](/pt-BR/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize.md)
- [XGameRuntimeInitializeWithOptions](/pt-BR/reference/system/xgameruntimeinit/functions/xgameruntimeinitializewithoptions.md)
- [Integrar o GDK a um mecanismo C/C++ personalizado](/pt-BR/build/gdk-and-engines/custom-engine.md)
- [Códigos de erro](/pt-BR/reference/errorcodes.md)
