You are here: GameWorks Library > Core SDK > GSA > Using GSA

Using GSA

GFE Settings API 1.0.2

struct NvGsaApplication
#include <NvGsa.h

Structure containing information about a registered application.

The configuration file name and location will be as follows, with words in <> substituting the value of the specified field: <configPath>/GFXSettings.<executable>.xml.

Public Members

struct NvGsaEnumRange
#include <NvGsa.h>

Structure containing the valid values for an enum option.

Public Members

struct NvGsaNamedOption
#include <NvGsa.h>

Structure containing value and range info for a named option.

Public Members

struct NvGsaNumericRange 
#include <NvGsa.h>

Structure containing the valid range of numeric (int or float) value.

Public Members

struct NvGsaResolution
#include <NvGsa.h>

Structure containing display resolution data.

Public Members

union NvGsaValue
#include <NvGsa.h>

Union of option values.

Public Members

struct NvGsaVariant 
#include <NvGsa.h>

Structure for passing a dynamically typed option value.

Public Members

struct NvGsaVersion
#include <NvGsa.h>

Contains the library version number.

Public Members

 

file NvGsa.h
#include <NvFoundation.h>
#include <stdbool.h>

The GFE Settings API C/C++ header.

Defines
Typedefs
Enums

NvGsaStatus enum — Status codes that may be returned by functions in the library.

Values:

NvGsaDataType enum — Type of data in an associated NvGsaValue.

Values:

NvGsaSaveFlagValues enum — Flag values used by the GFSDK_GSA_SaveConfigFile function.

Values:

Functions
GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_InitializeSDK(const NvGsaApplication * appRegInfo, const NvGsaVersion * version)

Initializes the SDK.

If the SDK has already been initialized, it will skip any work and return. If the SDK is not initialized, it will proceed with the initalization steps. First the supplied version will be checked against the dll internal version to avoid potential mismatchs and crashes due to incompatibility of dll’s and the version compiled in the application. Second the application data will be copied to the internal storage.

Return

NV_GSA_STATUS_INVALID_ARGUMENT if appRegInfo or version is null; NV_GSA_STATUS_SDK_ALREADY_INITIALIZED if the library has already been initialized; NV_GSA_STATUS_VERSION_MISMATCH if the application was compiled against an incompatible version of the library; NV_GSA_STATUS_OK if initialization succeeded.

Parameters

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_ReleaseSDK()

Releases the library and all resources allocated by the library.

Data is not saved or preserved when calling this function. If there are configuration changes that need to be saved, GFSDK_GSA_SaveConfigFile should be called before calling this function.

Return

NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_OK if the library has been fully released.

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_LoadConfigFile()

Loads the GSA config file specified during library initialization.

Options should be registered by the application using GFSDK_GSA_RegisterOption before calling this function. Any options in the read from the configuration file that aren’t registered will be inaccessible to the application, and the GeForce Experience client will be responsible for cleaning up unregistered options from the file.

Return

NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_FILENOTFOUND if unable to find the settings file; NV_GSA_STATUS_ERROR if the file was unable to be parsed; NV_GSA_STATUS_OK if the file was loaded and options were updated.

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_SaveConfigFile(NvGsaSaveFlags flags)

Saves registered option values to the GSA config file specified during library initialization.

If the NV_GSA_SAVE_SKIP_UNREGISTERED flag is specified, only registered options will be saved to the GSA config file.

Return

NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_ERROR if the file could not be saved; NV_GSA_STATUS_OK if the file was successfully saved.

Parameters

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_RegisterOption(const NvGsaNamedOption * currentOption)

Registers an option used by the application.

This function checks for duplicate options with the same name and type, but no verification of option bounds is performed. Duplicate options are skipped.

Return

NV_GSA_STATUS_ILLEGAL_ARGUMENT if currentOption is null; NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_OPTION_FOUND if the specified option is a duplicate; NV_GSA_STATUS_OK if the option was successfully registered.

Parameters

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_RegisterResolutions(const NvGsaResolution * availableResolutions, uint32_t numResolutions)

Registers resolutions available to the application.

This function should only been used when the application wants to restrict the set of available resolutions.

Return

NV_GSA_STATUS_INVALID_ARGUMENT if availableResolutions is null; NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_OK if the available resolutions were successfully registered.

Parameters

GFSDK_GSA_EXPORTS void GFSDK_GSA_ReleaseVariant(NvGsaVariant * variant)

Releases a memory used by a variant that was returned by the library.

Parameters

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_GetOptionValue(NvGsaVariant * value, const wchar_t * name)

Returns the current value of the specified registered option.

The returned value should be freed using GFSDK_GSA_ReleaseVariant when it is no longer needed.

Return

NV_GSA_STATUS_INVALID_ARGUMENT if value or name is null; NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_OPTION_NOT_FOUND if a registered option with the specified name and type is not found; NV_GSA_STATUS_OK if option was found, and value returned.

Parameters

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_SetOptionValue(const NvGsaVariant * value, const wchar_t * name)

Updates the current value of the specified registered option.

The current option value will be overwritten by the new one. Verification is done to ensure that the value provided has the correct type and is in the within the allowed range of the registered option.

Return

NV_GSA_STATUS_INVALID_ARGUMENT if value or name is null; NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_OPTION_NOT_FOUND if a registered option with the specified name and type is not found; NV_GSA_STATUS_OPTION_VALUE_WRONG_TYPE if the registered option type does not match the specified option type; NV_GSA_VALUE_OUTOFRANGE if the value provided is outside the range specified at registration; NV_GSA_VALUE_OUTOFSTEP if the value provided does not match the step size specified at registration; NV_GSA_STATUS_OK if option was found, and value updated.

Parameters

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_GetResolution(NvGsaResolution * value)

Returns the current resolution setting.

Return

NV_GSA_STATUS_INVALID_ARGUMENT if value is null; NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_OK if the current resolution was retrieved successfully.

Parameters

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_SetResolution(const NvGsaResolution * value)

Updates the current resolution value stored in the library.

If a range of valid resolutions has been specified, the input value will be validated against the range.

Return

NV_GSA_STATUS_INVALID_ARGUMENT if value is null; NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_OPTION_VALUE_OUTOFRANGE if the specified resolution is not available; NV_GSA_STATUS_OK if the current resolution was updated.

Parameters

GFSDK_GSA_EXPORTS NvGsaStatus GFSDK_GSA_CheckForDirtyOptions()

Checks if there are options that have changed from the values in the configuration file.

This function compares the application side registered options with their counterparts from the config file. If there are dirty options, it means that some values have changed and the config file might need updating. A use case of this function is to verify whether it is needed to re-save the config file or not when the user applys changes that are identical to the previous settings.

Return

NV_GSA_STATUS_SDK_NOT_INITIALIZED if the library has not been initialized with a call to GFSDK_GSA_InitializeSDK; NV_GSA_STATUS_DIRTY_OPTIONS_FOUND if one more options are dirty NV_GSA_STATUS_OK if there are no dirty options.

GFSDK_GSA_EXPORTS NvGsaVersion GFSDK_GSA_GetVersion()

Returns the runtime SDK version of the library.

Note that the version returned may be different from NvGsaCurrentVersion, if the library dll being used has a different version than the SDK that the application was compiled agains.

Return

The runtime SDK version of the library.

Variables

const NvGsaVersion NvGsaCurrentVersion — Contains the current library version number.

 


NVIDIA® GameWorks™ Documentation Rev. 1.0.170309 ©2014-2017. NVIDIA Corporation. All Rights Reserved.