NVIDIAGeForceExperienceSDK
isdk.h File Reference
#include <gfesdk/os_defines.h>
#include <gfesdk/sdk_types.h>
#include <gfesdk/sdk_types_ipc.h>
#include <gfesdk/config.h>
#include "stdint.h"

Go to the source code of this file.

Functions

NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_Create (NVGSDK_HANDLE **handle, NVGSDK_CreateInputParams const *inParams, NVGSDK_CreateResponse *outParams)
 
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_Release (NVGSDK_HANDLE *handle)
 
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_Poll (NVGSDK_HANDLE *handle)
 
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_SetLogLevel (NVGSDK_LogLevel fileLevel)
 
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_AttachLogListener (NVGSDK_LoggingCallback callback)
 
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_SetListenerLogLevel (NVGSDK_LogLevel level)
 
NVGSDK_EXPORT void NVGSDKApi NVGSDK_RequestPermissionsAsync (NVGSDK_HANDLE *handle, NVGSDK_RequestPermissionsParams const *params, NVGSDK_EmptyCallback callback, void *context)
 
NVGSDK_EXPORT void NVGSDKApi NVGSDK_GetUILanguageAsync (NVGSDK_HANDLE *handle, NVGSDK_GetUILanguageCallback callback, void *context)
 

Detailed Description

C GFE SDK API

Definition in file isdk.h.

Function Documentation

NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_Create ( NVGSDK_HANDLE **  handle,
NVGSDK_CreateInputParams const *  inParams,
NVGSDK_CreateResponse outParams 
)

Allocates and initializes the SDK interface. This is a synchronous call and may take tens of milliseconds.

Importantly, the app must pass a list of required scopes to this call. This is analagous to an oauth2 type of flow. GfeSDK will choose to allocate certain resources based on this list. For example, passing NVGSDK_SCOPE_HIGHLIGHTS to this list will enable all of the calls starting with NVGSDK_Highlights_*. For more information on permissions, see Permissions.

The next decision for the app is whether to accept asynchronous callbacks on a GfeSDK-controller thread, or to poll for callbacks on a game-controlled thread, usually the main game loop. See NVGSDK_CreateInputParams::pollForCallbacks and Threading. When bringing the SDK up for the first time, it may be best to start with pollForCallbacks = false, until up and running, and then move to the more advanced polling model that gives control to the proper thread.

Finally, the app can pass in a callback to recieve notifications, and an opaque pointer that will be passed untouched to be received by the callback. See Notifications

Parameters
handle[out]- Will be populated by the created SDK on success
inParams[in]- Input parameters for SDK creation
outParams[out]- Output params for SDK creation, will be populated on return. On fatal error, this will be NULL
Return values
NVGSDK_SUCCESS- SDK was successfully created and returned
NVGSDK_ERR_OUT_OF_MEMORY- Could not allocate system resources for handle
NVGSDK_ERR_INVALID_PARAMETER- Invalid handle pointer provided, or no app name provided
NVGSDK_ERR_LOAD_LIBRARY- SDK wasn't able to load dependencies. Perhaps GFE is not installed.
NVGSDK_ERR_CONNECTION- SDK is not able to contact GFE backend service
NVGSDK_ERR_UNHANDLED_EXCEPTION- SDK ran into an unhandled error and caught an exception before it returned to client code
NVGSDK_IPC_SUCCESS_OLD_SDK- SDK will work properly, but the GfeSDK DLL version is old. See Versioning
NVGSDK_IPC_SUCCESS_OLD_GFE- SDK should work properly, but the backend GFE version is older, and may not provide the latest features. See Versioning
NVGSDK_ERR_GFE_VERSION- GFE version is too old for communication. User must upgrade GFE. See Versioning
NVGSDK_ERR_SDK_VERSION- GfeSDK DLL version is too old. Game must distribute a newer version. See Versioning
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_Release ( NVGSDK_HANDLE *  handle)

Release the main SDK interface after create.

Parameters
pHandle[in]- SDK Handle to release
Return values
NVGSDK_SUCCESS- SDK was successfully released
NVGSDK_ERR_INVALID_PARAMETER- Invalid handle provided
NVGSDK_ERR_UNHANDLED_EXCEPTION- SDK ran into an unhandled error and caught an exception before it returned to client code
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_Poll ( NVGSDK_HANDLE *  handle)

When NVGSDK_CreateInputParams::pollForCallbacks is set to true, it becomes the app's responsibility to make calls to this function to recieve asynchronous callbacks. See Asynchronous Calls for more information.

Parameters
handle[in]- Valid SDK handle returned by NVGSDK_Create
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_SetLogLevel ( NVGSDK_LogLevel  fileLevel)

Adjusts the logging level of GfeSDK. Log level documentation is found at NVGSDK_LogLevel. See Logging for more information.

Parameters
fileLvl[in]- Logs at or above this priority will be written to logfile
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_AttachLogListener ( NVGSDK_LoggingCallback  callback)

Pass in a callback function in order to receive the log messages that GfeSDK is recording. The primary usecase for this is to get the GfeSDK logs into the logfile of a game engine. See Logging for more information.

Parameters
[in]callback- Will be called back with log priority and message
NVGSDK_EXPORT NVGSDK_RetCode NVGSDKApi NVGSDK_SetListenerLogLevel ( NVGSDK_LogLevel  level)

Adjusts the listener logging level of GfeSDK. This affects calls to the callback given to NVGSDK_AttachLogListener. See Logging for more information.

See NVGSDK_LogLevel for a list of possible levels.

Parameters
level[in]- Logs at or above this priority will be sent to callback
NVGSDK_EXPORT void NVGSDKApi NVGSDK_RequestPermissionsAsync ( NVGSDK_HANDLE *  handle,
NVGSDK_RequestPermissionsParams const *  params,
NVGSDK_EmptyCallback  callback,
void *  context 
)

Asks the user for permissions needed by the app. This will open up the In Game Overlay.

If the user has already decided to grant or deny permissions for these scopes, no overlay will be displayed, and the corresponding return value will be passed into the callback.

Parameters
callback[in]- Callback return function as described by Asynchronous Calls
context[in]- Opaque context pointer as described by Asynchronous Calls
NVGSDK_EXPORT void NVGSDKApi NVGSDK_GetUILanguageAsync ( NVGSDK_HANDLE *  handle,
NVGSDK_GetUILanguageCallback  callback,
void *  context 
)

Returns the language set by the user for the onscreen UI

Parameters
handle[in]- Valid SDK handle returned by NVGSDK_Create
language[out]- Will be populated on NVGSDK_SUCCESS
callback[in]- Callback return function as described by Asynchronous Calls
context[in]- Opaque context pointer as described by Asynchronous Calls
Return values
NVGSDK_SUCCESS- Call was successful, and lang was populated with the result
NVGSDK_ERR_INVALID_PARAMETER- Invalid handle provided
NVGSDK_ERR_UNHANDLED_EXCEPTION- SDK ran into an unhandled error and caught an exception before it returned to client code
NVGSDK_IPC_ERR_NOT_SET- The user has not chosen a language and is using the default