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

Anula la inicialización de Gaming Runtime.

## Sintaxis

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

### Parámetros

Ninguno.

### Valor devuelto

Tipo: void

## Comentarios

Para usar las características de Gaming Runtime en su juego, primero inicialice Gaming Runtime invocando la función [XGameRuntimeInitialize](/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize). Cuando el juego haya terminado de usar Gaming Runtime y esté listo para cerrarse, anule la inicialización de Gaming Runtime invocando la función **XGameRuntimeUninitialize**. Invoque la función **XGameRuntimeUninitialize** lo más tarde posible, pero antes de que el juego se cierre, normalmente dentro de la función de punto de entrada del juego.

En el ejemplo siguiente se muestra cómo usar las funciones [XGameRuntimeInitialize](/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize) y **XGameRuntimeUninitialize** dentro de la función de punto de entrada de un juego basado en la plantilla **Direct3D 12 Desktop Game** de Visual Studio. La función **XGameRuntimeInitialize** se invoca antes de crear una instancia del objeto **Game** y registrarlo, y la función **XGameRuntimeUninitialize** se invoca después de restablecer el objeto **Game**, pero antes de que la función de punto de entrada devuelva el control.

```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

**Encabezado:** XGameRuntimeInit.h

**Biblioteca:** xgameruntime.lib

**Plataformas compatibles:** Windows, consolas de la familia XBOX One y consolas XBOX Series

## Documentación conceptual

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

## Consulte también

[XGameRuntimeInitialize](/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize)
[XGameRuntimeInit](/reference/system/xgameruntimeinit/xgameruntimeinit_members)
[Desarrollo de nuevos títulos con Gaming Runtime](/build/gdk-and-engines/guides/gdk-project-templates)


## Related topics

- [XGameRuntimeInit](/es/reference/system/xgameruntimeinit/xgameruntimeinit_members.md)
- [XGameRuntimeInitialize](/es/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize.md)
- [XGameRuntimeInitializeWithOptions](/es/reference/system/xgameruntimeinit/functions/xgameruntimeinitializewithoptions.md)
- [Integración del GDK con un motor personalizado de C/C++](/es/build/gdk-and-engines/custom-engine.md)
- [Códigos de error](/es/reference/errorcodes.md)
