XGameRuntimeInitialize
Initializes the Gaming Runtime.Syntax
Parameters
None.Return value
Type: HRESULT Returns S_OK if successful; otherwise, returns an error code. For a list of error codes, see Error Codes. If the function fails because the Gaming Runtime library (xgameruntime.dll) wasn’t found, the return value is set to E_GAMERUNTIME_DLL_NOT_FOUND.Remarks
To use the Gaming Runtime features in your game, first initialize the Gaming Runtime by invoking the XGameRuntimeInitialize function. Invoke the XGameRuntimeInitialize function as early as possible, typically within the entry-point function for your game. Similarly, uninitialize the Gaming Runtime as late as possible but before your game exits, by invoking the XGameRuntimeUninitialize function. Each binary compiling and linking to the game runtime should call XGameRuntimeInitialize early in start up. This includes the game binary and any middleware in dll form that uses Gaming Runtime features. Internal to the XGameRuntimeInitialize function, versions of all interfaces the title compiled against are checked and used for initializing matching runtime services. Between two different versions of the Gaming Runtime, functions may be added, removed, or in rare cases have breaking behavior changes. Calling XGameRuntimeInitialize from each component will help detect build configuration issues such as compiling against two different and incompatible versions of the game runtime by two different binaries that will load within the same process. Such breaking configurations result in an E_GAMERUNTIME_VERSION_MISMATCH error. The following example demonstrates how to use the XGameRuntimeInitialize and XGameRuntimeUninitialize functions within the entry-point function of a game that is based on the Direct3D 12 Desktop Game template in Visual Studio. The XGameRuntimeInitialize function is invoked before the Game object is instantiated and registered, and the XGameRuntimeUninitialize function is invoked after the Game object is reset but before the entry-point function returns.Requirements
Header: XGameRuntimeInit.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consolesConceptual documentation
See also
XGameRuntimeUninitializeXGameRuntimeInitializeWithOptions
XGameRuntimeInit
XGameRuntime Structures
XGameRuntime Enumerations
Developing new titles using Gaming Runtime
