diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f53d72..2fb182d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.0) +cmake_minimum_required (VERSION 3.19.0) project (GFNSDK) set(CMAKE_CONFIGURATION_TYPES Debug RelWithDebInfo) @@ -26,42 +26,55 @@ set(SAMPLES_CEF_URL "" CACHE STRING "(Optional) URL to use to download libcef fo set(SAMPLES_CEF_PATH "" CACHE STRING "(Optional) Path to find pre-downloaded CEF") set_property(CACHE SAMPLES_ARCH PROPERTY STRINGS 64 32) -if (WIN32) - set(USE_STATIC_CRT ON CACHE BOOL "(Windows) Enable to statically link against the CRT") -endif () option(BUILD_SAMPLES "Build the GFN SDK samples" ON) + ############################### -# Force MSVC static runtime library for each configuration -# Replace the strings instead of appending /MT(d), because overriding gives a compile error -# This handles both /MDd -> /MTd, and /MD -> /MT -foreach(i CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO - CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO) - string(REGEX REPLACE "/MD" "/MT" ${i} "${${i}}") -endforeach() -set(MSVC_RUNTIME "MT") +# For the GfnSdk distribution, GfnRuntimeSdk.dll is precompiled +if (NOT TARGET GfnRuntime) + add_library(GfnRuntime MODULE IMPORTED) + if (WIN32) + set_target_properties(GfnRuntime PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/lib/win/${BUILD_ARCH}/GfnRuntimeSdk.dll + ) + elseif (LINUX) + set_target_properties(GfnRuntime PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/lib/linux/${BUILD_ARCH}/GfnRuntimeSdk.so + ) + else () + message(FATAL_ERROR "Unsupported platform") + endif () +endif () -set(GFN_SDK_RUNTIME_SOURCES +add_library(GfnSdkWrapper STATIC ${CMAKE_CURRENT_SOURCE_DIR}/include/GfnRuntimeSdk_CAPI.h ${CMAKE_CURRENT_SOURCE_DIR}/include/GfnRuntimeSdk_Wrapper.h ${CMAKE_CURRENT_SOURCE_DIR}/include/GfnRuntimeSdk_Wrapper.c - ${CMAKE_CURRENT_SOURCE_DIR}/include/GfnSdk_SecureLoadLibrary.h - ${CMAKE_CURRENT_SOURCE_DIR}/include/GfnSdk_SecureLoadLibrary.c ) -set(GFN_SDK_COMMON_SOURCES - ${GENERATED_GFN_SDK_H} -) +if (WIN32) + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:msvcrtd") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:msvcrt") + # To enable usage of CMAKE_MSVC_RUNTIME_LIBRARY + cmake_policy(SET CMP0091 NEW) + # Statically link the CRT to avoid needing to install CRT debug binaries + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + add_library(GfnSdkSecureLoadLibrary STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/include/GfnSdk_SecureLoadLibrary.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/GfnSdk_SecureLoadLibrary.c + ) + target_link_libraries(GfnSdkWrapper PRIVATE GfnSdkSecureLoadLibrary) +elseif (LINUX) + target_link_libraries(GfnSdkWrapper PUBLIC ${CMAKE_DL_LIBS}) + target_compile_options(GfnSdkWrapper PUBLIC -fPIC) +endif () -add_custom_target(Dist SOURCES ${GFN_SDK_RUNTIME_SOURCES} ${GFN_SDK_COMMON_SOURCES}) +target_include_directories(GfnSdkWrapper PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include +) if (BUILD_SAMPLES) add_subdirectory(samples/CGameAPISample) + add_subdirectory(samples/SampleLauncher) add_subdirectory(samples/SDKDllDirectRefSample) - - if (USE_STATIC_CRT) - add_subdirectory(samples/SampleLauncher) - else() - message(WARNING "Sample Launcher will NOT be configured since it requires static CRT linkage.") - endif() endif () diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..c4bbb7f --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,171 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 19, + "patch": 0 + }, + "configurePresets": [ + { + "name": "base", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/_out/${presetName}", + "cacheVariables": { + "CMAKE_INSTALL_PREFIX": "${sourceDir}/_out/install/${presetName}" + } + }, + { + "name": "x64-windows-base", + "inherits": "base", + "hidden": true, + "displayName": "Windows x64", + "description": "Sets compilers, ninja generator, x64 architecture, build and install directory", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_INSTALL_PREFIX": "${sourceDir}/_out/install/${presetName}", + "CMAKE_C_COMPILER": "cl", + "CMAKE_CXX_COMPILER": "cl" + }, + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "hostOS": [ + "Windows" + ] + } + } + }, + { + "name": "x86-windows-base", + "inherits": "base", + "hidden": true, + "displayName": "Windows x86", + "description": "Sets compilers, ninja generator, x86 architecture, build and install directory", + "architecture": { + "value": "x86", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_INSTALL_PREFIX": "${sourceDir}/_out/install/${presetName}", + "CMAKE_C_COMPILER": "cl", + "CMAKE_CXX_COMPILER": "cl" + }, + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "hostOS": [ + "Windows" + ] + } + } + }, + { + "name": "x64-windows-debug", + "inherits": "x64-windows-base", + "displayName": "Windows x64 Debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x64-windows-release", + "inherits": "x64-windows-base", + "displayName": "Windows x64 Release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "x86-windows-debug", + "inherits": "x86-windows-base", + "displayName": "Windows x86 Debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x86-windows-release", + "inherits": "x86-windows-base", + "displayName": "Windows x86 Release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "x64-linux-base", + "inherits": "base", + "hidden": true, + "displayName": "Linux x64", + "description": "Sets compilers, ninja generator, x64 architecture, build and install directory", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_INSTALL_PREFIX": "${sourceDir}/_out/install/${presetName}" + }, + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "hostOS": [ + "Linux" + ] + } + } + }, + { + "name": "x64-linux-debug", + "inherits": "x64-linux-base", + "displayName": "Linux x64 Debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x64-linux-release", + "inherits": "x64-linux-base", + "displayName": "Linux x64 Release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + } + ], + "buildPresets": [ + { + "name": "base", + "configurePreset": "base", + "jobs": 4 + }, + { + "name": "x64-windows-debug", + "inherits": "base", + "configurePreset": "x64-windows-debug" + }, + { + "name": "x64-windows-release", + "inherits": "base", + "configurePreset": "x64-windows-release" + }, + { + "name": "x86-windows-debug", + "inherits": "base", + "configurePreset": "x86-windows-debug" + }, + { + "name": "x86-windows-release", + "inherits": "base", + "configurePreset": "x86-windows-release" + }, + { + "name": "x64-linux-debug", + "inherits": "base", + "configurePreset": "x64-linux-debug" + }, + { + "name": "x64-linux-release", + "inherits": "base", + "configurePreset": "x64-linux-release" + } + ] +} diff --git a/README.md b/README.md index b9aa074..158cd9d 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,30 @@ -# NVIDIA GeForce NOW SDK Release 2.0 +# NVIDIA GeForce NOW SDK Release 2.1 ## At a Glance -The GeForce NOW SDK (GFN SDK) is a means for game developers and publishers to directly integrate with GeForce NOW, NVIDIA's Cloud Gaming Service. This service allows gamers to experience GeForce gaming anywhere, as well as allowing publishers and game developers to take advantage of high-performance rendering through NVIDIA's top-notch DirectX and Vulkan drivers on both Windows and Linux platforms. +The GeForce NOW SDK (GFN SDK) is a means for game developers and publishers to directly integrate with GeForce NOW, NVIDIA's Cloud Gaming Service, which allows users to experience GeForce gaming anywhere and enables publishers and game developers to take advantage of high-performance rendering through NVIDIA's top-notch DirectX and Vulkan drivers on both Windows and Linux platforms. + +The GFN SDK provides an ever-growing set of APIs that allows GFN partners to allow their games and applications to have a more seamless integration with GeForce NOW features. These features include abilities for games and applications to: +* Run on a wide range of devices without needing to port to each device and operating system. +* Know when they are running inside the secure GeForce NOW environment to allow the bypass of certain system checks such as Display Driver versioning or application binary verification. +* Obtain information about the user's client system, including touch support, to tailor the user's experience to their environment. +* Allow GFN sessions to start from a host application or [GFN Client Deep Link](./doc/SDK-GFN-DEEP-LINKING.pdf), providing streaming of games and applications without needing to build a cloud gaming environment. +* Allow customers to get into games and applications faster with GFN's Pre-Warm features. + The GFN SDK is ever-evolving to provide easy integration of GeForce NOW features into publisher applications and games, as well as more efficient way to integrate games into the GeForce NOW ecosystem. -Please refer to the [SDK GFN Primer](./doc/SDK-GFN-PRIMER.pdf) for a more detailed overview of the features. +Please refer to the [SDK GFN Primer](./doc/SDK-GFN-PRIMER.pdf) for a more detailed overview of the features, and to get up and running quickly with the APIs, refer to the [SDK Quick Start Guide](./doc/SDK-GFN-QUICK-START-GUIDE.pdf) for common integration scenarios, and code snippets to use for APIs. ### What's New in This Release -* Deprecates user authentication flow through third party applications; StartStream API no longer accepts NVIDIA IDM Token string (param `pchAuthToken`) or Token identifier (param `tokenType`) -* Adds support for Visual Studio 2022 -* Bug fixes and minor improvements +* Add support for Linux to allow integration with native Linux applications that will run on Linux seats in GFN. +* Reworked the cmake files to leverage presets so that partners can take advantage of Visual Studio's support for cmake instead of needing to generate a solution first. +* Added a new [Quick Start Guide](./doc/SDK-GFN-QUICK-START-GUIDE.pdf) to allow partners to find out what APIs they need to use and leverage code snippets to integrate quickly. +* Expanded this README with specific steps for building the SDK and samples for all supported Operating Systems. +* Renamed the [GFN IP API Guide](./doc/SDK-GFN-IP-API-GUIDE.pdf) as well as expanded content to clarify use. +* Switched Windows builds of samples to statically link the C Runtime (CRT) to allow debug builds to run on without installing the debug version of the CRT. +* Fixed a few crashes that can occur in specific scenarios. ## GeForce NOW Developer Portal @@ -34,20 +46,21 @@ The distribution is laid out as below: ``` . ├─── CMakeLists.txt -├─── generate.bat -├─── generate_x86.bat +├─── CMakePresets.json ├─── LICENSE ├─── LICENSE.samplelauncher.thirdparty ├─── LICENSE.thirdparty ├─── README.md +├─── README.txt | ├─── doc | │ SDK-GFN-ACCOUNT-LINKING-SSO-GUIDE.pdf | │ SDK-GFN-CLOUD-API.pdf | │ SDK-GFN-DEEP-LINKING.pdf | │ SDK-GFN-MOBILE-TOUCH-INTEGRATION-GUIDE.pdf -| │ SDK-GFN-NGN-ENDPOINT.pdf +| │ SDK-GFN-IP-API-GUIDE.pdf | │ SDK-GFN-PRIMER.pdf +| │ SDK-GFN-QUICK-START-GUIDER.pdf | └───SDK-GFN-RUNTIME | └───index.html | @@ -59,7 +72,10 @@ The distribution is laid out as below: │ GfnSdk_SecureLoadLibrary.c │ GfnSdk_SecureLoadLibrary.h │ -├───lib +├───linux +│ └───x64 +│ GfnRuntimeSdk.so +├───win │ ├───x64 │ │ GfnRuntimeSdk.dll │ │ @@ -73,3 +89,113 @@ The distribution is laid out as below: └───SDKDllDirectRefSample ``` + +## SDK Build Overview + +The components that are needed to use the GeForce NOW SDK in your application +come pre-built, and do not require any additional build steps to use in your +project(s). Refer to the SDK Primer and Quick Start guides located in the ./doc +folder for more info on integrating the SDK and calling the APIs in your +applications. + +If you wish to build the samples included in this SDK distribution to use as +examples on how to call the GeForce NOW SDK's APIs on either Windows or Linux, +you will first need cmake 3.27 or greater installed to configure the makefiles. +If cmake 3.27 or greater is not installed, refer to https://cmake.org for +installation information for your Operating System. + +The Operating Systems supported by the GeForce NOW SDK APIs and samples are: +* Windows x64 +* Windows x86 +* Linux x64, specifically, Ubuntu 22 or greater + +### Building On Windows + +There are two methods to build for Windows: +* Command Line +* Visual Studio's cmake support + +#### Command Line Method + +To build from the command line the simplest way, you will need a build +system manager such as ninja-builder (https://ninja-build.org/) installed and +available via your PATH environment variable. If you do not have it installed, +follow the instructions on the website. + +You will also need Visual Studio installed, along with the Visual Studio +Developer Comand Prompt tools installed. Finally, you will need to have +Visual Studios command line build tools available as part of your PATH. + +Once these tools are configured, open a command prompt to the root of the +GeForce NOW SDK distribution package, and use cmake to configure the makefiles +via one of the presets: + +* -x64-windows-debug +* -x64-windows-release +* -x86-windows-debug +* -x86-windows-release + +Example: +``` +cmake --preset x64-windows-release +``` + +This will allow cmake to configure the makefiles and use ninja to find the +compiler tools to build the samples. Once done, there will be an "_out" folder +at the root of the distribution, with a subfolder named as the present used. +Example: + +./_out/x64-windows-debug/ + +You can change directory to this subfolder and to the subfolder for the sample +you wish to run, and execute the sample's executable binary from there. + +#### Visual Studio CMake Method + +If you wish to configure the project and build from Visual Studio, then you +will need to have Visual Studio's cmake support tools installed. If you are +not familiar with this feature, please see this link: +https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio + +Please make sure to have the support for cmake 3.19 or greater installed. + +Once cmake 3.19 or greater support is available in your version of Visual +Studio, then follow these steps: +1. Open Visual Studio. +2. Select the "Open Folder" option. +3. Point Visual Studio to the root folder of the GeForce NOW SDK distribution. +(This is the folder that containts CMakeLists.txt and this README text file.) + +Once opened, Visual Studio's cmake support will automatically configure the +build based on the makefiles in the distribution, allowing you to build all or +individual samples. + +### Building for Linux + +In addition to cmake 3.27 or greater, you will also need to have +ninja-build (https://ninja-build.org/) installed. If you do not have it +installed, follow the instructions on the website. + +Once installed, open a command prompt to the root of the GeForce NOW SDK +distribution package, and use cmake to configure the makefiles for Linux for +one of the Linux presets: + +* -x64-linux-debug +* -x64-linux-release + +Example: +``` +cmake --preset x64-linux-release +``` +This will configure the makefiles for the specified preset, and create the +"_out" folder at the root of the distribution folder structure, with a +subfolder with the same name as the preset used. To build the samples, run cmake +again with the same preset with the --build flag. +``` +cmake --build --preset x64-linux-release +``` +This will produce the build in a subfolder corresponding to the name of the +sample under "/samples" in the current directory. You can then run the sample +from the subfolder. Example: + +./_out/x64-linux-release/samples/SampleLauncher/SampleLauncher diff --git a/doc/SDK-GFN-ACCOUNT-LINKING-SSO-GUIDE.pdf b/doc/SDK-GFN-ACCOUNT-LINKING-SSO-GUIDE.pdf index 9f341e8..2584a0a 100644 Binary files a/doc/SDK-GFN-ACCOUNT-LINKING-SSO-GUIDE.pdf and b/doc/SDK-GFN-ACCOUNT-LINKING-SSO-GUIDE.pdf differ diff --git a/doc/SDK-GFN-CLOUD-API.pdf b/doc/SDK-GFN-CLOUD-API.pdf index 87b420b..068d9f6 100644 Binary files a/doc/SDK-GFN-CLOUD-API.pdf and b/doc/SDK-GFN-CLOUD-API.pdf differ diff --git a/doc/SDK-GFN-DEEP-LINKING.pdf b/doc/SDK-GFN-DEEP-LINKING.pdf index 720817c..f72d105 100644 Binary files a/doc/SDK-GFN-DEEP-LINKING.pdf and b/doc/SDK-GFN-DEEP-LINKING.pdf differ diff --git a/doc/SDK-GFN-IP-API-GUIDE.pdf b/doc/SDK-GFN-IP-API-GUIDE.pdf new file mode 100644 index 0000000..550cef9 Binary files /dev/null and b/doc/SDK-GFN-IP-API-GUIDE.pdf differ diff --git a/doc/SDK-GFN-MOBILE-TOUCH-INTEGRATION-GUIDE.pdf b/doc/SDK-GFN-MOBILE-TOUCH-INTEGRATION-GUIDE.pdf index c3b1964..66ed449 100644 Binary files a/doc/SDK-GFN-MOBILE-TOUCH-INTEGRATION-GUIDE.pdf and b/doc/SDK-GFN-MOBILE-TOUCH-INTEGRATION-GUIDE.pdf differ diff --git a/doc/SDK-GFN-NGN-ENDPOINT.pdf b/doc/SDK-GFN-NGN-ENDPOINT.pdf deleted file mode 100644 index aea474e..0000000 Binary files a/doc/SDK-GFN-NGN-ENDPOINT.pdf and /dev/null differ diff --git a/doc/SDK-GFN-PRIMER.pdf b/doc/SDK-GFN-PRIMER.pdf index 80f2511..db37bfa 100644 Binary files a/doc/SDK-GFN-PRIMER.pdf and b/doc/SDK-GFN-PRIMER.pdf differ diff --git a/doc/SDK-GFN-QUICK-START-GUIDE.pdf b/doc/SDK-GFN-QUICK-START-GUIDE.pdf new file mode 100644 index 0000000..013d46f Binary files /dev/null and b/doc/SDK-GFN-QUICK-START-GUIDE.pdf differ diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h.html b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h.html index 11b2282..73a5b08 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
@@ -577,7 +578,9 @@

Function Documentation

-
Description
Register an application callback with GFN to be called when certain client info that is part of GetClientInfo API changes
+
Description
Register an application callback with GFN to be called when certain client info that is part of gfnGetClientInfo API changes
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when a the client information from the GFN user's client system has changed
Parameters
@@ -623,6 +626,8 @@

Function Documentation

Description
Register an application callback with GFN to be called when a message is sent to the application.
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Provide a callback function that will be called when a message is sent to the application.
Parameters
@@ -674,6 +679,8 @@

Function Documentation

Description
Register an application callback with GFN to be called when client latency changes
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when a the network latency from the GFN user's client system has changed
Parameters
@@ -720,6 +727,8 @@

Function Documentation

Description
Register an application callback with GFN to be called when GFN needs the application to save user progress. It is recommended that this be implemented as an autosave if such a feature is supported by your application.
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when GFN needs the application to save
Parameters
@@ -762,6 +771,8 @@

Function Documentation

Description
Register an application callback with GFN to be called when a GFN user has connected to the game seat
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when a GFN user has connected to the game seat
Parameters
@@ -808,6 +819,7 @@

Function Documentation

Description
Register a callback that gets called on the user's PC when the streaming session state changes
Environment
Client
+
Platform
Windows
Usage
Register a function to call when stream status changes on the user's client PC
Parameters
diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h_source.html b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h_source.html index a757329..2226820 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h_source.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h_source.html @@ -27,6 +27,7 @@ @@ -89,19 +90,19 @@
GfnRuntimeSdk_CAPI.h
-Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // C API declarations for GFN Runtime SDK
32 //
33 // ===============================================================================================
39 
298 #ifndef GFN_SDK_RUNTIME_CAPI_H
299 #define GFN_SDK_RUNTIME_CAPI_H
300 
301 
302 #include "GfnSdk.h"
303 
304 // Defining GfnRuntimeError for backwards compatibility
305 #define GfnRuntimeError GfnError
306 
307 #ifdef __cplusplus
308  extern "C"
309  {
310 #endif
311  // ============================================================================================
312  // Constants/Enums
313  // ============================================================================================
314 
319  {
323 
328  {
334 
336  typedef struct StartStreamResponse
337  {
338  bool downloaded;
340 
342  typedef void(GFN_CALLBACK *StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse*, void* context);
343 
345  typedef void(GFN_CALLBACK* StopStreamCallbackSig)(GfnRuntimeError, void* context);
346 
348  typedef struct StartStreamInput
349  {
350  unsigned int uiTitleId;
351  const char* pchPartnerData;
352  const char* pchPartnerSecureData;
354 
357  {
358  const char* pchPlatformAppId;
359  const char* pchBuildPath;
360  const char* pchMetadataPath;
362 
364  typedef enum GfnStreamStatus
365  {
374  } GfnStreamStatus;
375 
377  inline const char* GfnStreamStatusToString(GfnStreamStatus status)
378  {
379  switch (status)
380  {
381  case GfnStreamStatusInit: return "Init";
382  case GfnStreamStatusNetworkTest: return "NetworkTest";
383  case GfnStreamStatusLoading: return "Loading";
384  case GfnStreamStatusStreaming: return "Streaming";
385  case GfnStreamStatusDone: return "Done";
386  case GfnStreamStatusError: return "Error";
387  case GfnStreamStatusGotInputFocus: return "GotInputFocus";
388  case GfnStreamStatusLostInputFocus: return "LostInputFocus";
389  }
390  return "Unknown GfnStreamStatus";
391  }
392 
393 
396  typedef enum GfnActionType
397  {
401  } GfnActionType;
402 
403 
404  #define IP_V4_SIZE (17) // INET_ADDRSTRLEN + NULL
405  #define IP_V6_SIZE (49) // INET6_ADDRSTRLEN + NULL
406  #define CC_SIZE (3) // ISO 3166-1 Alpha-2
407  #define LOCALE_SIZE (6) // ISO 639-1 Alpha-2
408  #define SESSION_ID_SIZE (38)
409 
411  typedef enum GfnOsType
412  {
413  gfnUnknownOs = 0,
414  gfnWindows = 1,
415  gfnMacOs = 2,
416  gfnShield = 3,
417  gfnAndroid = 4,
418  gfnIOs = 5,
419  gfnIPadOs = 6,
420  gfnChromeOs = 7,
421  gfnLinux = 8,
422  gfnTizen = 9,
423  gfnWebOs = 10,
424  gfnTvOs = 11,
425  gfnOsTypeMax = 11
426  } GfnOsType;
427 
429  typedef struct
430  {
431  unsigned int version;
433  char ipV4[IP_V4_SIZE];
434  char country[CC_SIZE];
435  char locale[LOCALE_SIZE];
436  unsigned int RTDAverageLatencyMs;
438  } GfnClientInfo;
439 
442  {
443  gfnOs = 0,
444  gfnIP = 1,
449 
451  typedef struct GfnClientInfoUpdateData
452  {
453  unsigned int version;
455  union
456  {
458  char ipV4[IP_V4_SIZE];
461  } data;
463 
466  {
470 
473  {
474  unsigned int version;
476  union
477  {
478  unsigned int RTDAverageLatencyMs;
479  } data;
481 
482 
484  typedef struct
485  {
486  unsigned int sessionMaxDurationSec;
487  unsigned int sessionTimeRemainingSec;
488  char sessionId[SESSION_ID_SIZE];
490  } GfnSessionInfo;
491 
492  // ============================================================================================
493  // Callback signatures
494  // ============================================================================================
495 
496  // Callbacks that client code should implement and register via the appropriate callback
497  // registration function (listed as part of the C API below).
505  typedef GfnApplicationCallbackResult(GFN_CALLBACK *StreamStatusCallbackSig)(GfnStreamStatus status, void* pUserContext);
510  typedef GfnApplicationCallbackResult(GFN_CALLBACK* SessionInitCallbackSig)(const char* partnerInfoMutable, void* pUserContext);
516  typedef GfnApplicationCallbackResult(GFN_CALLBACK* MessageCallbackSig)(const GfnString* pStrData, void* pUserContext);
517 
518  // ============================================================================================
519  // C API
520  // ============================================================================================
521 
522  // ============================================================================================
523  // SDK Initialization / Shutdown
524 
528 
550 
562 
567 
588  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterExitCallback(ExitCallbackSig exitCallback, void* pUserContext);
589 
612  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void* pUserContext);
613 
636  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterInstallCallback(InstallCallbackSig installCallback, void* pUserContext);
638 
657  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void* pUserContext);
659 
676  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void* pUserContext);
678 
696  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void* pUserContext);
698 
716  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterMessageCallback(MessageCallbackSig messageCallback, void* pUserContext);
733  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void* pUserContext);
735 
753  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void* pUserContext);
755 
756  // ============================================================================================
757  // Application -> Geforce NOW SDK communication
758  // The application should call these methods at the appropriate locations.
763 
790 
818 
836  NVGFNSDK_EXPORT bool NVGFNSDKApi gfnIsTitleAvailable(const char* pchPlatformAppId);
837 
858  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetTitlesAvailable(const char** ppchPlatformAppIds);
859 
882  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetupTitle(const char* pchPlatformAppId);
883 
904  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnTitleExited(const char* pchPlatformId, const char* pchPlatformAppId);
905 
935  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientIp(const char** ppchClientIp);
936 
959  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientLanguageCode(const char** ppchLanguageCode);
960 
980  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientCountryCode(char* pchCountryCode, unsigned int length);
993 
1006  NVGFNSDK_EXPORT GfnRuntimeError gfnGetClientInfo(GfnClientInfo* clientInfo);
1007 
1020 
1032  NVGFNSDK_EXPORT GfnRuntimeError gfnGetSessionInfo(GfnSessionInfo* sessionInfo);
1033 
1048  NVGFNSDK_EXPORT void NVGFNSDKApi gfnStartStreamAsync(const StartStreamInput * pStartStreamInput, StartStreamCallbackSig cb, void* context, unsigned int timeoutMs);
1049 
1069  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStartStream(StartStreamInput* pStartStreamInput, StartStreamResponse* response);
1070 
1086  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStopStream(void);
1087 
1102  NVGFNSDK_EXPORT void NVGFNSDKApi gfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsigned int timeoutMs);
1103 
1124  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerData(const char** ppchPartnerData);
1125 
1146  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerSecureData(const char** ppchPartnerSecureData);
1147 
1165  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnFree(const char** ppchData);
1166 
1167 
1183  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnAppReady(bool success, const char * status);
1184 
1207  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect* zone);
1208 
1232  NVGFNSDK_EXPORT GfnRuntimeError gfnSendMessage(const char* pchMessage, unsigned int length);
1233 
1235 #ifdef __cplusplus
1236  } // extern "C"
1237 #endif
1238 
1239 
1240 #endif // GFN_SDK_RUNTIME_CAPI_H
GfnApplicationCallbackResult(GFN_CALLBACK * ExitCallbackSig)(void *pUserContext)
Callback function for notification when a game should exit. Register via gfnRegisterExitCallback API...
Definition: GfnRuntimeSdk_CAPI.h:499
-
GfnOsType
Types of operating systems that can be reported by the SDK.
Definition: GfnRuntimeSdk_CAPI.h:411
-
An update notification for a piece of client info data.
Definition: GfnRuntimeSdk_CAPI.h:451
-
unsigned int sessionTimeRemainingSec
Nominal time remaining in the session in seconds.
Definition: GfnRuntimeSdk_CAPI.h:487
-
GfnRect safeZone
Client safe zone rectangle (title-safe area), in normalized coordinates. If the entire screen is titl...
Definition: GfnRuntimeSdk_CAPI.h:460
+Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // C API declarations for GFN Runtime SDK
32 //
33 // ===============================================================================================
39 
284 #ifndef GFN_SDK_RUNTIME_CAPI_H
285 #define GFN_SDK_RUNTIME_CAPI_H
286 
287 
288 #include "GfnSdk.h"
289 
290 // Defining GfnRuntimeError for backwards compatibility
291 #define GfnRuntimeError GfnError
292 
293 #ifdef __cplusplus
294  extern "C"
295  {
296 #endif
297  // ============================================================================================
298  // Constants/Enums
299  // ============================================================================================
300 
305  {
309 
314  {
320 
322  typedef struct StartStreamResponse
323  {
324  bool downloaded;
326 
328  typedef void(GFN_CALLBACK *StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse*, void* context);
329 
331  typedef void(GFN_CALLBACK* StopStreamCallbackSig)(GfnRuntimeError, void* context);
332 
334  typedef struct StartStreamInput
335  {
336  unsigned int uiTitleId;
337  const char* pchPartnerData;
338  const char* pchPartnerSecureData;
340 
343  {
344  const char* pchPlatformAppId;
345  const char* pchBuildPath;
346  const char* pchMetadataPath;
348 
350  typedef enum GfnStreamStatus
351  {
360  } GfnStreamStatus;
361 
363  inline const char* GfnStreamStatusToString(GfnStreamStatus status)
364  {
365  switch (status)
366  {
367  case GfnStreamStatusInit: return "Init";
368  case GfnStreamStatusNetworkTest: return "NetworkTest";
369  case GfnStreamStatusLoading: return "Loading";
370  case GfnStreamStatusStreaming: return "Streaming";
371  case GfnStreamStatusDone: return "Done";
372  case GfnStreamStatusError: return "Error";
373  case GfnStreamStatusGotInputFocus: return "GotInputFocus";
374  case GfnStreamStatusLostInputFocus: return "LostInputFocus";
375  }
376  return "Unknown GfnStreamStatus";
377  }
378 
379 
382  typedef enum GfnActionType
383  {
387  } GfnActionType;
388 
389 
390  #define IP_V4_SIZE (17) // INET_ADDRSTRLEN + NULL
391  #define IP_V6_SIZE (49) // INET6_ADDRSTRLEN + NULL
392  #define CC_SIZE (3) // ISO 3166-1 Alpha-2
393  #define LOCALE_SIZE (6) // ISO 639-1 Alpha-2
394  #define SESSION_ID_SIZE (38)
395 
397  typedef enum GfnOsType
398  {
399  gfnUnknownOs = 0,
400  gfnWindows = 1,
401  gfnMacOs = 2,
402  gfnShield = 3,
403  gfnAndroid = 4,
404  gfnIOs = 5,
405  gfnIPadOs = 6,
406  gfnChromeOs = 7,
407  gfnLinux = 8,
408  gfnTizen = 9,
409  gfnWebOs = 10,
410  gfnTvOs = 11,
411  gfnOsTypeMax = 11
412  } GfnOsType;
413 
415  typedef struct
416  {
417  unsigned int version;
419  char ipV4[IP_V4_SIZE];
420  char country[CC_SIZE];
421  char locale[LOCALE_SIZE];
422  unsigned int RTDAverageLatencyMs;
424  } GfnClientInfo;
425 
428  {
429  gfnOs = 0,
430  gfnIP = 1,
435 
437  typedef struct GfnClientInfoUpdateData
438  {
439  unsigned int version;
441  union
442  {
444  char ipV4[IP_V4_SIZE];
447  } data;
449 
452  {
456 
459  {
460  unsigned int version;
462  union
463  {
464  unsigned int RTDAverageLatencyMs;
465  } data;
467 
468 
470  typedef struct
471  {
472  unsigned int sessionMaxDurationSec;
473  unsigned int sessionTimeRemainingSec;
474  char sessionId[SESSION_ID_SIZE];
476  } GfnSessionInfo;
477 
478  // ============================================================================================
479  // Callback signatures
480  // ============================================================================================
481 
482  // Callbacks that client code should implement and register via the appropriate callback
483  // registration function (listed as part of the C API below).
491  typedef GfnApplicationCallbackResult(GFN_CALLBACK *StreamStatusCallbackSig)(GfnStreamStatus status, void* pUserContext);
496  typedef GfnApplicationCallbackResult(GFN_CALLBACK* SessionInitCallbackSig)(const char* partnerInfoMutable, void* pUserContext);
502  typedef GfnApplicationCallbackResult(GFN_CALLBACK* MessageCallbackSig)(const GfnString* pStrData, void* pUserContext);
503 
504  // ============================================================================================
505  // C API
506  // ============================================================================================
507 
508  // ============================================================================================
509  // SDK Initialization / Shutdown
510 
514 
539 
554 
559 
583  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterExitCallback(ExitCallbackSig exitCallback, void* pUserContext);
584 
610  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void* pUserContext);
611 
637  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterInstallCallback(InstallCallbackSig installCallback, void* pUserContext);
639 
661  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void* pUserContext);
663 
686  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void* pUserContext);
688 
712  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void* pUserContext);
714 
738  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterMessageCallback(MessageCallbackSig messageCallback, void* pUserContext);
761  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void* pUserContext);
763 
787  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void* pUserContext);
789 
790  // ============================================================================================
791  // Application -> Geforce NOW SDK communication
792  // The application should call these methods at the appropriate locations.
797 
827 
858 
879  NVGFNSDK_EXPORT bool NVGFNSDKApi gfnIsTitleAvailable(const char* pchPlatformAppId);
880 
904  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetTitlesAvailable(const char** ppchPlatformAppIds);
905 
931  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetupTitle(const char* pchPlatformAppId);
932 
956  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnTitleExited(const char* pchPlatformId, const char* pchPlatformAppId);
957 
990  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientIp(const char** ppchClientIp);
991 
1017  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientLanguageCode(const char** ppchLanguageCode);
1018 
1041  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientCountryCode(char* pchCountryCode, unsigned int length);
1057 
1070  NVGFNSDK_EXPORT GfnRuntimeError gfnGetClientInfo(GfnClientInfo* clientInfo);
1071 
1087 
1099  NVGFNSDK_EXPORT GfnRuntimeError gfnGetSessionInfo(GfnSessionInfo* sessionInfo);
1100 
1118  NVGFNSDK_EXPORT void NVGFNSDKApi gfnStartStreamAsync(const StartStreamInput * pStartStreamInput, StartStreamCallbackSig cb, void* context, unsigned int timeoutMs);
1119 
1142  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStartStream(StartStreamInput* pStartStreamInput, StartStreamResponse* response);
1143 
1162  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStopStream(void);
1163 
1181  NVGFNSDK_EXPORT void NVGFNSDKApi gfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsigned int timeoutMs);
1182 
1206  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerData(const char** ppchPartnerData);
1207 
1231  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerSecureData(const char** ppchPartnerSecureData);
1232 
1253  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnFree(const char** ppchData);
1254 
1255 
1274  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnAppReady(bool success, const char * status);
1275 
1301  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect* zone);
1302 
1329  NVGFNSDK_EXPORT GfnRuntimeError gfnSendMessage(const char* pchMessage, unsigned int length);
1330 
1332 #ifdef __cplusplus
1333  } // extern "C"
1334 #endif
1335 
1336 
1337 #endif // GFN_SDK_RUNTIME_CAPI_H
GfnApplicationCallbackResult(GFN_CALLBACK * ExitCallbackSig)(void *pUserContext)
Callback function for notification when a game should exit. Register via gfnRegisterExitCallback API...
Definition: GfnRuntimeSdk_CAPI.h:485
+
GfnOsType
Types of operating systems that can be reported by the SDK.
Definition: GfnRuntimeSdk_CAPI.h:397
+
An update notification for a piece of client info data.
Definition: GfnRuntimeSdk_CAPI.h:437
+
unsigned int sessionTimeRemainingSec
Nominal time remaining in the session in seconds.
Definition: GfnRuntimeSdk_CAPI.h:473
+
GfnRect safeZone
Client safe zone rectangle (title-safe area), in normalized coordinates. If the entire screen is titl...
Definition: GfnRuntimeSdk_CAPI.h:446
NVGFNSDK_EXPORT GfnRuntimeError gfnGetSessionInfo(GfnSessionInfo *sessionInfo)
-
Client is actively streaming.
Definition: GfnRuntimeSdk_CAPI.h:369
-
Session info blob.
Definition: GfnRuntimeSdk_CAPI.h:484
-
GfnApplicationCallbackResult
Returned by callbacks the application registers with the Geforce NOW Runtime SDK, or passes in to asy...
Definition: GfnRuntimeSdk_CAPI.h:318
-
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:431
-
GfnNetworkStatusChangeType
The type of network status data which changed. This enum will likely be expanded over time...
Definition: GfnRuntimeSdk_CAPI.h:465
-
void(GFN_CALLBACK * StopStreamCallbackSig)(GfnRuntimeError, void *context)
Callback function signation for notifications on status of stop a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:345
-
const char * pchPartnerSecureData
Optional secure partner data that is guaranteed to be protected through the GFN pipeline.
Definition: GfnRuntimeSdk_CAPI.h:352
+
Client is actively streaming.
Definition: GfnRuntimeSdk_CAPI.h:355
+
Session info blob.
Definition: GfnRuntimeSdk_CAPI.h:470
+
GfnApplicationCallbackResult
Returned by callbacks the application registers with the Geforce NOW Runtime SDK, or passes in to asy...
Definition: GfnRuntimeSdk_CAPI.h:304
+
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:417
+
GfnNetworkStatusChangeType
The type of network status data which changed. This enum will likely be expanded over time...
Definition: GfnRuntimeSdk_CAPI.h:451
+
void(GFN_CALLBACK * StopStreamCallbackSig)(GfnRuntimeError, void *context)
Callback function signation for notifications on status of stop a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:331
+
const char * pchPartnerSecureData
Optional secure partner data that is guaranteed to be protected through the GFN pipeline.
Definition: GfnRuntimeSdk_CAPI.h:338
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId)
struct TitleInstallationInformation TitleInstallationInformation
Input to the function registered via gfnRegisterInstallCallback (if any).
@@ -110,102 +111,102 @@
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnAppReady(bool success, const char *status)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterInstallCallback(InstallCallbackSig installCallback, void *pUserContext)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnInitializeRuntimeSdk(GfnDisplayLanguage displayLanguage)
-
GfnApplicationCallbackResult(GFN_CALLBACK * PauseCallbackSig)(void *pUserContext)
Callback function for notification when a game should pause. Register via gfnRegisterPauseCallback AP...
Definition: GfnRuntimeSdk_CAPI.h:501
+
GfnApplicationCallbackResult(GFN_CALLBACK * PauseCallbackSig)(void *pUserContext)
Callback function for notification when a game should pause. Register via gfnRegisterPauseCallback AP...
Definition: GfnRuntimeSdk_CAPI.h:487
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnFree(const char **ppchData)
-
const char * GfnStreamStatusToString(GfnStreamStatus status)
Converts a GfnStreamStatus enum to a human-readable string.
Definition: GfnRuntimeSdk_CAPI.h:377
-
Considered to be running in GFN Cloud, using software and hardware heuristics that are near impossibl...
Definition: GfnRuntimeSdk_CAPI.h:332
+
const char * GfnStreamStatusToString(GfnStreamStatus status)
Converts a GfnStreamStatus enum to a human-readable string.
Definition: GfnRuntimeSdk_CAPI.h:363
+
Considered to be running in GFN Cloud, using software and hardware heuristics that are near impossibl...
Definition: GfnRuntimeSdk_CAPI.h:318
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerData(const char **ppchPartnerData)
-
unsigned int RTDAverageLatencyMs
Round Trip Delay - Average Latency in milliseconds.
Definition: GfnRuntimeSdk_CAPI.h:478
+
unsigned int RTDAverageLatencyMs
Round Trip Delay - Average Latency in milliseconds.
Definition: GfnRuntimeSdk_CAPI.h:464
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientCountryCode(char *pchCountryCode, unsigned int length)
-
const char * pchMetadataPath
Optionally contains the path at which game metadata can be found, else NULL.
Definition: GfnRuntimeSdk_CAPI.h:360
+
const char * pchMetadataPath
Optionally contains the path at which game metadata can be found, else NULL.
Definition: GfnRuntimeSdk_CAPI.h:346
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetTitlesAvailable(const char **ppchPlatformAppIds)
-
GfnDisplayLanguage
Values for languages supported by the GFN SDK, used to define which language any SDK dialogs should b...
Definition: GfnSdk.h:185
+
GfnDisplayLanguage
Values for languages supported by the GFN SDK, used to define which language any SDK dialogs should b...
Definition: GfnSdk.h:187
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetupTitle(const char *pchPlatformAppId)
-
Change in safe zone rectangle (due to device switch or rotation)
Definition: GfnRuntimeSdk_CAPI.h:446
-
struct to reference a rect
Definition: GfnSdk.h:243
-
unsigned int uiTitleId
GFN-sourced game-specific unique identifier.
Definition: GfnRuntimeSdk_CAPI.h:350
-
Considered to be running in GFN Cloud, using software and network heuristics that are difficult to ci...
Definition: GfnRuntimeSdk_CAPI.h:331
-
GfnApplicationCallbackResult(GFN_CALLBACK * StreamStatusCallbackSig)(GfnStreamStatus status, void *pUserContext)
Callback function for notifications on status of starting a streaming session. Register via gfnRegist...
Definition: GfnRuntimeSdk_CAPI.h:505
+
Change in safe zone rectangle (due to device switch or rotation)
Definition: GfnRuntimeSdk_CAPI.h:432
+
struct to reference a rect
Definition: GfnSdk.h:245
+
unsigned int uiTitleId
GFN-sourced game-specific unique identifier.
Definition: GfnRuntimeSdk_CAPI.h:336
+
Considered to be running in GFN Cloud, using software and network heuristics that are difficult to ci...
Definition: GfnRuntimeSdk_CAPI.h:317
+
GfnApplicationCallbackResult(GFN_CALLBACK * StreamStatusCallbackSig)(GfnStreamStatus status, void *pUserContext)
Callback function for notifications on status of starting a streaming session. Register via gfnRegist...
Definition: GfnRuntimeSdk_CAPI.h:491
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *pUserContext)
-
Client has successfully finished streaming.
Definition: GfnRuntimeSdk_CAPI.h:370
-
void(GFN_CALLBACK * StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse *, void *context)
Callback function signation for notifications on status of starting a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:342
+
Client has successfully finished streaming.
Definition: GfnRuntimeSdk_CAPI.h:356
+
void(GFN_CALLBACK * StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse *, void *context)
Callback function signation for notifications on status of starting a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:328
struct GfnClientInfoUpdateData GfnClientInfoUpdateData
An update notification for a piece of client info data.
-
Action to specify an editable text box rect on screen.
Definition: GfnRuntimeSdk_CAPI.h:399
-
Client info blob.
Definition: GfnRuntimeSdk_CAPI.h:429
-
Client has gained input focus to the streamer window.
Definition: GfnRuntimeSdk_CAPI.h:372
+
Action to specify an editable text box rect on screen.
Definition: GfnRuntimeSdk_CAPI.h:385
+
Client info blob.
Definition: GfnRuntimeSdk_CAPI.h:415
+
Client has gained input focus to the streamer window.
Definition: GfnRuntimeSdk_CAPI.h:358
struct StartStreamResponse StartStreamResponse
Output response when streaming has started.
enum GfnClientInfoChangeType GfnClientDataChangeType
Type of data which changed. This enum will be expanded over time.
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void *pUserContext)
NVGFNSDK_EXPORT void NVGFNSDKApi gfnShutdownRuntimeSdk()
-
Sentinel value, do not use.
Definition: GfnRuntimeSdk_CAPI.h:400
-
An update notification for a piece of network status data. This structure will likely be expanded ove...
Definition: GfnRuntimeSdk_CAPI.h:472
-
No event.
Definition: GfnRuntimeSdk_CAPI.h:398
-
unsigned int sessionMaxDurationSec
Maximum total time allowed for the session in seconds.
Definition: GfnRuntimeSdk_CAPI.h:486
-
const char * pchBuildPath
The path at which game build files can be found.
Definition: GfnRuntimeSdk_CAPI.h:359
-
GfnIsRunningInCloudAssurance
Returned from gfnIsRunningInCloudSecure to denote security assurance that the calling application is ...
Definition: GfnRuntimeSdk_CAPI.h:327
+
Sentinel value, do not use.
Definition: GfnRuntimeSdk_CAPI.h:386
+
An update notification for a piece of network status data. This structure will likely be expanded ove...
Definition: GfnRuntimeSdk_CAPI.h:458
+
No event.
Definition: GfnRuntimeSdk_CAPI.h:384
+
unsigned int sessionMaxDurationSec
Maximum total time allowed for the session in seconds.
Definition: GfnRuntimeSdk_CAPI.h:472
+
const char * pchBuildPath
The path at which game build files can be found.
Definition: GfnRuntimeSdk_CAPI.h:345
+
GfnIsRunningInCloudAssurance
Returned from gfnIsRunningInCloudSecure to denote security assurance that the calling application is ...
Definition: GfnRuntimeSdk_CAPI.h:313
NVGFNSDK_EXPORT bool NVGFNSDKApi gfnIsTitleAvailable(const char *pchPlatformAppId)
NVGFNSDK_EXPORT GfnRuntimeError gfnGetClientInfo(GfnClientInfo *clientInfo)
-
Change in OS of GFN Client.
Definition: GfnRuntimeSdk_CAPI.h:443
-
GfnApplicationCallbackResult(GFN_CALLBACK * NetworkStatusCallbackSig)(GfnNetworkStatusUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on network status changes. Register via gfnRegisterNetworkStatusC...
Definition: GfnRuntimeSdk_CAPI.h:514
+
Change in OS of GFN Client.
Definition: GfnRuntimeSdk_CAPI.h:429
+
GfnApplicationCallbackResult(GFN_CALLBACK * NetworkStatusCallbackSig)(GfnNetworkStatusUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on network status changes. Register via gfnRegisterNetworkStatusC...
Definition: GfnRuntimeSdk_CAPI.h:500
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientLanguageCode(const char **ppchLanguageCode)
-
Client has stopped streaming and has entered an error state.
Definition: GfnRuntimeSdk_CAPI.h:371
-
bool sessionRTXEnabled
Defines if RTX support is enabled for the session.
Definition: GfnRuntimeSdk_CAPI.h:489
-
struct to reference a string with length data
Definition: GfnSdk.h:254
-
GfnResolutionInfo clientResolution
Client device&#39;s physical resolution, if reported. If client does not report, expect values of zero...
Definition: GfnRuntimeSdk_CAPI.h:459
-
GfnApplicationCallbackResult(GFN_CALLBACK * ClientInfoCallbackSig)(GfnClientInfoUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on client info changes. Register via gfnRegisterClientInfoCallbac...
Definition: GfnRuntimeSdk_CAPI.h:512
-
GfnClientDataChangeType updateType
Type of GFN Client data that changed.
Definition: GfnRuntimeSdk_CAPI.h:454
+
Client has stopped streaming and has entered an error state.
Definition: GfnRuntimeSdk_CAPI.h:357
+
bool sessionRTXEnabled
Defines if RTX support is enabled for the session.
Definition: GfnRuntimeSdk_CAPI.h:475
+
struct to reference a string with length data
Definition: GfnSdk.h:256
+
GfnResolutionInfo clientResolution
Client device&#39;s physical resolution, if reported. If client does not report, expect values of zero...
Definition: GfnRuntimeSdk_CAPI.h:445
+
GfnApplicationCallbackResult(GFN_CALLBACK * ClientInfoCallbackSig)(GfnClientInfoUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on client info changes. Register via gfnRegisterClientInfoCallbac...
Definition: GfnRuntimeSdk_CAPI.h:498
+
GfnClientDataChangeType updateType
Type of GFN Client data that changed.
Definition: GfnRuntimeSdk_CAPI.h:440
NVGFNSDK_EXPORT void NVGFNSDKApi gfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs)
NVGFNSDK_EXPORT GfnRuntimeError gfnSendMessage(const char *pchMessage, unsigned int length)
-
Input to the function registered via gfnRegisterInstallCallback (if any).
Definition: GfnRuntimeSdk_CAPI.h:356
-
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:453
-
Change in IP of GFN Client (due to device switch/reconnect)
Definition: GfnRuntimeSdk_CAPI.h:444
-
GfnActionType
Specifies the action in GfnSetActionZone API Deprecated with SetActionZone removal.
Definition: GfnRuntimeSdk_CAPI.h:396
-
Sentinel value for GfnClientInfoChangeType.
Definition: GfnRuntimeSdk_CAPI.h:447
-
GfnApplicationCallbackResult(GFN_CALLBACK * InstallCallbackSig)(const TitleInstallationInformation *pInfo, void *pUserContext)
Callback function for notification when a game is being installed to allow for installation actions...
Definition: GfnRuntimeSdk_CAPI.h:503
-
Initial default state.
Definition: GfnRuntimeSdk_CAPI.h:366
-
GfnNetworkStatusChangeType updateType
Network Status Update type.
Definition: GfnRuntimeSdk_CAPI.h:475
-
GfnApplicationCallbackResult(GFN_CALLBACK * SaveCallbackSig)(void *pUserContext)
Callback function for notifications when a game should save its state. Register via gfnRegisterSaveCa...
Definition: GfnRuntimeSdk_CAPI.h:507
-
Change in resolution of GFN Client.
Definition: GfnRuntimeSdk_CAPI.h:445
+
Input to the function registered via gfnRegisterInstallCallback (if any).
Definition: GfnRuntimeSdk_CAPI.h:342
+
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:439
+
Change in IP of GFN Client (due to device switch/reconnect)
Definition: GfnRuntimeSdk_CAPI.h:430
+
GfnActionType
Specifies the action in GfnSetActionZone API Deprecated with SetActionZone removal.
Definition: GfnRuntimeSdk_CAPI.h:382
+
Sentinel value for GfnClientInfoChangeType.
Definition: GfnRuntimeSdk_CAPI.h:433
+
GfnApplicationCallbackResult(GFN_CALLBACK * InstallCallbackSig)(const TitleInstallationInformation *pInfo, void *pUserContext)
Callback function for notification when a game is being installed to allow for installation actions...
Definition: GfnRuntimeSdk_CAPI.h:489
+
Initial default state.
Definition: GfnRuntimeSdk_CAPI.h:352
+
GfnNetworkStatusChangeType updateType
Network Status Update type.
Definition: GfnRuntimeSdk_CAPI.h:461
+
GfnApplicationCallbackResult(GFN_CALLBACK * SaveCallbackSig)(void *pUserContext)
Callback function for notifications when a game should save its state. Register via gfnRegisterSaveCa...
Definition: GfnRuntimeSdk_CAPI.h:493
+
Change in resolution of GFN Client.
Definition: GfnRuntimeSdk_CAPI.h:431
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *pUserContext)
-
GfnClientInfoChangeType
Type of data which changed. This enum will be expanded over time.
Definition: GfnRuntimeSdk_CAPI.h:441
-
Client is running a network test to determine the best zone.
Definition: GfnRuntimeSdk_CAPI.h:367
-
GfnOsType osType
Operating System type.
Definition: GfnRuntimeSdk_CAPI.h:457
-
GfnApplicationCallbackResult(GFN_CALLBACK * SessionInitCallbackSig)(const char *partnerInfoMutable, void *pUserContext)
Callback function for notifications when a game should continue late-stage initialization. Register via gfnRegisterSessionInitCallback API. Function should consume or copy the passed-in partnerInfoMutable string.
Definition: GfnRuntimeSdk_CAPI.h:510
+
GfnClientInfoChangeType
Type of data which changed. This enum will be expanded over time.
Definition: GfnRuntimeSdk_CAPI.h:427
+
Client is running a network test to determine the best zone.
Definition: GfnRuntimeSdk_CAPI.h:353
+
GfnOsType osType
Operating System type.
Definition: GfnRuntimeSdk_CAPI.h:443
+
GfnApplicationCallbackResult(GFN_CALLBACK * SessionInitCallbackSig)(const char *partnerInfoMutable, void *pUserContext)
Callback function for notifications when a game should continue late-stage initialization. Register via gfnRegisterSessionInitCallback API. Function should consume or copy the passed-in partnerInfoMutable string.
Definition: GfnRuntimeSdk_CAPI.h:496
NVGFNSDK_EXPORT bool NVGFNSDKApi gfnIsRunningInCloud()
-
GfnApplicationCallbackResult(GFN_CALLBACK * MessageCallbackSig)(const GfnString *pStrData, void *pUserContext)
Callback function for notifications when an application recieves a custom message.
Definition: GfnRuntimeSdk_CAPI.h:516
+
GfnApplicationCallbackResult(GFN_CALLBACK * MessageCallbackSig)(const GfnString *pStrData, void *pUserContext)
Callback function for notifications when an application recieves a custom message.
Definition: GfnRuntimeSdk_CAPI.h:502
struct StartStreamInput StartStreamInput
Input data for gfnStartStream.
-
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:474
+
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:460
#define NVGFNSDK_EXPORT
Future support.
Definition: GfnSdk.h:65
-
Considered to be running in GFN Cloud, using software heuristics that are not guaranteed against circ...
Definition: GfnRuntimeSdk_CAPI.h:330
+
Considered to be running in GFN Cloud, using software heuristics that are not guaranteed against circ...
Definition: GfnRuntimeSdk_CAPI.h:316
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientIp(const char **ppchClientIp)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStartStream(StartStreamInput *pStartStreamInput, StartStreamResponse *response)
-
bool downloaded
True if Geforce NOW client components were downloaded from the release site.
Definition: GfnRuntimeSdk_CAPI.h:338
+
bool downloaded
True if Geforce NOW client components were downloaded from the release site.
Definition: GfnRuntimeSdk_CAPI.h:324
#define GFN_CALLBACK
Future support.
Definition: GfnSdk.h:63
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStopStream(void)
-
Change in RTDAverageLatency.
Definition: GfnRuntimeSdk_CAPI.h:467
-
GfnStreamStatus
Possible states of the client streamer.
Definition: GfnRuntimeSdk_CAPI.h:364
+
Change in RTDAverageLatency.
Definition: GfnRuntimeSdk_CAPI.h:453
+
GfnStreamStatus
Possible states of the client streamer.
Definition: GfnRuntimeSdk_CAPI.h:350
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *pUserContext)
-
Return to indicate that a callback has performed the requested operation.
Definition: GfnRuntimeSdk_CAPI.h:320
-
Not considered to be running in GFN cloud, as it looks like a client/local system.
Definition: GfnRuntimeSdk_CAPI.h:329
+
Return to indicate that a callback has performed the requested operation.
Definition: GfnRuntimeSdk_CAPI.h:306
+
Not considered to be running in GFN cloud, as it looks like a client/local system.
Definition: GfnRuntimeSdk_CAPI.h:315
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *pUserContext)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *pUserContext)
-
Output response when streaming has started.
Definition: GfnRuntimeSdk_CAPI.h:336
+
Output response when streaming has started.
Definition: GfnRuntimeSdk_CAPI.h:322
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone)
-
const char * pchPartnerData
Optional non-secure partner data that is passed to the streaming cloud instance and can be retrieved ...
Definition: GfnRuntimeSdk_CAPI.h:351
-
GfnResolutionInfo clientResolution
Client device&#39;s physical resolution, if reported. If client does not report, expect values of zero...
Definition: GfnRuntimeSdk_CAPI.h:437
+
const char * pchPartnerData
Optional non-secure partner data that is passed to the streaming cloud instance and can be retrieved ...
Definition: GfnRuntimeSdk_CAPI.h:337
+
GfnResolutionInfo clientResolution
Client device&#39;s physical resolution, if reported. If client does not report, expect values of zero...
Definition: GfnRuntimeSdk_CAPI.h:423
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerSecureData(const char **ppchPartnerSecureData)
-
Sentinel value for GfnNetworkStatusChangeType.
Definition: GfnRuntimeSdk_CAPI.h:468
+
Sentinel value for GfnNetworkStatusChangeType.
Definition: GfnRuntimeSdk_CAPI.h:454
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterExitCallback(ExitCallbackSig exitCallback, void *pUserContext)
-
Client is loading the game.
Definition: GfnRuntimeSdk_CAPI.h:368
+
Client is loading the game.
Definition: GfnRuntimeSdk_CAPI.h:354
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *pUserContext)
-
Client has lost input focus to the streamer window.
Definition: GfnRuntimeSdk_CAPI.h:373
-
Definition: GfnSdk.h:260
-
const char * pchPlatformAppId
Platform application ID passed into the API.
Definition: GfnRuntimeSdk_CAPI.h:358
-
unsigned int RTDAverageLatencyMs
Round Trip Delay - Average Latency in milliseconds.
Definition: GfnRuntimeSdk_CAPI.h:436
-
GfnOsType osType
Operating System type.
Definition: GfnRuntimeSdk_CAPI.h:432
-
Input data for gfnStartStream.
Definition: GfnRuntimeSdk_CAPI.h:348
-
Return to indicate that a callback did not perform the requested operation.
Definition: GfnRuntimeSdk_CAPI.h:321
+
Client has lost input focus to the streamer window.
Definition: GfnRuntimeSdk_CAPI.h:359
+
Definition: GfnSdk.h:262
+
const char * pchPlatformAppId
Platform application ID passed into the API.
Definition: GfnRuntimeSdk_CAPI.h:344
+
unsigned int RTDAverageLatencyMs
Round Trip Delay - Average Latency in milliseconds.
Definition: GfnRuntimeSdk_CAPI.h:422
+
GfnOsType osType
Operating System type.
Definition: GfnRuntimeSdk_CAPI.h:418
+
Input data for gfnStartStream.
Definition: GfnRuntimeSdk_CAPI.h:334
+
Return to indicate that a callback did not perform the requested operation.
Definition: GfnRuntimeSdk_CAPI.h:307
#define NVGFNSDKApi
Future support.
Definition: GfnSdk.h:67
diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h.html b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h.html index 7a44163..63376cf 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h.html @@ -27,6 +27,7 @@
@@ -93,6 +94,7 @@
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h_source.html b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h_source.html index 26ec343..de9ac1f 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h_source.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h_source.html @@ -27,6 +27,7 @@ @@ -89,45 +90,45 @@
GfnRuntimeSdk_Wrapper.h
-Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // C-based wrapper API declarations for GFN Runtime SDK APIs
32 //
33 // ===============================================================================================
39 
234 #include "GfnRuntimeSdk_CAPI.h"
235 
236 #ifdef _WIN32
237  #ifndef WIN32_LEAN_AND_MEAN
238  #define WIN32_LEAN_AND_MEAN
239  #endif
240  #include <windows.h>
242  extern HMODULE g_gfnSdkModule;
243 #endif
244 
245 #ifdef __cplusplus
246 extern "C"
247 {
248 #endif
249 
274  GfnRuntimeError GfnInitializeSdk(GfnDisplayLanguage language);
275 
277  #define GfnInitializeSdkFromPath GfnInitializeSdkFromPathA
278 
299  GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char* sdkLibraryPath);
300 
321  GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wchar_t* wSdkLibraryPath);
322 
335  GfnRuntimeError GfnShutdownSdk(void);
336 
366  GfnRuntimeError GfnIsRunningInCloud(bool* runningInCloud);
367 
395  GfnRuntimeError GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance* assurance);
396 
418  GfnRuntimeError GfnGetClientIpV4(const char** clientIp);
419 
442  GfnRuntimeError GfnGetClientLanguageCode(const char** languageCode);
443 
463  GfnRuntimeError GfnGetClientCountryCode(char* countryCode, unsigned int length);
464 
490  GfnRuntimeError GfnGetClientInfo(GfnClientInfo* clientInfo);
491 
504 
516  GfnRuntimeError GfnGetSessionInfo(GfnSessionInfo* sessionInfo);
517 
539  GfnRuntimeError GfnGetPartnerData(const char** partnerData);
540 
562  GfnRuntimeError GfnGetPartnerSecureData(const char** partnerSecureData);
563 
588  GfnRuntimeError GfnIsTitleAvailable(const char* platformAppId, bool* isAvailable);
589 
614  GfnRuntimeError GfnGetTitlesAvailable(const char** platformAppIds);
615 
632  GfnRuntimeError GfnFree(const char** data);
633 
634 
655  GfnRuntimeError GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void* userContext);
656 
677  GfnRuntimeError GfnStartStream(StartStreamInput* startStreamInput, StartStreamResponse* response);
678 
704  GfnRuntimeError GfnStartStreamAsync(const StartStreamInput* startStreamInput, StartStreamCallbackSig cb, void* context, unsigned int timeoutMs);
705 
722  GfnRuntimeError GfnStopStream(void);
723 
749  GfnRuntimeError GfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsigned int timeoutMs);
750 
769  GfnRuntimeError GfnSetupTitle(const char* platformAppId);
770 
789  GfnRuntimeError GfnTitleExited(const char* platformId, const char* platformAppId);
790 
813  GfnRuntimeError GfnRegisterExitCallback(ExitCallbackSig exitCallback, void* userContext);
814 
837  GfnRuntimeError GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void* userContext);
838 
861  GfnRuntimeError GfnRegisterInstallCallback(InstallCallbackSig installCallback, void* userContext);
862 
882  GfnRuntimeError GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void* userContext);
883 
904  GfnRuntimeError GfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void* userContext);
905 
926  GfnRuntimeError GfnRegisterMessageCallback(MessageCallbackSig messageCallback, void* userContext);
927 
928 
941  GfnRuntimeError GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void* userContext);
942 
959  GfnRuntimeError GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void* userContext);
960 
978  GfnRuntimeError GfnAppReady(bool success, const char * status);
979 
1006  GfnRuntimeError GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect* zone);
1007 
1008 
1032  GfnRuntimeError GfnSendMessage(const char* pchMessage, unsigned int length);
1033 
1035 #ifdef __cplusplus
1036  } // extern "C"
1037 #endif
GfnApplicationCallbackResult(GFN_CALLBACK * ExitCallbackSig)(void *pUserContext)
Callback function for notification when a game should exit. Register via gfnRegisterExitCallback API...
Definition: GfnRuntimeSdk_CAPI.h:499
+Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // C-based wrapper API declarations for GFN Runtime SDK APIs
32 //
33 // ===============================================================================================
39 
234 #include "GfnRuntimeSdk_CAPI.h"
235 
236 #include <stddef.h>
237 
238 #ifdef _WIN32
239  #define CHAR_TYPE wchar_t
240  #ifndef WIN32_LEAN_AND_MEAN
241  #define WIN32_LEAN_AND_MEAN
242  #endif
243  #include <windows.h>
245  extern HMODULE g_gfnSdkModule;
246 #elif __linux__
247  #define CHAR_TYPE char
248 #endif
249 
250 #ifdef __cplusplus
251 extern "C"
252 {
253 #endif
254 
282  GfnRuntimeError GfnInitializeSdk(GfnDisplayLanguage language);
283 
285  #define GfnInitializeSdkFromPath GfnInitializeSdkFromPathA
286 
310  GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char* sdkLibraryPath);
311 
335  GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wchar_t* wSdkLibraryPath);
336 
352  GfnRuntimeError GfnShutdownSdk(void);
353 
386  GfnRuntimeError GfnIsRunningInCloud(bool* runningInCloud);
387 
418  GfnRuntimeError GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance* assurance);
419 
444  GfnRuntimeError GfnGetClientIpV4(const char** clientIp);
445 
471  GfnRuntimeError GfnGetClientLanguageCode(const char** languageCode);
472 
495  GfnRuntimeError GfnGetClientCountryCode(char* countryCode, unsigned int length);
496 
525  GfnRuntimeError GfnGetClientInfo(GfnClientInfo* clientInfo);
526 
542 
554  GfnRuntimeError GfnGetSessionInfo(GfnSessionInfo* sessionInfo);
555 
581  GfnRuntimeError GfnGetPartnerData(const char** partnerData);
582 
608  GfnRuntimeError GfnGetPartnerSecureData(const char** partnerSecureData);
609 
637  GfnRuntimeError GfnIsTitleAvailable(const char* platformAppId, bool* isAvailable);
638 
666  GfnRuntimeError GfnGetTitlesAvailable(const char** platformAppIds);
667 
687  GfnRuntimeError GfnFree(const char** data);
688 
689 
713  GfnRuntimeError GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void* userContext);
714 
738  GfnRuntimeError GfnStartStream(StartStreamInput* startStreamInput, StartStreamResponse* response);
739 
768  GfnRuntimeError GfnStartStreamAsync(const StartStreamInput* startStreamInput, StartStreamCallbackSig cb, void* context, unsigned int timeoutMs);
769 
789  GfnRuntimeError GfnStopStream(void);
790 
819  GfnRuntimeError GfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsigned int timeoutMs);
820 
842  GfnRuntimeError GfnSetupTitle(const char* platformAppId);
843 
865  GfnRuntimeError GfnTitleExited(const char* platformId, const char* platformAppId);
866 
892  GfnRuntimeError GfnRegisterExitCallback(ExitCallbackSig exitCallback, void* userContext);
893 
919  GfnRuntimeError GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void* userContext);
920 
946  GfnRuntimeError GfnRegisterInstallCallback(InstallCallbackSig installCallback, void* userContext);
947 
970  GfnRuntimeError GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void* userContext);
971 
995  GfnRuntimeError GfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void* userContext);
996 
1020  GfnRuntimeError GfnRegisterMessageCallback(MessageCallbackSig messageCallback, void* userContext);
1021 
1022 
1038  GfnRuntimeError GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void* userContext);
1039 
1059  GfnRuntimeError GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void* userContext);
1060 
1081  GfnRuntimeError GfnAppReady(bool success, const char * status);
1082 
1112  GfnRuntimeError GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect* zone);
1113 
1114 
1141  GfnRuntimeError GfnSendMessage(const char* pchMessage, unsigned int length);
1142 
1144 #ifdef __cplusplus
1145  } // extern "C"
1146 #endif
GfnApplicationCallbackResult(GFN_CALLBACK * ExitCallbackSig)(void *pUserContext)
Callback function for notification when a game should exit. Register via gfnRegisterExitCallback API...
Definition: GfnRuntimeSdk_CAPI.h:485
GfnRuntimeError GfnSetupTitle(const char *platformAppId)
-
Session info blob.
Definition: GfnRuntimeSdk_CAPI.h:484
+
Session info blob.
Definition: GfnRuntimeSdk_CAPI.h:470
GfnRuntimeError GfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *userContext)
GfnRuntimeError GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *userContext)
GfnRuntimeError GfnIsRunningInCloud(bool *runningInCloud)
-
void(GFN_CALLBACK * StopStreamCallbackSig)(GfnRuntimeError, void *context)
Callback function signation for notifications on status of stop a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:345
+
void(GFN_CALLBACK * StopStreamCallbackSig)(GfnRuntimeError, void *context)
Callback function signation for notifications on status of stop a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:331
GfnRuntimeError GfnGetClientCountryCode(char *countryCode, unsigned int length)
GfnRuntimeError GfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void *userContext)
GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char *sdkLibraryPath)
GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wchar_t *wSdkLibraryPath)
-
GfnApplicationCallbackResult(GFN_CALLBACK * PauseCallbackSig)(void *pUserContext)
Callback function for notification when a game should pause. Register via gfnRegisterPauseCallback AP...
Definition: GfnRuntimeSdk_CAPI.h:501
+
GfnApplicationCallbackResult(GFN_CALLBACK * PauseCallbackSig)(void *pUserContext)
Callback function for notification when a game should pause. Register via gfnRegisterPauseCallback AP...
Definition: GfnRuntimeSdk_CAPI.h:487
GfnRuntimeError GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone)
-
GfnDisplayLanguage
Values for languages supported by the GFN SDK, used to define which language any SDK dialogs should b...
Definition: GfnSdk.h:185
+
GfnDisplayLanguage
Values for languages supported by the GFN SDK, used to define which language any SDK dialogs should b...
Definition: GfnSdk.h:187
GfnRuntimeError GfnRegisterExitCallback(ExitCallbackSig exitCallback, void *userContext)
GfnRuntimeError GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *userContext)
-
struct to reference a rect
Definition: GfnSdk.h:243
-
GfnApplicationCallbackResult(GFN_CALLBACK * StreamStatusCallbackSig)(GfnStreamStatus status, void *pUserContext)
Callback function for notifications on status of starting a streaming session. Register via gfnRegist...
Definition: GfnRuntimeSdk_CAPI.h:505
-
void(GFN_CALLBACK * StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse *, void *context)
Callback function signation for notifications on status of starting a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:342
+
struct to reference a rect
Definition: GfnSdk.h:245
+
GfnApplicationCallbackResult(GFN_CALLBACK * StreamStatusCallbackSig)(GfnStreamStatus status, void *pUserContext)
Callback function for notifications on status of starting a streaming session. Register via gfnRegist...
Definition: GfnRuntimeSdk_CAPI.h:491
+
void(GFN_CALLBACK * StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse *, void *context)
Callback function signation for notifications on status of starting a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:328
GfnRuntimeError GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *userContext)
-
Client info blob.
Definition: GfnRuntimeSdk_CAPI.h:429
+
Client info blob.
Definition: GfnRuntimeSdk_CAPI.h:415
GfnRuntimeError GfnRegisterInstallCallback(InstallCallbackSig installCallback, void *userContext)
GfnRuntimeError GfnInitializeSdk(GfnDisplayLanguage language)
GfnRuntimeError GfnGetPartnerData(const char **partnerData)
-
GfnIsRunningInCloudAssurance
Returned from gfnIsRunningInCloudSecure to denote security assurance that the calling application is ...
Definition: GfnRuntimeSdk_CAPI.h:327
+
GfnIsRunningInCloudAssurance
Returned from gfnIsRunningInCloudSecure to denote security assurance that the calling application is ...
Definition: GfnRuntimeSdk_CAPI.h:313
GfnRuntimeError GfnShutdownSdk(void)
GfnRuntimeError GfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs)
-
GfnApplicationCallbackResult(GFN_CALLBACK * NetworkStatusCallbackSig)(GfnNetworkStatusUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on network status changes. Register via gfnRegisterNetworkStatusC...
Definition: GfnRuntimeSdk_CAPI.h:514
+
GfnApplicationCallbackResult(GFN_CALLBACK * NetworkStatusCallbackSig)(GfnNetworkStatusUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on network status changes. Register via gfnRegisterNetworkStatusC...
Definition: GfnRuntimeSdk_CAPI.h:500
GfnRuntimeError GfnGetPartnerSecureData(const char **partnerSecureData)
GfnRuntimeError GfnGetClientLanguageCode(const char **languageCode)
-
GfnApplicationCallbackResult(GFN_CALLBACK * ClientInfoCallbackSig)(GfnClientInfoUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on client info changes. Register via gfnRegisterClientInfoCallbac...
Definition: GfnRuntimeSdk_CAPI.h:512
+
GfnApplicationCallbackResult(GFN_CALLBACK * ClientInfoCallbackSig)(GfnClientInfoUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on client info changes. Register via gfnRegisterClientInfoCallbac...
Definition: GfnRuntimeSdk_CAPI.h:498
GfnRuntimeError GfnGetClientInfo(GfnClientInfo *clientInfo)
-
GfnActionType
Specifies the action in GfnSetActionZone API Deprecated with SetActionZone removal.
Definition: GfnRuntimeSdk_CAPI.h:396
-
GfnApplicationCallbackResult(GFN_CALLBACK * InstallCallbackSig)(const TitleInstallationInformation *pInfo, void *pUserContext)
Callback function for notification when a game is being installed to allow for installation actions...
Definition: GfnRuntimeSdk_CAPI.h:503
-
GfnApplicationCallbackResult(GFN_CALLBACK * SaveCallbackSig)(void *pUserContext)
Callback function for notifications when a game should save its state. Register via gfnRegisterSaveCa...
Definition: GfnRuntimeSdk_CAPI.h:507
-
GfnApplicationCallbackResult(GFN_CALLBACK * SessionInitCallbackSig)(const char *partnerInfoMutable, void *pUserContext)
Callback function for notifications when a game should continue late-stage initialization. Register via gfnRegisterSessionInitCallback API. Function should consume or copy the passed-in partnerInfoMutable string.
Definition: GfnRuntimeSdk_CAPI.h:510
+
GfnActionType
Specifies the action in GfnSetActionZone API Deprecated with SetActionZone removal.
Definition: GfnRuntimeSdk_CAPI.h:382
+
GfnApplicationCallbackResult(GFN_CALLBACK * InstallCallbackSig)(const TitleInstallationInformation *pInfo, void *pUserContext)
Callback function for notification when a game is being installed to allow for installation actions...
Definition: GfnRuntimeSdk_CAPI.h:489
+
GfnApplicationCallbackResult(GFN_CALLBACK * SaveCallbackSig)(void *pUserContext)
Callback function for notifications when a game should save its state. Register via gfnRegisterSaveCa...
Definition: GfnRuntimeSdk_CAPI.h:493
+
GfnApplicationCallbackResult(GFN_CALLBACK * SessionInitCallbackSig)(const char *partnerInfoMutable, void *pUserContext)
Callback function for notifications when a game should continue late-stage initialization. Register via gfnRegisterSessionInitCallback API. Function should consume or copy the passed-in partnerInfoMutable string.
Definition: GfnRuntimeSdk_CAPI.h:496
GfnRuntimeError GfnStartStreamAsync(const StartStreamInput *startStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs)
GfnRuntimeError GfnTitleExited(const char *platformId, const char *platformAppId)
-
GfnApplicationCallbackResult(GFN_CALLBACK * MessageCallbackSig)(const GfnString *pStrData, void *pUserContext)
Callback function for notifications when an application recieves a custom message.
Definition: GfnRuntimeSdk_CAPI.h:516
+
GfnApplicationCallbackResult(GFN_CALLBACK * MessageCallbackSig)(const GfnString *pStrData, void *pUserContext)
Callback function for notifications when an application recieves a custom message.
Definition: GfnRuntimeSdk_CAPI.h:502
GfnRuntimeError GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *userContext)
GfnRuntimeError GfnGetTitlesAvailable(const char **platformAppIds)
GfnRuntimeError GfnFree(const char **data)
@@ -135,13 +136,13 @@
GfnRuntimeError GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *userContext)
GfnRuntimeError GfnStartStream(StartStreamInput *startStreamInput, StartStreamResponse *response)
GfnRuntimeError GfnIsTitleAvailable(const char *platformAppId, bool *isAvailable)
-
Output response when streaming has started.
Definition: GfnRuntimeSdk_CAPI.h:336
+
Output response when streaming has started.
Definition: GfnRuntimeSdk_CAPI.h:322
GfnRuntimeError GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance)
GfnRuntimeError GfnStopStream(void)
GfnRuntimeError GfnSendMessage(const char *pchMessage, unsigned int length)
GfnRuntimeError GfnAppReady(bool success, const char *status)
-
Input data for gfnStartStream.
Definition: GfnRuntimeSdk_CAPI.h:348
+
Input data for gfnStartStream.
Definition: GfnRuntimeSdk_CAPI.h:334
GfnRuntimeError GfnGetClientIpV4(const char **clientIp)
diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h.html b/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h.html index 77f0d9f..f106bda 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h.html @@ -27,6 +27,7 @@
@@ -89,8 +90,7 @@ Classes | Macros | Typedefs | -Enumerations | -Functions +Enumerations
GfnSdk.h File Reference
@@ -136,11 +136,11 @@ +#define  +#define  +#define  +#define  +#define  +#define  +#define  +#define  +#define 
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
 GFN SDK Major Version.
 
-#define NVGFNSDK_VERSION_MINOR   0
NVGFNSDK_VERSION_MINOR   1
 GFN SDK Minor Version.
 
-#define NVGFNSDK_VERSION_SHORT   2.0
NVGFNSDK_VERSION_SHORT   2.1
 GFN SDK Version.
 
@@ -148,29 +148,29 @@
 GFN SDK Patch Version.
 
-#define NVGFNSDK_VERSION_BUILD   33103756
NVGFNSDK_VERSION_BUILD   33843515
 GFN SDK Build Version.
 
-#define NVGFNSDK_VERSION_LONG   2.0.0.33103756
NVGFNSDK_VERSION_LONG   2.1.0.33843515
 GFN SDK Version.
 
-#define NVGFNSDK_VERSION_STR   "2.0.0.33103756"
NVGFNSDK_VERSION_STR   "2.1.0.33843515"
 GFN SDK Version string.
 
-#define NVGFNSDK_VERSION_STR_PROD   "2.0.0"
NVGFNSDK_VERSION_STR_PROD   "2.1.0"
 
-#define NVGFNSDK_VERSION_BUILDCL   33103756
NVGFNSDK_VERSION_BUILDCL   33843515
 GFN SDK Build CL.
 
-#define NVGFNSDK_VERSION_BUILDH   3310
NVGFNSDK_VERSION_BUILDH   3384
 
-#define NVGFNSDK_VERSION_BUILDL   3756
NVGFNSDK_VERSION_BUILDL   3515
 
@@ -302,13 +305,6 @@ } -

@@ -244,7 +244,10 @@   gfnBinarySignatureInvalid = -26, gfnCloudLibraryNotFound = -27, gfnClientLibraryNotFound = -28, -gfnNoData = -29 +gfnNoData = -29, +
+  gfnNotAuthorized = -30, +gfnBackendError = -31
}

 Returned by InitializeGfnRuntime and GfnRuntime API methods. More...
 Formats to specify a rect with top-left as origin. More...
 
- - - - -

-Functions

bool GFNSDK_SUCCEEDED (GfnError code)
 
bool GFNSDK_FAILED (GfnError code)
 

Detailed Description

Common declarations for GFN SDK APIs

@@ -539,6 +535,12 @@ gfnNoData 

Requested data is empty or doesn't exist.

+gfnNotAuthorized  +

API Call failed because it was called from unauthorized process.

+ +gfnBackendError  +

Failed to communicate with the GFN backend service.

+
@@ -566,85 +568,6 @@ -
- -

Function Documentation

- -
-
- - - - - -
- - - - - - - - -
bool GFNSDK_FAILED (GfnError code)
-
-inline
-
-
Description
GfnRuntimeError failure function
-
Usage
Use to determine if GfnRuntimeError value translates to failure
-
Parameters
- - -
code- GfnRuntimeError type value
-
-
-
Return values
- - - -
true- GfnRuntimeError value indicates failure
false- GfnRuntimeError value indicates success
-
-
- -
-
- -
-
- - - - - -
- - - - - - - - -
bool GFNSDK_SUCCEEDED (GfnError code)
-
-inline
-
-
Description
GfnRuntimeError success function
-
Usage
Use to determine if GfnRuntimeError value translates to success
-
Parameters
- - -
code- GfnRuntimeError type value
-
-
-
Return values
- - - -
true- GfnRuntimeError value indicates success
false- GfnRuntimeError value indicates failure
-
-
-
diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h_source.html b/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h_source.html index acb951f..78b1d5d 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h_source.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h_source.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
@@ -89,86 +90,86 @@
GfnSdk.h
-Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // Common declarations for GFN SDK APIs
32 //
33 // ===============================================================================================
34 
43 #ifndef GFN_SDK_CAPI_H
44 #define GFN_SDK_CAPI_H
45 
46 
47 // Required for streamer / DLL download step in StartStream
48 #ifdef _WIN32
49 # pragma comment(lib, "ws2_32.lib")
50 # pragma comment(lib, "crypt32.lib")
51 # pragma comment(lib, "Wldap32.lib")
52 # pragma comment(lib, "version.lib")
53 # pragma comment(lib, "shlwapi.lib")
54 # pragma comment(lib, "Rpcrt4.lib")
55 # pragma comment(lib, "wintrust")
56 # define GFN_CALLBACK __stdcall
57 # define NVGFNSDK_EXPORT __declspec(dllexport)
58 # define NVGFNSDKApi __cdecl
59 # include <stddef.h>
60 #else
61 // Support to be added in a later release
63 # define GFN_CALLBACK
64 # define NVGFNSDK_EXPORT
66 # define NVGFNSDKApi
68 #endif
69 
70 #ifndef __cplusplus
71 typedef char bool;
74 #define false 0
75 #define true 1
77 #endif
78 
80 #define NVGFNSDK_VERSION_MAJOR 2
81 
83 #define NVGFNSDK_VERSION_MINOR 0
84 
86 #define NVGFNSDK_VERSION_SHORT 2.0
87 
89 #define NVGFNSDK_VERSION_PATCH 0
90 
92 #define NVGFNSDK_VERSION_BUILD 33103756
93 
95 #define NVGFNSDK_VERSION_LONG 2.0.0.33103756
96 
98 #define NVGFNSDK_VERSION_STR "2.0.0.33103756"
99 #define NVGFNSDK_VERSION_STR_PROD "2.0.0"
100 
102 #define NVGFNSDK_VERSION_BUILDCL 33103756
103 #define NVGFNSDK_VERSION_BUILDH 3310
104 #define NVGFNSDK_VERSION_BUILDL 3756
105 
106 
107 #ifdef __cplusplus
108  extern "C"
109  {
110 #endif
111  // ============================================================================================
112  // Constants/Enums
113  // ============================================================================================
114 
116  typedef enum GfnError
117  {
123  gfnComError = -3,
131  gfnTimedOut = -11,
142  gfnCanceled = -22,
144  gfnThrottled = -24,
149  gfnNoData = -29
150  } GfnError;
151 
163  inline bool GFNSDK_SUCCEEDED(GfnError code)
164  {
165  return code >= 0;
166  }
167 
179  inline bool GFNSDK_FAILED(GfnError code)
180  {
181  return code < 0;
182  }
183 
185  typedef enum GfnDisplayLanguage
186  {
188  gfn_bg_BG = 1,
189  gfn_cs_CZ = 2,
190  gfn_nl_NL = 3,
191  gfn_de_DE = 4,
192  gfn_el_GR = 5,
193  gfn_en_US = 6,
194  gfn_en_UK = 7,
195  gfn_es_ES = 8,
196  gfn_es_MX = 9,
197  gfn_fi_FI = 10,
198  gfn_fr_FR = 11,
199  gfn_hu_HU = 12,
200  gfn_it_IT = 13,
201  gfn_ja_JP = 14,
202  gfn_ko_KR = 15,
203  gfn_nb_NO = 16,
204  gfn_po_PO = 17,
205  gfn_pt_BR = 18,
206  gfn_pt_PT = 19,
207  gfn_ro_RO = 20,
208  gfn_ru_RU = 21,
209  gfn_sv_SE = 22,
210  gfn_th_TH = 23,
211  gfn_tr_TR = 24,
212  gfn_uk_UA = 25,
213  gfn_zh_CN = 26,
214  gfn_zh_TW = 27,
215  gfn_en_GB = 28,
216  gfn_hr_HR = 29,
217  gfn_sk_SK = 30,
218  gfn_sl_SI = 31,
219  gfn_da_DK = 32,
222 
224  typedef enum GfnRectFormat
225  {
231 
237 
240  } GfnRectFormat;
241 
243  typedef struct GfnRect
244  {
245  float value1;
246  float value2;
247  float value3;
248  float value4;
249  bool normalized;
250  GfnRectFormat format;
251  } GfnRect;
252 
254  typedef struct GfnString
255  {
256  const char* pchString;
257  unsigned int length;
258  } GfnString;
259 
260  typedef struct GfnResolutionInfo
261  {
262  unsigned int verticalPixels;
263  unsigned int horizontalPixels;
265 
266 #ifdef __cplusplus
267  } // extern "C"
268 #endif
269 
270 
271 #endif // GFN_SDK_CAPI_H
Ukrainian (Ukraine)
Definition: GfnSdk.h:212
-
bool normalized
true : coordinates are normalized between 0.0-1.0, false : absolute coordinates
Definition: GfnSdk.h:249
+Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // Common declarations for GFN SDK APIs
32 //
33 // ===============================================================================================
34 
43 #ifndef GFN_SDK_CAPI_H
44 #define GFN_SDK_CAPI_H
45 
46 
47 // Required for streamer / DLL download step in StartStream
48 #ifdef _WIN32
49 # pragma comment(lib, "ws2_32.lib")
50 # pragma comment(lib, "crypt32.lib")
51 # pragma comment(lib, "Wldap32.lib")
52 # pragma comment(lib, "version.lib")
53 # pragma comment(lib, "shlwapi.lib")
54 # pragma comment(lib, "Rpcrt4.lib")
55 # pragma comment(lib, "wintrust")
56 # define GFN_CALLBACK __stdcall
57 # define NVGFNSDK_EXPORT __declspec(dllexport)
58 # define NVGFNSDKApi __cdecl
59 # include <stddef.h>
60 #else
61 // Support to be added in a later release
63 # define GFN_CALLBACK
64 # define NVGFNSDK_EXPORT
66 # define NVGFNSDKApi
68 #endif
69 
70 #ifndef __cplusplus
71 typedef char bool;
74 #define false 0
75 #define true 1
77 #endif
78 
80 #define NVGFNSDK_VERSION_MAJOR 2
81 
83 #define NVGFNSDK_VERSION_MINOR 1
84 
86 #define NVGFNSDK_VERSION_SHORT 2.1
87 
89 #define NVGFNSDK_VERSION_PATCH 0
90 
92 #define NVGFNSDK_VERSION_BUILD 33843515
93 
95 #define NVGFNSDK_VERSION_LONG 2.1.0.33843515
96 
98 #define NVGFNSDK_VERSION_STR "2.1.0.33843515"
99 #define NVGFNSDK_VERSION_STR_PROD "2.1.0"
100 
102 #define NVGFNSDK_VERSION_BUILDCL 33843515
103 #define NVGFNSDK_VERSION_BUILDH 3384
104 #define NVGFNSDK_VERSION_BUILDL 3515
105 
106 
107 #ifdef __cplusplus
108  extern "C"
109  {
110 #endif
111  // ============================================================================================
112  // Constants/Enums
113  // ============================================================================================
114 
116  typedef enum GfnError
117  {
123  gfnComError = -3,
131  gfnTimedOut = -11,
142  gfnCanceled = -22,
144  gfnThrottled = -24,
149  gfnNoData = -29,
152  } GfnError;
153 
165  static inline bool GFNSDK_SUCCEEDED(GfnError code)
166  {
167  return code >= 0;
168  }
169 
181  static inline bool GFNSDK_FAILED(GfnError code)
182  {
183  return code < 0;
184  }
185 
187  typedef enum GfnDisplayLanguage
188  {
190  gfn_bg_BG = 1,
191  gfn_cs_CZ = 2,
192  gfn_nl_NL = 3,
193  gfn_de_DE = 4,
194  gfn_el_GR = 5,
195  gfn_en_US = 6,
196  gfn_en_UK = 7,
197  gfn_es_ES = 8,
198  gfn_es_MX = 9,
199  gfn_fi_FI = 10,
200  gfn_fr_FR = 11,
201  gfn_hu_HU = 12,
202  gfn_it_IT = 13,
203  gfn_ja_JP = 14,
204  gfn_ko_KR = 15,
205  gfn_nb_NO = 16,
206  gfn_po_PO = 17,
207  gfn_pt_BR = 18,
208  gfn_pt_PT = 19,
209  gfn_ro_RO = 20,
210  gfn_ru_RU = 21,
211  gfn_sv_SE = 22,
212  gfn_th_TH = 23,
213  gfn_tr_TR = 24,
214  gfn_uk_UA = 25,
215  gfn_zh_CN = 26,
216  gfn_zh_TW = 27,
217  gfn_en_GB = 28,
218  gfn_hr_HR = 29,
219  gfn_sk_SK = 30,
220  gfn_sl_SI = 31,
221  gfn_da_DK = 32,
224 
226  typedef enum GfnRectFormat
227  {
233 
239 
242  } GfnRectFormat;
243 
245  typedef struct GfnRect
246  {
247  float value1;
248  float value2;
249  float value3;
250  float value4;
251  bool normalized;
252  GfnRectFormat format;
253  } GfnRect;
254 
256  typedef struct GfnString
257  {
258  const char* pchString;
259  unsigned int length;
260  } GfnString;
261 
262  typedef struct GfnResolutionInfo
263  {
264  unsigned int verticalPixels;
265  unsigned int horizontalPixels;
267 
268 #ifdef __cplusplus
269  } // extern "C"
270 #endif
271 
272 
273 #endif // GFN_SDK_CAPI_H
Ukrainian (Ukraine)
Definition: GfnSdk.h:214
+
bool normalized
true : coordinates are normalized between 0.0-1.0, false : absolute coordinates
Definition: GfnSdk.h:251
API call required to be run from an elevated process.
Definition: GfnSdk.h:143
API Call is not supported.
Definition: GfnSdk.h:129
Geforce NOW SDK internal component communication error.
Definition: GfnSdk.h:123
-
Chinese (China)
Definition: GfnSdk.h:213
+
Chinese (China)
Definition: GfnSdk.h:215
SDK initialization failure for any reason other than memory allocation failure.
Definition: GfnSdk.h:121
-
English (Great Britain)
Definition: GfnSdk.h:215
+
English (Great Britain)
Definition: GfnSdk.h:217
GfnError
Returned by InitializeGfnRuntime and GfnRuntime API methods.
Definition: GfnSdk.h:116
-
Croatian (Croatia)
Definition: GfnSdk.h:216
-
German (Germany)
Definition: GfnSdk.h:191
-
GfnRectFormat format
rect format as listed in GfnRectFormat
Definition: GfnSdk.h:250
+
Croatian (Croatia)
Definition: GfnSdk.h:218
+
German (Germany)
Definition: GfnSdk.h:193
+
GfnRectFormat format
rect format as listed in GfnRectFormat
Definition: GfnSdk.h:252
A call to a NVIDIA Web API failed to return valid data.
Definition: GfnSdk.h:135
-
Danish (Denmark)
Definition: GfnSdk.h:219
-
bool GFNSDK_FAILED(GfnError code)
Definition: GfnSdk.h:179
+
Danish (Denmark)
Definition: GfnSdk.h:221
Function limited to specific environment called in wrong environment.
Definition: GfnSdk.h:134
-
Slovenian (Slovenia)
Definition: GfnSdk.h:218
+
Slovenian (Slovenia)
Definition: GfnSdk.h:220
Failed to download the Geforce NOW client.
Definition: GfnSdk.h:133
-
Swedish (Sweden)
Definition: GfnSdk.h:209
-
Chinese (Taiwan)
Definition: GfnSdk.h:214
+
Swedish (Sweden)
Definition: GfnSdk.h:211
+
Chinese (Taiwan)
Definition: GfnSdk.h:216
Success.
Definition: GfnSdk.h:118
-
Norwegian - Bokmål (Norway)
Definition: GfnSdk.h:203
+
Norwegian - Bokmål (Norway)
Definition: GfnSdk.h:205
Necessary GFN cloud-based SDK library cannot be found.
Definition: GfnSdk.h:147
Requested data is empty or doesn&#39;t exist.
Definition: GfnSdk.h:149
-
float value1
value1 as per format
Definition: GfnSdk.h:245
-
GfnDisplayLanguage
Values for languages supported by the GFN SDK, used to define which language any SDK dialogs should b...
Definition: GfnSdk.h:185
+
float value1
value1 as per format
Definition: GfnSdk.h:247
+
GfnDisplayLanguage
Values for languages supported by the GFN SDK, used to define which language any SDK dialogs should b...
Definition: GfnSdk.h:187
Necessary GFN client-based SDK library cannot be found.
Definition: GfnSdk.h:148
-
float value3
value3 as per format
Definition: GfnSdk.h:247
+
float value3
value3 as per format
Definition: GfnSdk.h:249
+
Failed to communicate with the GFN backend service.
Definition: GfnSdk.h:151
+
API Call failed because it was called from unauthorized process.
Definition: GfnSdk.h:150
char bool
Simple aliasing for bool support.
Definition: GfnSdk.h:72
-
GfnRectFormat
Formats to specify a rect with top-left as origin.
Definition: GfnSdk.h:224
-
struct to reference a rect
Definition: GfnSdk.h:243
+
GfnRectFormat
Formats to specify a rect with top-left as origin.
Definition: GfnSdk.h:226
+
struct to reference a rect
Definition: GfnSdk.h:245
Unable to allocate memory.
Definition: GfnSdk.h:126
-
Bulgarian (Bulgaria)
Definition: GfnSdk.h:188
+
Bulgarian (Bulgaria)
Definition: GfnSdk.h:190
Failed to stop active streaming session.
Definition: GfnSdk.h:139
-
Dutch (Netherlands)
Definition: GfnSdk.h:190
+
Dutch (Netherlands)
Definition: GfnSdk.h:192
API not initialized.
Definition: GfnSdk.h:138
-
Romanian (Romania)
Definition: GfnSdk.h:207
+
Romanian (Romania)
Definition: GfnSdk.h:209
SDK initialized, but only cloud independent functionality available (such as gfnStartStream) ...
Definition: GfnSdk.h:119
-
Last Supported Locale (Sentinel Value)
Definition: GfnSdk.h:220
+
Last Supported Locale (Sentinel Value)
Definition: GfnSdk.h:222
DLL is not present.
Definition: GfnSdk.h:122
-
Korean (Korea)
Definition: GfnSdk.h:202
-
Polish (Poland)
Definition: GfnSdk.h:204
-
English (Great Britain)
Definition: GfnSdk.h:194
-
Italian (Italy)
Definition: GfnSdk.h:200
-
bool GFNSDK_SUCCEEDED(GfnError code)
Definition: GfnSdk.h:163
+
Korean (Korea)
Definition: GfnSdk.h:204
+
Polish (Poland)
Definition: GfnSdk.h:206
+
English (Great Britain)
Definition: GfnSdk.h:196
+
Italian (Italy)
Definition: GfnSdk.h:202
Invalid token.
Definition: GfnSdk.h:130
Operation timed out.
Definition: GfnSdk.h:131
Messagebus IPC failures.
Definition: GfnSdk.h:141
-
Uses the default system language.
Definition: GfnSdk.h:187
+
Uses the default system language.
Definition: GfnSdk.h:189
struct GfnString GfnString
struct to reference a string with length data
-
Turkish (Turkey)
Definition: GfnSdk.h:211
-
struct to reference a string with length data
Definition: GfnSdk.h:254
-
Definition: GfnSdk.h:230
-
float value4
value4 as per format
Definition: GfnSdk.h:248
-
Slovak (Slovakia)
Definition: GfnSdk.h:217
+
Turkish (Turkey)
Definition: GfnSdk.h:213
+
struct to reference a string with length data
Definition: GfnSdk.h:256
+
Definition: GfnSdk.h:232
+
float value4
value4 as per format
Definition: GfnSdk.h:250
+
Slovak (Slovakia)
Definition: GfnSdk.h:219
Unhandled exceptions.
Definition: GfnSdk.h:140
Failed to setup title.
Definition: GfnSdk.h:132
-
Greek (Greece)
Definition: GfnSdk.h:192
-
Sentinel value, do not use.
Definition: GfnSdk.h:239
-
Spanish (Mexico)
Definition: GfnSdk.h:196
-
Thai (Thailand)
Definition: GfnSdk.h:210
-
Definition: GfnSdk.h:236
+
Greek (Greece)
Definition: GfnSdk.h:194
+
Sentinel value, do not use.
Definition: GfnSdk.h:241
+
Spanish (Mexico)
Definition: GfnSdk.h:198
+
Thai (Thailand)
Definition: GfnSdk.h:212
+
Definition: GfnSdk.h:238
Library API call not found.
Definition: GfnSdk.h:137
-
Finnish (Finland)
Definition: GfnSdk.h:197
+
Finnish (Finland)
Definition: GfnSdk.h:199
Geforce NOW SDK components were reachable, but could not serve the request.
Definition: GfnSdk.h:124
Generic Geforce NOW SDK internal error.
Definition: GfnSdk.h:128
-
Japanese (Japan)
Definition: GfnSdk.h:201
-
Russian (Russia)
Definition: GfnSdk.h:208
-
Portuguese (Brazil)
Definition: GfnSdk.h:205
-
French (France)
Definition: GfnSdk.h:198
-
Spanish (Spain)
Definition: GfnSdk.h:195
-
Czech (Czech Republic)
Definition: GfnSdk.h:189
-
Hungarian (Hungary)
Definition: GfnSdk.h:199
-
Portuguese (Portugal)
Definition: GfnSdk.h:206
-
English (US)
Definition: GfnSdk.h:193
+
Japanese (Japan)
Definition: GfnSdk.h:203
+
Russian (Russia)
Definition: GfnSdk.h:210
+
Portuguese (Brazil)
Definition: GfnSdk.h:207
+
French (France)
Definition: GfnSdk.h:200
+
Spanish (Spain)
Definition: GfnSdk.h:197
+
Czech (Czech Republic)
Definition: GfnSdk.h:191
+
Hungarian (Hungary)
Definition: GfnSdk.h:201
+
Portuguese (Portugal)
Definition: GfnSdk.h:208
+
English (US)
Definition: GfnSdk.h:195
Activity was canceled, for example, user canceled the download of GFN client.
Definition: GfnSdk.h:142
API call throttled.
Definition: GfnSdk.h:144
GeForceNOW Streamer hit a failure while starting a stream.
Definition: GfnSdk.h:136
-
float value2
value2 as per format
Definition: GfnSdk.h:246
-
Definition: GfnSdk.h:260
+
float value2
value2 as per format
Definition: GfnSdk.h:248
+
Definition: GfnSdk.h:262
Invalid parameter.
Definition: GfnSdk.h:127
An attempt to load a binary failed because the digital signature was found to be invalid.
Definition: GfnSdk.h:146
API call was expecting input param to have a value.
Definition: GfnSdk.h:145
diff --git a/doc/SDK-GFN-RUNTIME/html/annotated.html b/doc/SDK-GFN-RUNTIME/html/annotated.html index 30a31a5..a3d5917 100644 --- a/doc/SDK-GFN-RUNTIME/html/annotated.html +++ b/doc/SDK-GFN-RUNTIME/html/annotated.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/classes.html b/doc/SDK-GFN-RUNTIME/html/classes.html index e9dd8d3..b2ecef7 100644 --- a/doc/SDK-GFN-RUNTIME/html/classes.html +++ b/doc/SDK-GFN-RUNTIME/html/classes.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/ecosystem.png b/doc/SDK-GFN-RUNTIME/html/ecosystem.png deleted file mode 100644 index 39a0359..0000000 Binary files a/doc/SDK-GFN-RUNTIME/html/ecosystem.png and /dev/null differ diff --git a/doc/SDK-GFN-RUNTIME/html/files.html b/doc/SDK-GFN-RUNTIME/html/files.html index 25c2e3e..ed380f8 100644 --- a/doc/SDK-GFN-RUNTIME/html/files.html +++ b/doc/SDK-GFN-RUNTIME/html/files.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/functions.html b/doc/SDK-GFN-RUNTIME/html/functions.html index 2b9bbca..c0db484 100644 --- a/doc/SDK-GFN-RUNTIME/html/functions.html +++ b/doc/SDK-GFN-RUNTIME/html/functions.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/functions_vars.html b/doc/SDK-GFN-RUNTIME/html/functions_vars.html index b766445..5c63895 100644 --- a/doc/SDK-GFN-RUNTIME/html/functions_vars.html +++ b/doc/SDK-GFN-RUNTIME/html/functions_vars.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/globals.html b/doc/SDK-GFN-RUNTIME/html/globals.html index dea8fbd..bf82ee1 100644 --- a/doc/SDK-GFN-RUNTIME/html/globals.html +++ b/doc/SDK-GFN-RUNTIME/html/globals.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/globals_c.html b/doc/SDK-GFN-RUNTIME/html/globals_c.html index cdd9cf8..937fce2 100644 --- a/doc/SDK-GFN-RUNTIME/html/globals_c.html +++ b/doc/SDK-GFN-RUNTIME/html/globals_c.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/globals_defs.html b/doc/SDK-GFN-RUNTIME/html/globals_defs.html index 9247652..7c705a5 100644 --- a/doc/SDK-GFN-RUNTIME/html/globals_defs.html +++ b/doc/SDK-GFN-RUNTIME/html/globals_defs.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/globals_e.html b/doc/SDK-GFN-RUNTIME/html/globals_e.html index 7175c98..e82b0d7 100644 --- a/doc/SDK-GFN-RUNTIME/html/globals_e.html +++ b/doc/SDK-GFN-RUNTIME/html/globals_e.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/globals_enum.html b/doc/SDK-GFN-RUNTIME/html/globals_enum.html index a31eb9c..afa5df5 100644 --- a/doc/SDK-GFN-RUNTIME/html/globals_enum.html +++ b/doc/SDK-GFN-RUNTIME/html/globals_enum.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
diff --git a/doc/SDK-GFN-RUNTIME/html/globals_eval.html b/doc/SDK-GFN-RUNTIME/html/globals_eval.html index a157cb6..b0442f1 100644 --- a/doc/SDK-GFN-RUNTIME/html/globals_eval.html +++ b/doc/SDK-GFN-RUNTIME/html/globals_eval.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
@@ -222,6 +223,9 @@

- g -

diff --git a/doc/SDK-GFN-RUNTIME/html/globals_g.html b/doc/SDK-GFN-RUNTIME/html/globals_g.html index b818770..54d0a6c 100644 --- a/doc/SDK-GFN-RUNTIME/html/globals_g.html +++ b/doc/SDK-GFN-RUNTIME/html/globals_g.html @@ -27,6 +27,7 @@
GeForce NOW SDK +  2.1.0.33843515
@@ -236,6 +237,9 @@

- g -

Description
Register an application function to call when Geforce NOW needs to exit the game.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when Geforce NOW needs to exit the game.
Parameters
@@ -168,6 +170,7 @@

Function Documentation

Description
Register an application callback with Geforce NOW to be called after a successful call to gfnSetupTitle. Typically, the callback would handle any additional installation steps that are necessary after Geforce NOW performs its own setup for a given title.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register a function to call after a successful call to gfnSetupTitle.
Parameters
@@ -213,6 +216,7 @@

Function Documentation

Description
Register an application callback with Geforce NOW to be called when Geforce NOW needs to pause the game on the user's behalf. For Multiplayer games, it is recommended that this is implemented similar to a client disconnect.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when Geforce NOW needs to pause the game.
Parameters
diff --git a/doc/SDK-GFN-RUNTIME/html/group__general.html b/doc/SDK-GFN-RUNTIME/html/group__general.html index 2aae3f3..2641102 100644 --- a/doc/SDK-GFN-RUNTIME/html/group__general.html +++ b/doc/SDK-GFN-RUNTIME/html/group__general.html @@ -27,6 +27,7 @@ @@ -111,6 +112,7 @@

Function Documentation

Description
Should be called at application startup and prior to any other GFN Runtime API methods. The SDK features which become available as a result of initializing the Geforce NOW SDK are dependent on the type of environment in which the SDK operates (client or cloud).
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call as soon as possible during application startup.
Parameters
GeForce NOW SDK +  2.1.0.33843515
@@ -144,6 +146,7 @@

Function Documentation

Description
Releases the SDK, and frees up memory allocated by GFN and disconnects from GFN backend.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call during application shutdown or when GFN Runtime API methods are no longer needed.
diff --git a/doc/SDK-GFN-RUNTIME/html/group__launcher.html b/doc/SDK-GFN-RUNTIME/html/group__launcher.html index 289132f..41863f7 100644 --- a/doc/SDK-GFN-RUNTIME/html/group__launcher.html +++ b/doc/SDK-GFN-RUNTIME/html/group__launcher.html @@ -27,6 +27,7 @@ @@ -159,6 +160,7 @@

Function Documentation

Description
Notifies GFN that an application is ready to be displayed.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to notify GFN that your application is ready to be displayed.
Parameters
GeForce NOW SDK +  2.1.0.33843515
@@ -192,6 +194,7 @@

Function Documentation

Description
Releases memory allocated by Get functions such as, but not limited to, gfnGetPartnerData, gfnGetPartnerSecureData, or gfnGetTitlesAvailable
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to release memory after a call to a memory-allocated function and you are finished with the data. Should only be called if the memory is populated with valid data. Calling gfnFree with invalid pointer or data will result in an memory exception being thrown.
Parameters
@@ -234,6 +237,7 @@

Function Documentation

Description
Gets user’s client country code using ISO 3166-1 Alpha-2 country code.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's country code.
Parameters
@@ -269,6 +273,7 @@

Function Documentation

Description
Gets various information about the local client system and environment
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get various information about the client that launched the streaming session.
Parameters
@@ -304,6 +309,7 @@

Function Documentation

Description
Since applications running under Geforce NOW run in the Geforce NOW data centers, any IP queries made by the Application will return IPs associated with the data center, not the user's external client IP, as seen by Internet queries. This SDK call allows the application to obtain the user's client IP in the IPv4 format so that developers can make regional business decisions for the user based on it versus the region of the data center the user is connected to for game streaming sessions.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's external client IP address.
Parameters
@@ -341,6 +347,7 @@

Function Documentation

Description
Gets user's client language code in the form "<lang>-<country>" using a standard ISO 639-1 language code and ISO 3166-1 Alpha-2 country code.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's language and country settings.
Parameters
@@ -377,10 +384,11 @@

Function Documentation

Description
Retrieves non-secure partner data that is either a) passed by the client in the gfnStartStream call or b) sent using Deep Link parameter.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use during cloud session to retrieve partner data based in during session initialization.
Parameters
- +
ppchPartnerData- Populated with the partner data, if found Call gfnFree to release the memory when done with data
ppchPartnerData- Populated with the partner data in string form if found Call gfnFree to release the memory when done with data
@@ -413,10 +421,11 @@

Function Documentation

Description
Retrieves secure partner data that is either a) passed by the client in the gfnStartStream call or b) sent in response to Deep Link nonce validation.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use during cloud session to retrieve secure partner data
Parameters
- +
ppchPartnerSecureData- Populated with the secure partner data, if found Call gfnFree to release the memory when done.
ppchPartnerSecureData- Populated with the secure partner data in string form if found Call gfnFree to release the memory when done.
@@ -449,6 +458,7 @@

Function Documentation

Description
Gets various information about the current streaming session
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this from a streaming session to find out more information about the session, such as session time remaining, or if RTX is enabled for the current session.
Parameters
@@ -484,6 +494,7 @@

Function Documentation

Description
Retrieves all titles that can be launched in the current game streaming session
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to retrieve a list of all titles available to launch in the current streaming session, for example, to add "Play" buttons to all titles instead of calling gfnIsTitleAvailable on each title.
Parameters
@@ -517,6 +528,7 @@

Function Documentation

Description
Quickly determines if the calling application is running in GFN environment or not with a low security assurance, and without requiring process registration.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Use to quickly determine whether to enable / disable any low-value GFN cloud environment specific application logic, for example, to block any calls to gfnStartStream() to avoid an error, or to know if gfnGetTitlesAvailable can be called without an error.
Warning
This API is meant to fill the need to quickly determine if the call looks to be in the GFN cloud environment. It purposefully trades off resource-intensive checks for fast response. Do not tie any logic or features of value to this API as the call stack could be tampered with. For that purpose, use gfnIsRunningInCloudSecure.
Return values
@@ -544,6 +556,7 @@

Function Documentation

Description
Determines if calling application is running in GFN environment or not, and what degree of security assurance is assigned to the result.
Environment
Cloud and Client
+
Platform
Windows
Usage
Call from an NVIDIA-approved process to securely determine whether running in GFN cloud, and use the GfnIsRunningInCloudAssurance value to decide the risk to enable any application specific logic for that environment.
Warning
This API must be called from a process that has been registered with NVIDIA, or it will return an error. Refer to the Cloud Check API Guide on how to get your application registered. To prevent man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudAssurance to decide if the check was certain enough without tampering to enable the logic or feature associated with the API call.
Parameters
@@ -577,6 +590,7 @@

Function Documentation

Description
Determines if a specific title is available to launch in current streaming session
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to determine if a title is available to be streamed from the active GFN cloud instance, for example, to show a "Play" button in a platform launcher's UI.
Parameters
@@ -619,11 +633,12 @@

Function Documentation

Description
Sends a custom message communication from the app to the client. This message is "fire-and-forget", and does not wait for the message to be delivered to return status. Latency is best effort and not guaranteed.
Environment
Cloud or Client
+
Platform
Windows, Linux
Usage
Use to communicate between cloud applications and streaming clients.
Parameters
- +
pchMessage- Character string
length- Length of pchMessage in characters
length- Length of pchMessage in characters, which cannot exceed 8K in length
@@ -632,8 +647,8 @@

Function Documentation

gfnSuccess- Call was successful gfnComError- There was SDK internal communication error gfnInitFailure- SDK was not initialized - gfnInvalidParameter- Invalid parameters provided - gfnThrottled- API call was throttled for exceeding limit + gfnInvalidParameter- Invalid parameters provided, or message exceeded allowed length + gfnThrottled- API call was throttled for exceeding limit of 30 messages per second gfnUnhandledException- API ran into an unhandled error and caught an exception before it returned to client code gfnCloudLibraryNotFound- GFN SDK cloud-side library could not be found @@ -674,6 +689,7 @@

Function Documentation

Description
Defines active zone coordinates for GFN to interact with.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to invoke special events on the client from the GFN cloud environment
Parameters
@@ -714,6 +730,7 @@

Function Documentation

Description
Notifies Geforce NOW that an application should be readied for launch. Geforce NOW will make the build files associated with the application available at the path returned in the SetupTitleResult struct passed in to the ConfirmTitleSetup callback provided by the caller. Additionally, Geforce NOW will set all necessary settings to optimize for the Geforce NOW cloud environment, and download any associated user data, including save files.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to prepare an application for launch on Geforce NOW, and block on the result.
Parameters
@@ -759,6 +776,7 @@

Function Documentation

Description
Requests GFN client to start a streamed session of an application in a synchronous (blocking) fashion.
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -818,6 +836,7 @@

Function Documentation

Description
Requests GFN client to start a streamed session of an application in an asynchronous fashion
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -846,6 +865,7 @@

Function Documentation

Description
Requests GFN client to stop the active streaming session of an application in a synchronous (blocking) fashion.
Environment
Client
+
Platform
Windows
Usage
Use to request the streaming session be stopped
Return values
@@ -891,6 +911,7 @@

Function Documentation

Description
Requests GFN client to stop the active streaming session of an application in aynchronous fashion.
Environment
Client
+
Platform
Windows
Usage
Use to request the streaming session be stopped
Parameters
@@ -928,6 +949,7 @@

Function Documentation

Description
Notifies GFN that an application has exited. GFN will then start the shutdown process for that application. Note that this is for use by platform clients only and assumes the application has already completed execution. To shutdown from within an application itself, gfnShutdownRuntimeSDK is used.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to notify GFN that your application has exited.
Parameters
diff --git a/doc/SDK-GFN-RUNTIME/html/group__wrapper.html b/doc/SDK-GFN-RUNTIME/html/group__wrapper.html index 066ef19..606cc7f 100644 --- a/doc/SDK-GFN-RUNTIME/html/group__wrapper.html +++ b/doc/SDK-GFN-RUNTIME/html/group__wrapper.html @@ -27,6 +27,7 @@ @@ -192,6 +193,7 @@

Function Documentation

Description
Calls GfnAppReady to notify GFN that an application is ready to be displayed.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to notify GFN that your application is ready to be streamed.
Parameters
GeForce NOW SDK +  2.1.0.33843515
@@ -227,6 +229,7 @@

Function Documentation

Description
Calls gfnFree to free memory allocated by gfnGetTitlesAvailable
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to release memory after a call to a memory-allocated function and you are finished with the data. Should only be called if the memory is populated with valid data. Calling GfnFree with invalid pointer or data will result in an memory exception being thrown.
Parameters
@@ -269,6 +272,7 @@

Function Documentation

Description
Gets user's client country code using ISO 3166-1 Alpha-2 country code.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's country code.
Parameters
@@ -305,6 +309,7 @@

Function Documentation

Description
Gets user's client data.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the data on the user's client.
Parameters
@@ -341,6 +346,7 @@

Function Documentation

Description
Calls gfnGetClientIp to get user client's IP address.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's external client IP address.
Parameters
@@ -378,6 +384,7 @@

Function Documentation

Description
Calls gfnGetClientLanguageCode to gets user's client language code in the form "<lang>-<country>" using a standard ISO 639-1 language code and ISO 3166-1 Alpha-2 country code.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's language and country settings.
Parameters
@@ -415,10 +422,11 @@

Function Documentation

Description
Calls GfnGetPartnerData to retrieves non-secure partner data that is either a) passed by the client in the gfnStartStream call or b) sent using Deep Link parameter.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use during cloud session to retrieve partner data
Parameters
- +
partnerData- Populated with the partner data, if found. Call GfnFree to free the memory.
partnerData- Populated with the partner data in string form if found Call GfnFree to free the memory
@@ -452,10 +460,11 @@

Function Documentation

Description
Calls GfnGetPartnerSecureData to retrieves secure partner data that is either a) passed by the client in the gfnStartStream call or b) sent in response to Deep Link nonce validation.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use during cloud session to retrieve secure partner data
Parameters
- +
partnerSecureData- Populated with the secure partner data, if found. Call GfnFree to free the memory.
partnerSecureData- Populated with the secure partner data in string for if found Call GfnFree to free the memory
@@ -489,6 +498,7 @@

Function Documentation

Description
Gets various information about the current streaming session
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this from a streaming session to find out more information about the session, such as session time remaining, or if RTX is enabled for the current session.
Parameters
@@ -524,6 +534,7 @@

Function Documentation

Description
Calls gfnGetTitlesAvailable to retrieves all titles that can be launched in the current game streaming session.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to retrieve a list of all titles available to launch in the current streaming session, for example, to add "Play" buttons to all titles instead of calling gfnIsTitleAvailable on each title.
Parameters
@@ -560,6 +571,7 @@

Function Documentation

Description
Loads the GFN SDK dynamic library and calls gfnInitializeRuntimeSdk. By default, the function expects the library to be in the same folder as the loading process's executable. For security reasons, the dynamic library is loaded by fully-quanitified path. If the GFN SDK library is packaged in another folder, you will need to locally modify the function to reference that location.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call as soon as possible during application startup.
Parameters
@@ -603,13 +615,14 @@

Function Documentation

-
Description
Loads the GFN SDK dynamic library from the given path and calls gfnInitializeRuntimeSdk.
+
Description
Loads the GFN SDK dynamic library from the given path and calls gfnInitializeRuntimeSdk. (UTF-8 / ASCII version)
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call as soon as possible during application startup.
Parameters
- +
language- Language to use for any UI, such as GFN download and install progress dialogs. Defaults to system language if not defined.
sdkLibraryPath- Fully-quantified path to GFN SDK Library including the name GfnRuntimeSdk.dll, note that dll cannot be renamed to any other string.
sdkLibraryPath- Fully-quantified path to GFN SDK library file including the library filename, note that for security reasons, library cannot be renamed to any other string.
@@ -649,13 +662,14 @@

Function Documentation

-
Description
Loads the GFN SDK dynamic library from the given path and calls gfnInitializeRuntimeSdk.
+
Description
Loads the GFN SDK dynamic library from the given path and calls gfnInitializeRuntimeSdk. (Wide char version)
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call as soon as possible during application startup.
Parameters
- +
language- Language to use for any UI, such as GFN download and install progress dialogs. Defaults to system language if not defined.
wSdkLibraryPath- Wide Char string with Fully-quantified path to GFN SDK Library including the name GfnRuntimeSdk.dll, note that dll cannot be renamed to any other string.
wSdkLibraryPath- Wide Char string with fully-quantified path to GFN SDK library file including the library filename, note that for security reasons, library cannot be renamed to any other string.
@@ -687,6 +701,7 @@

Function Documentation

Description
Calls gfnIsRunningInCloud to determine if calling application is running in GFN environment, and without requiring process registration.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Use to quickly determine whether to enable / disable any low-value GFN cloud environment specific application logic, for example, to block any calls to GfnStartStream() to avoid an error, or to know if GetTitlesAvailable can be called without an error.
Warning
This API is meant to fill the need to quickly determine if the call looks to be in the GFN cloud environment. It purposefully trades off resource-intensive checks for fast response. Do not tie any logic or features of value to this API as the call stack could be tampered with. For that purpose, use GfnIsRunningInCloudSecure.
Parameters
@@ -723,6 +738,7 @@

Function Documentation

Description
Calls gfnIsRunningInCloudSecure to determine if calling application is running in GFN environment, and what level of security assurance that the result is valid.
Environment
Cloud and Client
+
Platform
Windows
Usage
Call from an NVIDIA-approved process to securely determine whether running in GFN cloud, and use the GfnIsRunningInCloudAssurance value to decide the risk to enable any application specific logic for that environment.
Warning
This API must be called from a process that has been registered with NVIDIA, or it will return an error. Refer to the Cloud Check API Guide on how to get your application registered. To prevent man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudAssurance to decide if the check was certain enough without tampering to enable the logic or feature associated with the API call.
Parameters
@@ -768,6 +784,7 @@

Function Documentation

Description
Calls gfnIsTitleAvailable to determines if a specific title is available to launch in current streaming session.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to determine if a title is available to be launched from the active GFN cloud instance, for example, to show a "Play" button in a platform launcher's UI.
Parameters
@@ -814,6 +831,7 @@

Function Documentation

Description
Registers an application callback with GFN to be called when client info changes
Environment
Cloud
+
Platform
Windows, Linux
Parameters
@@ -856,6 +874,7 @@

Function Documentation

Description
Calls gfnRegisterExitCallback to register an application function to call when Geforce NOW needs to exit the game.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when Geforce NOW needs to exit the game.
Parameters
clientInfoCallback- Function pointer to application code to call when GFN client data changes
@@ -902,6 +921,7 @@

Function Documentation

Description
Calls gfnRegisterInstallCallback to register an application callback with Geforce NOW to be called after a successful call to gfnSetupTitle.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register a function to call after a successful call to gfnSetupTitle.
Parameters
@@ -948,6 +968,7 @@

Function Documentation

Description
Calls gfnRegisterMessageCallback to register an application callback to be called when a message has been sent to the application.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Provide a callback function that will be called when a message is sent to the application.
Parameters
@@ -1000,6 +1021,7 @@

Function Documentation

Description
Registers an application callback with GFN to be called when network latency changes
Environment
Cloud
+
Platform
Windows, Linux
Parameters
@@ -1044,6 +1066,7 @@

Function Documentation

Description
Calls gfnRegisterPauseCallback to register an application callback with Geforce NOW to be called when Geforce NOW needs to pause the game on the user's behalf.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when Geforce NOW needs to pause the game.
Parameters
networkStatusCallback- Function pointer to application code to call when network latency changes
@@ -1090,6 +1113,7 @@

Function Documentation

Description
Calls gfnRegisterSaveCallback to register an application callback with GFN to be called when GFN needs the application to save user progress.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when GFN needs the application to save
Parameters
@@ -1134,6 +1158,7 @@

Function Documentation

Description
Calls gfnRegisterSessionInitCallback to register an application callback to be called when a GFN user has connected to the game seat.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when a GFN user has connected to the game seat
Parameters
@@ -1180,6 +1205,7 @@

Function Documentation

Description
Calls gfnRegisterStreamStatusCallback to register a callback that gets called on the user's PC when the streaming session state changes.
Environment
Client
+
Platform
Windows
Usage
Register a function to call when stream status changes on the user's client PC
Parameters
@@ -1225,11 +1251,12 @@

Function Documentation

Description
Sends a custom message communication from the app to the client. This message is "fire-and-forget", and does not wait for the message to be delivered to return status. Latency is best effort and not guaranteed.
Environment
Cloud or Client
+
Platform
Windows, Linux
Usage
Use to communicate between cloud applications and streaming clients.
Parameters
- +
pchMessage- Character string
length- Length of pchMessage in characters
length- Length of pchMessage in characters, which cannot exceed 8K in length
@@ -1238,8 +1265,8 @@

Function Documentation

gfnSuccess- Call was successful gfnComError- There was SDK internal communication error gfnInitFailure- SDK was not initialized - gfnInvalidParameter- Invalid parameters provided - gfnThrottled- API call was throttled for exceeding limit + gfnInvalidParameter- Invalid parameters provided, or message exceeded allowed length + gfnThrottled- API call was throttled for exceeding limit of 30 messages per second gfnUnhandledException- API ran into an unhandled error and caught an exception before it returned to client code gfnCloudLibraryNotFound- GFN SDK cloud-side library could not be found @@ -1281,6 +1308,7 @@

Function Documentation

Description
Sends Active zone coordinates to GFN Client

TO BE DEPRECATED SOON

Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to invoke special events on the client from the GFN cloud environment Note : Marked for deprecation
Parameters
@@ -1322,6 +1350,7 @@

Function Documentation

Description
Calls gfnSetupTitle to notify Geforce NOW that an application should be readied for launch.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to prepare an application for launch on Geforce NOW, and block on the result.
Parameters
@@ -1358,6 +1387,7 @@

Function Documentation

Description
Calls gfnShutdownRuntimeSdk to releases the SDK and resources and disconnects from GFN backend and then unloads unloads the GFN SDK Library.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call during application shutdown or when GFN Runtime API methods are no longer needed.
Return values
@@ -1394,6 +1424,7 @@

Function Documentation

Description
Calls gfnStartStream to request GFN client to start a streaming session of an application in a synchronous (blocking) fashion.
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -1453,6 +1484,7 @@

Function Documentation

Description
Calls gfnStartStreamAsync to request GFN client to start a streaming session of an application in an asynchronous fashion.
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -1492,6 +1524,7 @@

Function Documentation

Description
Calls gfnStopStream to request GFN client to stop a streaming session of an application in a synchronous (blocking) fashion.
Environment
Client
+
Platform
Windows
Usage
Use to stop a streaming session started by the same process
Return values
@@ -1537,6 +1570,7 @@

Function Documentation

Description
Calls gfnStopStreamAsync to request GFN client to stop a streaming session of an application in an asynchronous fashion.
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -1586,6 +1620,7 @@

Function Documentation

Description
Calls GfnTitleExited to notify GFN that an application has exited.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to notify GFN that your application has exited.
Parameters
diff --git a/doc/SDK-GFN-RUNTIME/html/index.html b/doc/SDK-GFN-RUNTIME/html/index.html index fd4b90e..542d056 100644 --- a/doc/SDK-GFN-RUNTIME/html/index.html +++ b/doc/SDK-GFN-RUNTIME/html/index.html @@ -6,7 +6,7 @@ -GfnSdkDevelopment: Native Runtime API Reference +GfnSdkDevelopment: Native Runtime Application Programming Interface Reference @@ -27,6 +27,7 @@ @@ -80,33 +81,23 @@
-
Native Runtime API Reference
+
Native Runtime Application Programming Interface Reference

Introduction

-

The NVIDIA GFN Runtime SDK provides a set of interfaces to allow game developers and game publishers to interact with parts of the NVIDIA GeForce NOW ecosystem. Integration is provided by various means, from native C interfaces to RESTful Web API calls, depending on the feature of the SDK.

-
-ecosystem.png -
-

This document provides details of how to integrate the native APIs of GFN Runtime SDK features into your application and its developer and deployment processes.

+

The NVIDIA GFN Runtime SDK provides an Application Programming Interface (API) to allow game and application developers to interact with parts of the NVIDIA GeForce NOW ecosystem. Overall integration is provided by various interfaces, from the native C interfaces described in this documentation, to RESTful endpoint calls, depending on the feature of the SDK.

+

This documenation focuses solely on the native C interfaces, and provides the specifications of each of the native APIs of GFN Runtime SDK, as well as the requires to use the APIs. For example usage, refer to the Quick Start documentation and the sample applications provided in the ./samples folder.

Overview

-

The GFN Runtime SDK provides a dynamic library with API exports as defined in this document, which is distributed with and loaded by the game/application that utilizes the APIs. The loading of this library should be done in a way that validates the authenticity of the binary via checking for a valid digital signature, and that signature is from NVIDIA Corporation.

-

The behavior of the APIs depends on the environment the application is running in; either on a client/user system or in the GeForce NOW (GFN) cloud environment. Each API defines which of the environments it is designed to run in.

-

On client systems, this library checks for the presence of the GeForce NOW (GFN) client installation when any of the gfnStartStream API variants is called. If the client is not present, then the library will initiate a download and installation of the latest GFN client, presenting UI to the user for the download and installation process. If the GFN client is present, but out of date, then a similar download and install process to update the client will take place before the streaming session will start.

-

Once the GFN client is installed, all API actions are deferred to the GFN client. This design allows the dynamic library to stay as thin as possible in the application, and provides backward and forward compatibility to new GFN client packages.

-

Many of the APIs are no-ops depending on the environment they apply to only to either local client or GFN cloud environments. In those cases, API calls will return a well-defined error code to denote the call was not applicable to the environment.

-

Some of the APIs are used solely for authentication purposes in Account Linking and Single Sign-On scenarios. For more information about NVIDIA's Account Linking and Single Sign-On model, please refer to the SDK-GFN-ACCOUNT-LINKING-SSO-GUIDE.pdf document in the /doc folder.

-

For additional high-level overview, please refer to the SDK primer available as part of the documentation section of the SDK's repository.

+

The GFN Runtime SDK provides a dynamic library with API exports as defined in this document, which is distributed with and loaded by the game/application that utilizes the APIs. The loading of this library should be done in a way that validates the authenticity of the binary. For example, on Windows, checking for a valid digital signature, and that signature is from NVIDIA Corporation.

+

The behavior of the APIs depends on the environment the application is running in; either on a client/user system or in the GeForce NOW (GFN) cloud environment. Each API defines which of the environments it is designed to run in. Some of the APIs can execute in only one of the environments; either the local client or GFN cloud environment. These APIs will return a well-defined error code "gfnCallWrongEnvironment" to denote when call was not applicable to the execution environment.

+

For additional high-level overview, please refer to the SDK primer available as part of the documentation section of the SDK's repository. For references on correct API calls for the most common of integration scenarios, please prefer to the SDK Quick Start Guide.

Key Concepts

GFN Runtime API methods are used to make requests from or to notify the GFN backend.

When your application is operating outside of the GFN environment, these methods are simple stubs that incur almost no cost, so it's safe to add these to your main build.

The calling convention differs by which API you've selected to use. In most cases, the methods return a GfnRuntimeError result, which can be used by the application to check for errors. In addition, some methods are asynchronous by nature, but provide synchronous variants when possible.

-
-sequence.png -

API Reference

@@ -120,6 +111,7 @@

GeForce NOW SDK +  2.1.0.33843515
Description
Should be called at application startup and prior to any other GFN Runtime API methods. The SDK features which become available as a result of initializing the Geforce NOW SDK are dependent on the type of environment in which the SDK operates (client or cloud).
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call as soon as possible during application startup.
Parameters
@@ -144,6 +136,7 @@

Description
Releases the SDK, and frees up memory allocated by GFN and disconnects from GFN backend.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call during application shutdown or when GFN Runtime API methods are no longer needed.

Launcher or Game Specific Methods

@@ -156,6 +149,7 @@

Description
Quickly determines if the calling application is running in GFN environment or not with a low security assurance, and without requiring process registration.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Use to quickly determine whether to enable / disable any low-value GFN cloud environment specific application logic, for example, to block any calls to gfnStartStream() to avoid an error, or to know if gfnGetTitlesAvailable can be called without an error.
Warning
This API is meant to fill the need to quickly determine if the call looks to be in the GFN cloud environment. It purposefully trades off resource-intensive checks for fast response. Do not tie any logic or features of value to this API as the call stack could be tampered with. For that purpose, use gfnIsRunningInCloudSecure.
Return values
@@ -173,6 +167,7 @@

Description
Determines if calling application is running in GFN environment or not, and what degree of security assurance is assigned to the result.
Environment
Cloud and Client
+
Platform
Windows
Usage
Call from an NVIDIA-approved process to securely determine whether running in GFN cloud, and use the GfnIsRunningInCloudAssurance value to decide the risk to enable any application specific logic for that environment.
Warning
This API must be called from a process that has been registered with NVIDIA, or it will return an error. Refer to the Cloud Check API Guide on how to get your application registered. To prevent man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudAssurance to decide if the check was certain enough without tampering to enable the logic or feature associated with the API call.
Parameters
@@ -196,6 +191,7 @@

Description
Releases memory allocated by Get functions such as, but not limited to, gfnGetPartnerData, gfnGetPartnerSecureData, or gfnGetTitlesAvailable
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to release memory after a call to a memory-allocated function and you are finished with the data. Should only be called if the memory is populated with valid data. Calling gfnFree with invalid pointer or data will result in an memory exception being thrown.
Parameters
@@ -218,6 +214,7 @@

Description
Determines if a specific title is available to launch in current streaming session
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to determine if a title is available to be streamed from the active GFN cloud instance, for example, to show a "Play" button in a platform launcher's UI.
Parameters
@@ -240,6 +237,7 @@

Description
Retrieves all titles that can be launched in the current game streaming session
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to retrieve a list of all titles available to launch in the current streaming session, for example, to add "Play" buttons to all titles instead of calling gfnIsTitleAvailable on each title.
Parameters
@@ -264,6 +262,7 @@

Description
Notifies Geforce NOW that an application should be readied for launch. Geforce NOW will make the build files associated with the application available at the path returned in the SetupTitleResult struct passed in to the ConfirmTitleSetup callback provided by the caller. Additionally, Geforce NOW will set all necessary settings to optimize for the Geforce NOW cloud environment, and download any associated user data, including save files.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to prepare an application for launch on Geforce NOW, and block on the result.
Parameters
@@ -289,6 +288,7 @@

Description
Notifies GFN that an application has exited. GFN will then start the shutdown process for that application. Note that this is for use by platform clients only and assumes the application has already completed execution. To shutdown from within an application itself, gfnShutdownRuntimeSDK is used.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to notify GFN that your application has exited.
Parameters
@@ -314,6 +314,7 @@

Description
Since applications running under Geforce NOW run in the Geforce NOW data centers, any IP queries made by the Application will return IPs associated with the data center, not the user's external client IP, as seen by Internet queries. This SDK call allows the application to obtain the user's client IP in the IPv4 format so that developers can make regional business decisions for the user based on it versus the region of the data center the user is connected to for game streaming sessions.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's external client IP address.
Parameters
@@ -341,6 +342,7 @@

Description
Gets user's client language code in the form "<lang>-<country>" using a standard ISO 639-1 language code and ISO 3166-1 Alpha-2 country code.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's language and country settings.
Parameters
@@ -367,6 +369,7 @@

Description
Gets user’s client country code using ISO 3166-1 Alpha-2 country code.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's country code.
Parameters
@@ -392,6 +395,7 @@

Description
Gets various information about the local client system and environment
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get various information about the client that launched the streaming session.
Parameters
@@ -417,6 +421,7 @@

Description
Gets various information about the current streaming session
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this from a streaming session to find out more information about the session, such as session time remaining, or if RTX is enabled for the current session.
Parameters
@@ -442,6 +447,7 @@

Description
Requests GFN client to start a streamed session of an application in a synchronous (blocking) fashion.
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -469,6 +475,7 @@

Description
Requests GFN client to start a streamed session of an application in an asynchronous fashion
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -487,6 +494,7 @@

Description
Requests GFN client to stop the active streaming session of an application in a synchronous (blocking) fashion.
Environment
Client
+
Platform
Windows
Usage
Use to request the streaming session be stopped
Return values
@@ -506,6 +514,7 @@

Description
Requests GFN client to stop the active streaming session of an application in aynchronous fashion.
Environment
Client
+
Platform
Windows
Usage
Use to request the streaming session be stopped
Parameters
@@ -523,10 +532,11 @@

Description
Retrieves non-secure partner data that is either a) passed by the client in the gfnStartStream call or b) sent using Deep Link parameter.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use during cloud session to retrieve partner data based in during session initialization.
Parameters
- +
ppchPartnerData- Populated with the partner data, if found Call gfnFree to release the memory when done with data
ppchPartnerData- Populated with the partner data in string form if found Call gfnFree to release the memory when done with data
@@ -549,10 +559,11 @@

Description
Retrieves secure partner data that is either a) passed by the client in the gfnStartStream call or b) sent in response to Deep Link nonce validation.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use during cloud session to retrieve secure partner data
Parameters
- +
ppchPartnerSecureData- Populated with the secure partner data, if found Call gfnFree to release the memory when done.
ppchPartnerSecureData- Populated with the secure partner data in string form if found Call gfnFree to release the memory when done.
@@ -575,6 +586,7 @@

Description
Notifies GFN that an application is ready to be displayed.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to notify GFN that your application is ready to be displayed.
Parameters
@@ -598,6 +610,7 @@

Description
Defines active zone coordinates for GFN to interact with.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to invoke special events on the client from the GFN cloud environment
Parameters
@@ -628,11 +641,12 @@

Description
Sends a custom message communication from the app to the client. This message is "fire-and-forget", and does not wait for the message to be delivered to return status. Latency is best effort and not guaranteed.
Environment
Cloud or Client
+
Platform
Windows, Linux
Usage
Use to communicate between cloud applications and streaming clients.
Parameters
- +
pchMessage- Character string
length- Length of pchMessage in characters
length- Length of pchMessage in characters, which cannot exceed 8K in length
@@ -641,8 +655,8 @@

gfnSuccess- Call was successful gfnComError- There was SDK internal communication error gfnInitFailure- SDK was not initialized - gfnInvalidParameter- Invalid parameters provided - gfnThrottled- API call was throttled for exceeding limit + gfnInvalidParameter- Invalid parameters provided, or message exceeded allowed length + gfnThrottled- API call was throttled for exceeding limit of 30 messages per second gfnUnhandledException- API ran into an unhandled error and caught an exception before it returned to client code gfnCloudLibraryNotFound- GFN SDK cloud-side library could not be found @@ -660,6 +674,7 @@

Description
Register an application function to call when Geforce NOW needs to exit the game.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when Geforce NOW needs to exit the game.
Parameters
@@ -685,6 +700,7 @@

Description
Register an application callback with Geforce NOW to be called when Geforce NOW needs to pause the game on the user's behalf. For Multiplayer games, it is recommended that this is implemented similar to a client disconnect.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when Geforce NOW needs to pause the game.
Parameters
@@ -710,6 +726,7 @@

Description
Register an application callback with Geforce NOW to be called after a successful call to gfnSetupTitle. Typically, the callback would handle any additional installation steps that are necessary after Geforce NOW performs its own setup for a given title.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register a function to call after a successful call to gfnSetupTitle.
Parameters
@@ -735,6 +752,7 @@

Description
Register a callback that gets called on the user's PC when the streaming session state changes
Environment
Client
+
Platform
Windows
Usage
Register a function to call when stream status changes on the user's client PC
Parameters
@@ -757,6 +775,8 @@

C gfnRegisterSessionInitCallback
Description
Register an application callback with GFN to be called when a GFN user has connected to the game seat
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when a GFN user has connected to the game seat
Parameters
@@ -781,7 +801,9 @@

C gfnRegisterClientInfoCallback
-
Description
Register an application callback with GFN to be called when certain client info that is part of GetClientInfo API changes
+
Description
Register an application callback with GFN to be called when certain client info that is part of gfnGetClientInfo API changes
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when a the client information from the GFN user's client system has changed
Parameters
@@ -807,6 +829,8 @@

C gfnRegisterNetworkStatusCallback
Description
Register an application callback with GFN to be called when client latency changes
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when a the network latency from the GFN user's client system has changed
Parameters
@@ -833,6 +857,8 @@

C gfnRegisterMessageCallback
Description
Register an application callback with GFN to be called when a message is sent to the application.
+
Environment
Cloud
+
Platform
Windows, Linux
Usage
Provide a callback function that will be called when a message is sent to the application.
Parameters
diff --git a/doc/SDK-GFN-RUNTIME/html/modules.html b/doc/SDK-GFN-RUNTIME/html/modules.html index 226e5bb..da8b086 100644 --- a/doc/SDK-GFN-RUNTIME/html/modules.html +++ b/doc/SDK-GFN-RUNTIME/html/modules.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/pages.html b/doc/SDK-GFN-RUNTIME/html/pages.html index 47f9295..217e6c9 100644 --- a/doc/SDK-GFN-RUNTIME/html/pages.html +++ b/doc/SDK-GFN-RUNTIME/html/pages.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/search/all_6.js b/doc/SDK-GFN-RUNTIME/html/search/all_6.js index 42480c9..7faf358 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/all_6.js +++ b/doc/SDK-GFN-RUNTIME/html/search/all_6.js @@ -41,6 +41,7 @@ var searchData= ['gfnapinotinit',['gfnAPINotInit',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a8071b5184e59885268728c7d992edb1d',1,'GfnSdk.h']]], ['gfnapplicationcallbackresult',['GfnApplicationCallbackResult',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a9c7df068710138e6a6f0162f758ff38d',1,'GfnApplicationCallbackResult(): GfnRuntimeSdk_CAPI.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a91feb8287f6e3e0aba89b529f328e42e',1,'GfnApplicationCallbackResult(): GfnRuntimeSdk_CAPI.h']]], ['gfnappready',['gfnAppReady',['../group__launcher.html#ga2fa481d6d0cd9218425d0dbc3175b68e',1,'gfnAppReady(bool success, const char *status): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga6095bb54551cc3f04ff74c362640f8a6',1,'GfnAppReady(bool success, const char *status): GfnRuntimeSdk_Wrapper.h']]], + ['gfnbackenderror',['gfnBackendError',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a3e136c2b7efaac8431aa967400a3afaf',1,'GfnSdk.h']]], ['gfnbinarysignatureinvalid',['gfnBinarySignatureInvalid',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a235a35603640ea7bc2915d312c4df566',1,'GfnSdk.h']]], ['gfncallwrongenvironment',['gfnCallWrongEnvironment',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a5563ddcd4cd759b0692958f764aaa1c2',1,'GfnSdk.h']]], ['gfncanceled',['gfnCanceled',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a554c41262ba51ec6c82377979597d49c',1,'GfnSdk.h']]], @@ -68,8 +69,8 @@ var searchData= ['gfngetclientlanguagecode',['gfnGetClientLanguageCode',['../group__launcher.html#ga95ddfe6fabeec68eb40b2ffa28d604ec',1,'gfnGetClientLanguageCode(const char **ppchLanguageCode): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga20ea89be27f64ca0a15c397b112541d3',1,'GfnGetClientLanguageCode(const char **languageCode): GfnRuntimeSdk_Wrapper.h']]], ['gfngetpartnerdata',['gfnGetPartnerData',['../group__launcher.html#ga16c67cdee702190faf8b8682f760a339',1,'gfnGetPartnerData(const char **ppchPartnerData): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga9223905a2b1279a175f9b5bdbc40838c',1,'GfnGetPartnerData(const char **partnerData): GfnRuntimeSdk_Wrapper.h']]], ['gfngetpartnersecuredata',['gfnGetPartnerSecureData',['../group__launcher.html#gaeddedbabbd2d5da5d525bb737b26c820',1,'gfnGetPartnerSecureData(const char **ppchPartnerSecureData): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gab4760d499a669358847649c9dc44a433',1,'GfnGetPartnerSecureData(const char **partnerSecureData): GfnRuntimeSdk_Wrapper.h']]], - ['gfngetsessioninfo',['gfnGetSessionInfo',['../group__launcher.html#ga1f994c00e0579443e6cc920dd4a1c853',1,'gfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga2bbf214d68c42487b1e33f789e87330d',1,'GfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_Wrapper.h']]], - ['gfngettitlesavailable',['gfnGetTitlesAvailable',['../group__launcher.html#ga70ea27f47639201d48de5d3006b20481',1,'gfnGetTitlesAvailable(const char **ppchPlatformAppIds): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gad21b46157207c9083f490cea77a4dea1',1,'GfnGetTitlesAvailable(const char **platformAppIds): GfnRuntimeSdk_Wrapper.h']]], + ['gfngetsessioninfo',['GfnGetSessionInfo',['../group__wrapper.html#ga2bbf214d68c42487b1e33f789e87330d',1,'GfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga1f994c00e0579443e6cc920dd4a1c853',1,'gfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_CAPI.h']]], + ['gfngettitlesavailable',['GfnGetTitlesAvailable',['../group__wrapper.html#gad21b46157207c9083f490cea77a4dea1',1,'GfnGetTitlesAvailable(const char **platformAppIds): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga70ea27f47639201d48de5d3006b20481',1,'gfnGetTitlesAvailable(const char **ppchPlatformAppIds): GfnRuntimeSdk_CAPI.h']]], ['gfnincompatibleversion',['gfnIncompatibleVersion',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2afc7165ab43d69218077fe7cd65c746f6',1,'GfnSdk.h']]], ['gfninitfailure',['gfnInitFailure',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2acebae70b0a5038b2d8c4053ef7e686fb',1,'GfnSdk.h']]], ['gfninitializeruntimesdk',['gfnInitializeRuntimeSdk',['../group__general.html#gae75c579a109c1f89162e858d1a479d79',1,'GfnRuntimeSdk_CAPI.h']]], @@ -91,13 +92,14 @@ var searchData= ['gfnisrunningincloud',['gfnIsRunningInCloud',['../group__launcher.html#ga3b33985a46d6bd20fdea2c4865dc6a0f',1,'gfnIsRunningInCloud(): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gaa109bc7e726c5991c2efcbce8e4c0f64',1,'GfnIsRunningInCloud(bool *runningInCloud): GfnRuntimeSdk_Wrapper.h']]], ['gfnisrunningincloudassurance',['GfnIsRunningInCloudAssurance',['../_gfn_runtime_sdk___c_a_p_i_8h.html#aecdb9af8ee15731faeebae2fcec76c7b',1,'GfnIsRunningInCloudAssurance(): GfnRuntimeSdk_CAPI.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a1fa5e44e6ea4087ad75c7fd0ebf7bfa7',1,'GfnIsRunningInCloudAssurance(): GfnRuntimeSdk_CAPI.h']]], ['gfnisrunningincloudsecure',['GfnIsRunningInCloudSecure',['../group__wrapper.html#ga6fa2dbe2bfa3e67cd41963bf28ac5e65',1,'GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaf5ab33bd8cd24cb26cda5bacf1764e3f',1,'gfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance): GfnRuntimeSdk_CAPI.h']]], - ['gfnistitleavailable',['GfnIsTitleAvailable',['../group__wrapper.html#gad9c160b9ea4921de4ca57d48ede5c9be',1,'GfnIsTitleAvailable(const char *platformAppId, bool *isAvailable): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaa8b07a70503f2a24b6625fc5a7eef9cb',1,'gfnIsTitleAvailable(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]], + ['gfnistitleavailable',['gfnIsTitleAvailable',['../group__launcher.html#gaa8b07a70503f2a24b6625fc5a7eef9cb',1,'gfnIsTitleAvailable(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gad9c160b9ea4921de4ca57d48ede5c9be',1,'GfnIsTitleAvailable(const char *platformAppId, bool *isAvailable): GfnRuntimeSdk_Wrapper.h']]], ['gfnlibrarycallfailure',['gfnLibraryCallFailure',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a52aa72e162efa6a6cff2042b1b08976f',1,'GfnSdk.h']]], ['gfnmaxlanguage',['gfnMaxLanguage',['../_gfn_sdk_8h.html#ab6a79fd15fb8eb5f3293444e8572acf2ab101384c92e88db62254ddd28f1f51aa',1,'GfnSdk.h']]], ['gfnnetworkstatuschangetype',['GfnNetworkStatusChangeType',['../_gfn_runtime_sdk___c_a_p_i_8h.html#acbccf3a0f3e54bd32d09f6d09df4bc04',1,'GfnNetworkStatusChangeType(): GfnRuntimeSdk_CAPI.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a8e803ab632f4aaf0907aad0d0b6ad1a2',1,'GfnNetworkStatusChangeType(): GfnRuntimeSdk_CAPI.h']]], ['gfnnetworkstatuschangetypemax',['gfnNetworkStatusChangeTypeMax',['../_gfn_runtime_sdk___c_a_p_i_8h.html#acbccf3a0f3e54bd32d09f6d09df4bc04af7e242565cb45a381e1fa1f704ba476a',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnnetworkstatusupdatedata',['GfnNetworkStatusUpdateData',['../struct_gfn_network_status_update_data.html',1,'GfnNetworkStatusUpdateData'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a6a39cfda036f86c9a4a6ab33711e4185',1,'GfnNetworkStatusUpdateData(): GfnRuntimeSdk_CAPI.h']]], ['gfnnodata',['gfnNoData',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2aacaf173021c824d4245326df71163bfa',1,'GfnSdk.h']]], + ['gfnnotauthorized',['gfnNotAuthorized',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a1676c946befcc1ef76d2e241ff6ac3d2',1,'GfnSdk.h']]], ['gfnnotcloud',['gfnNotCloud',['../_gfn_runtime_sdk___c_a_p_i_8h.html#aecdb9af8ee15731faeebae2fcec76c7ba1306dc02272509ca563d301026b76b28',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnos',['gfnOs',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a855cf09bb9d788137222168251e69bbbaa8264e33995e412604eb073b4b122cce',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnostype',['GfnOsType',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a1f78681ce77a7884cf0ffe98fedc7734',1,'GfnOsType(): GfnRuntimeSdk_CAPI.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a1262b81ef5a52dc48ea0e50fb08d0bd4',1,'GfnOsType(): GfnRuntimeSdk_CAPI.h']]], @@ -109,10 +111,10 @@ var searchData= ['gfnregisterclientinfocallback',['gfnRegisterClientInfoCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#abae3540f316b5bbd5e72b0071d3f3d5a',1,'gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga5999e9e8f42d975ac1b13537c5f44497',1,'GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisterexitcallback',['gfnRegisterExitCallback',['../group__callbacks.html#ga1bcb62aa8313bbe205ea4cb40246ee72',1,'gfnRegisterExitCallback(ExitCallbackSig exitCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga25cb8c18e2940a583a481612b1847a94',1,'GfnRegisterExitCallback(ExitCallbackSig exitCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisterinstallcallback',['gfnRegisterInstallCallback',['../group__callbacks.html#gaf315563a9205712a40e7a842af2ac91b',1,'gfnRegisterInstallCallback(InstallCallbackSig installCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga9a4a6595694aabf923dba25149827b9f',1,'GfnRegisterInstallCallback(InstallCallbackSig installCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], - ['gfnregistermessagecallback',['gfnRegisterMessageCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#ae5b74a7732c782eb448f5017115997c8',1,'gfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga35b0e52d38d41ac04854002a0e5e7df0',1,'GfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], - ['gfnregisternetworkstatuscallback',['gfnRegisterNetworkStatusCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#acaa9b6d41eac3e072f93f33429bba5e5',1,'gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga281cfc18e961dfcd537dce5ad4a73519',1,'GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *userContext): GfnRuntimeSdk_Wrapper.h']]], - ['gfnregisterpausecallback',['GfnRegisterPauseCallback',['../group__wrapper.html#gac2ebe6a27df6165e2be6dac82923664f',1,'GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../group__callbacks.html#gaf1965f1ccce59f6748ea4eed3df4edc0',1,'gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], - ['gfnregistersavecallback',['gfnRegisterSaveCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a432fb9b340f4ee95166d537feee44ea0',1,'gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gadcfae53ecb2d45b52ed2826491b58ef0',1,'GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], + ['gfnregistermessagecallback',['GfnRegisterMessageCallback',['../group__wrapper.html#ga35b0e52d38d41ac04854002a0e5e7df0',1,'GfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#ae5b74a7732c782eb448f5017115997c8',1,'gfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], + ['gfnregisternetworkstatuscallback',['GfnRegisterNetworkStatusCallback',['../group__wrapper.html#ga281cfc18e961dfcd537dce5ad4a73519',1,'GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#acaa9b6d41eac3e072f93f33429bba5e5',1,'gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], + ['gfnregisterpausecallback',['gfnRegisterPauseCallback',['../group__callbacks.html#gaf1965f1ccce59f6748ea4eed3df4edc0',1,'gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gac2ebe6a27df6165e2be6dac82923664f',1,'GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], + ['gfnregistersavecallback',['GfnRegisterSaveCallback',['../group__wrapper.html#gadcfae53ecb2d45b52ed2826491b58ef0',1,'GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a432fb9b340f4ee95166d537feee44ea0',1,'gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], ['gfnregistersessioninitcallback',['GfnRegisterSessionInitCallback',['../group__wrapper.html#gaa77104628b2a2779673e27dd52f0bfa7',1,'GfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#ac19b823f27eaffd4bd318eaf0fa02449',1,'gfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], ['gfnregisterstreamstatuscallback',['gfnRegisterStreamStatusCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a63f79659507415464e65d3feb96ba15a',1,'gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga658250f0c2178a8181bdc62b332c5aaf',1,'GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnresolutioninfo',['GfnResolutionInfo',['../struct_gfn_resolution_info.html',1,'']]], @@ -121,11 +123,9 @@ var searchData= ['gfnruntimesdk_5fwrapper_2eh',['GfnRuntimeSdk_Wrapper.h',['../_gfn_runtime_sdk___wrapper_8h.html',1,'']]], ['gfnsafezone',['gfnSafeZone',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a855cf09bb9d788137222168251e69bbbacf145d936a82c09515034ab86cd3ba86',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnsdk_2eh',['GfnSdk.h',['../_gfn_sdk_8h.html',1,'']]], - ['gfnsdk_5ffailed',['GFNSDK_FAILED',['../_gfn_sdk_8h.html#af1ab63ffcd0ec8cf72faabdc89ada570',1,'GfnSdk.h']]], - ['gfnsdk_5fsucceeded',['GFNSDK_SUCCEEDED',['../_gfn_sdk_8h.html#a3c1aa70801550fa1a48ab6fe0303a35c',1,'GfnSdk.h']]], ['gfnsendmessage',['gfnSendMessage',['../group__launcher.html#gab6a2bf6d5242c4f172d39096dda54cef',1,'gfnSendMessage(const char *pchMessage, unsigned int length): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga2148a6c3f952a7731b91b070fb08e30e',1,'GfnSendMessage(const char *pchMessage, unsigned int length): GfnRuntimeSdk_Wrapper.h']]], ['gfnsessioninfo',['GfnSessionInfo',['../struct_gfn_session_info.html',1,'']]], - ['gfnsetactionzone',['GfnSetActionZone',['../group__wrapper.html#ga1d0b3d941ab0d2127282d79df49a9130',1,'GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaa5e1081ccd6b903f12a6b9f05b11bf03',1,'gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_CAPI.h']]], + ['gfnsetactionzone',['gfnSetActionZone',['../group__launcher.html#gaa5e1081ccd6b903f12a6b9f05b11bf03',1,'gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga1d0b3d941ab0d2127282d79df49a9130',1,'GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_Wrapper.h']]], ['gfnsetuptitle',['gfnSetupTitle',['../group__launcher.html#gac3fd7e969aeaf3992dbb4e8220cacc6d',1,'gfnSetupTitle(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga764b9212ff5bfa2bc67f49034afa9b06',1,'GfnSetupTitle(const char *platformAppId): GfnRuntimeSdk_Wrapper.h']]], ['gfnsetuptitlefailure',['gfnSetupTitleFailure',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a7e19a6a264751aecb654251bf6b9263c',1,'GfnSdk.h']]], ['gfnshutdownruntimesdk',['gfnShutdownRuntimeSdk',['../group__general.html#gaef511b26bef12e55c0c12ea4911005a7',1,'GfnRuntimeSdk_CAPI.h']]], @@ -150,7 +150,7 @@ var searchData= ['gfnsuccess',['gfnSuccess',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2abf5db7fca7a3d3af4996f206ad1fe095',1,'GfnSdk.h']]], ['gfnthrottled',['gfnThrottled',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2abc3a3d9e5273f7bda51a4894bf163925',1,'GfnSdk.h']]], ['gfntimedout',['gfnTimedOut',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a33640b726436c5f12eef70eb81e3bd8f',1,'GfnSdk.h']]], - ['gfntitleexited',['gfnTitleExited',['../group__launcher.html#gab50035d62ed28d63d1033694b0655f6d',1,'gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gac34f26953cd4f1ff82f37f0f84de8332',1,'GfnTitleExited(const char *platformId, const char *platformAppId): GfnRuntimeSdk_Wrapper.h']]], + ['gfntitleexited',['GfnTitleExited',['../group__wrapper.html#gac34f26953cd4f1ff82f37f0f84de8332',1,'GfnTitleExited(const char *platformId, const char *platformAppId): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gab50035d62ed28d63d1033694b0655f6d',1,'gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]], ['gfnunabletoallocatememory',['gfnUnableToAllocateMemory',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2af73ee7f5f296791fbadeb94e123669a1',1,'GfnSdk.h']]], ['gfnunhandledexception',['gfnUnhandledException',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a5f0a8dab9ffbddcdffa45ba872bd025a',1,'GfnSdk.h']]], ['gfnunsupportedapicall',['gfnUnsupportedAPICall',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2af8614d00764f9704a7ef2008dae157f1',1,'GfnSdk.h']]], diff --git a/doc/SDK-GFN-RUNTIME/html/search/all_a.js b/doc/SDK-GFN-RUNTIME/html/search/all_a.js index 88ee34e..92a7fb2 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/all_a.js +++ b/doc/SDK-GFN-RUNTIME/html/search/all_a.js @@ -1,6 +1,6 @@ var searchData= [ - ['native_20runtime_20api_20reference',['Native Runtime API Reference',['../index.html',1,'']]], + ['native_20runtime_20application_20programming_20interface_20reference',['Native Runtime Application Programming Interface Reference',['../index.html',1,'']]], ['networkstatuscallbacksig',['NetworkStatusCallbackSig',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a02d95f5fcc4d22622ea8dc25979b6ff7',1,'GfnRuntimeSdk_CAPI.h']]], ['normalized',['normalized',['../struct_gfn_rect.html#a2fb4ff627b633d23a7395d4eed88966e',1,'GfnRect']]], ['nvgfnsdk_5fexport',['NVGFNSDK_EXPORT',['../_gfn_sdk_8h.html#a14c3346bb10747d03ddfa1d0f724faae',1,'GfnSdk.h']]], diff --git a/doc/SDK-GFN-RUNTIME/html/search/enumvalues_1.js b/doc/SDK-GFN-RUNTIME/html/search/enumvalues_1.js index 83f9d5a..1ebd68c 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/enumvalues_1.js +++ b/doc/SDK-GFN-RUNTIME/html/search/enumvalues_1.js @@ -36,6 +36,7 @@ var searchData= ['gfnactionnone',['gfnActionNone',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a4d3eb8f4bb9195f7777ea5286ec2be46ab2049297bc7117c0ec33df8896b8b2ed',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnapinotfound',['gfnAPINotFound',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a7a025dda39a30b9965e41f195a075c8b',1,'GfnSdk.h']]], ['gfnapinotinit',['gfnAPINotInit',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a8071b5184e59885268728c7d992edb1d',1,'GfnSdk.h']]], + ['gfnbackenderror',['gfnBackendError',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a3e136c2b7efaac8431aa967400a3afaf',1,'GfnSdk.h']]], ['gfnbinarysignatureinvalid',['gfnBinarySignatureInvalid',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a235a35603640ea7bc2915d312c4df566',1,'GfnSdk.h']]], ['gfncallwrongenvironment',['gfnCallWrongEnvironment',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a5563ddcd4cd759b0692958f764aaa1c2',1,'GfnSdk.h']]], ['gfncanceled',['gfnCanceled',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a554c41262ba51ec6c82377979597d49c',1,'GfnSdk.h']]], @@ -66,6 +67,7 @@ var searchData= ['gfnmaxlanguage',['gfnMaxLanguage',['../_gfn_sdk_8h.html#ab6a79fd15fb8eb5f3293444e8572acf2ab101384c92e88db62254ddd28f1f51aa',1,'GfnSdk.h']]], ['gfnnetworkstatuschangetypemax',['gfnNetworkStatusChangeTypeMax',['../_gfn_runtime_sdk___c_a_p_i_8h.html#acbccf3a0f3e54bd32d09f6d09df4bc04af7e242565cb45a381e1fa1f704ba476a',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnnodata',['gfnNoData',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2aacaf173021c824d4245326df71163bfa',1,'GfnSdk.h']]], + ['gfnnotauthorized',['gfnNotAuthorized',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a1676c946befcc1ef76d2e241ff6ac3d2',1,'GfnSdk.h']]], ['gfnnotcloud',['gfnNotCloud',['../_gfn_runtime_sdk___c_a_p_i_8h.html#aecdb9af8ee15731faeebae2fcec76c7ba1306dc02272509ca563d301026b76b28',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnos',['gfnOs',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a855cf09bb9d788137222168251e69bbbaa8264e33995e412604eb073b4b122cce',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnrectltrb',['gfnRectLTRB',['../_gfn_sdk_8h.html#a3932a61fe7c04be5595203f4bb006cb1aabadba94307bdb266fce2b5d84a0c19f',1,'GfnSdk.h']]], diff --git a/doc/SDK-GFN-RUNTIME/html/search/functions_0.js b/doc/SDK-GFN-RUNTIME/html/search/functions_0.js index 7d955a2..a671895 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/functions_0.js +++ b/doc/SDK-GFN-RUNTIME/html/search/functions_0.js @@ -9,28 +9,26 @@ var searchData= ['gfngetclientlanguagecode',['gfnGetClientLanguageCode',['../group__launcher.html#ga95ddfe6fabeec68eb40b2ffa28d604ec',1,'gfnGetClientLanguageCode(const char **ppchLanguageCode): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga20ea89be27f64ca0a15c397b112541d3',1,'GfnGetClientLanguageCode(const char **languageCode): GfnRuntimeSdk_Wrapper.h']]], ['gfngetpartnerdata',['gfnGetPartnerData',['../group__launcher.html#ga16c67cdee702190faf8b8682f760a339',1,'gfnGetPartnerData(const char **ppchPartnerData): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga9223905a2b1279a175f9b5bdbc40838c',1,'GfnGetPartnerData(const char **partnerData): GfnRuntimeSdk_Wrapper.h']]], ['gfngetpartnersecuredata',['gfnGetPartnerSecureData',['../group__launcher.html#gaeddedbabbd2d5da5d525bb737b26c820',1,'gfnGetPartnerSecureData(const char **ppchPartnerSecureData): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gab4760d499a669358847649c9dc44a433',1,'GfnGetPartnerSecureData(const char **partnerSecureData): GfnRuntimeSdk_Wrapper.h']]], - ['gfngetsessioninfo',['gfnGetSessionInfo',['../group__launcher.html#ga1f994c00e0579443e6cc920dd4a1c853',1,'gfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga2bbf214d68c42487b1e33f789e87330d',1,'GfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_Wrapper.h']]], - ['gfngettitlesavailable',['gfnGetTitlesAvailable',['../group__launcher.html#ga70ea27f47639201d48de5d3006b20481',1,'gfnGetTitlesAvailable(const char **ppchPlatformAppIds): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gad21b46157207c9083f490cea77a4dea1',1,'GfnGetTitlesAvailable(const char **platformAppIds): GfnRuntimeSdk_Wrapper.h']]], + ['gfngetsessioninfo',['GfnGetSessionInfo',['../group__wrapper.html#ga2bbf214d68c42487b1e33f789e87330d',1,'GfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga1f994c00e0579443e6cc920dd4a1c853',1,'gfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_CAPI.h']]], + ['gfngettitlesavailable',['GfnGetTitlesAvailable',['../group__wrapper.html#gad21b46157207c9083f490cea77a4dea1',1,'GfnGetTitlesAvailable(const char **platformAppIds): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga70ea27f47639201d48de5d3006b20481',1,'gfnGetTitlesAvailable(const char **ppchPlatformAppIds): GfnRuntimeSdk_CAPI.h']]], ['gfninitializeruntimesdk',['gfnInitializeRuntimeSdk',['../group__general.html#gae75c579a109c1f89162e858d1a479d79',1,'GfnRuntimeSdk_CAPI.h']]], ['gfninitializesdk',['GfnInitializeSdk',['../group__wrapper.html#ga9792e6f512b08afcc301da5450af896c',1,'GfnRuntimeSdk_Wrapper.h']]], ['gfninitializesdkfrompatha',['GfnInitializeSdkFromPathA',['../group__wrapper.html#ga14f86ddbf62c5827c62621878ce14485',1,'GfnRuntimeSdk_Wrapper.h']]], ['gfninitializesdkfrompathw',['GfnInitializeSdkFromPathW',['../group__wrapper.html#ga46b57108038ac5e86fc2a770219aef63',1,'GfnRuntimeSdk_Wrapper.h']]], ['gfnisrunningincloud',['gfnIsRunningInCloud',['../group__launcher.html#ga3b33985a46d6bd20fdea2c4865dc6a0f',1,'gfnIsRunningInCloud(): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gaa109bc7e726c5991c2efcbce8e4c0f64',1,'GfnIsRunningInCloud(bool *runningInCloud): GfnRuntimeSdk_Wrapper.h']]], ['gfnisrunningincloudsecure',['GfnIsRunningInCloudSecure',['../group__wrapper.html#ga6fa2dbe2bfa3e67cd41963bf28ac5e65',1,'GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaf5ab33bd8cd24cb26cda5bacf1764e3f',1,'gfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance): GfnRuntimeSdk_CAPI.h']]], - ['gfnistitleavailable',['GfnIsTitleAvailable',['../group__wrapper.html#gad9c160b9ea4921de4ca57d48ede5c9be',1,'GfnIsTitleAvailable(const char *platformAppId, bool *isAvailable): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaa8b07a70503f2a24b6625fc5a7eef9cb',1,'gfnIsTitleAvailable(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]], + ['gfnistitleavailable',['gfnIsTitleAvailable',['../group__launcher.html#gaa8b07a70503f2a24b6625fc5a7eef9cb',1,'gfnIsTitleAvailable(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gad9c160b9ea4921de4ca57d48ede5c9be',1,'GfnIsTitleAvailable(const char *platformAppId, bool *isAvailable): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisterclientinfocallback',['gfnRegisterClientInfoCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#abae3540f316b5bbd5e72b0071d3f3d5a',1,'gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga5999e9e8f42d975ac1b13537c5f44497',1,'GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisterexitcallback',['gfnRegisterExitCallback',['../group__callbacks.html#ga1bcb62aa8313bbe205ea4cb40246ee72',1,'gfnRegisterExitCallback(ExitCallbackSig exitCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga25cb8c18e2940a583a481612b1847a94',1,'GfnRegisterExitCallback(ExitCallbackSig exitCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisterinstallcallback',['gfnRegisterInstallCallback',['../group__callbacks.html#gaf315563a9205712a40e7a842af2ac91b',1,'gfnRegisterInstallCallback(InstallCallbackSig installCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga9a4a6595694aabf923dba25149827b9f',1,'GfnRegisterInstallCallback(InstallCallbackSig installCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], - ['gfnregistermessagecallback',['gfnRegisterMessageCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#ae5b74a7732c782eb448f5017115997c8',1,'gfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga35b0e52d38d41ac04854002a0e5e7df0',1,'GfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], - ['gfnregisternetworkstatuscallback',['gfnRegisterNetworkStatusCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#acaa9b6d41eac3e072f93f33429bba5e5',1,'gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga281cfc18e961dfcd537dce5ad4a73519',1,'GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *userContext): GfnRuntimeSdk_Wrapper.h']]], - ['gfnregisterpausecallback',['GfnRegisterPauseCallback',['../group__wrapper.html#gac2ebe6a27df6165e2be6dac82923664f',1,'GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../group__callbacks.html#gaf1965f1ccce59f6748ea4eed3df4edc0',1,'gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], - ['gfnregistersavecallback',['gfnRegisterSaveCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a432fb9b340f4ee95166d537feee44ea0',1,'gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gadcfae53ecb2d45b52ed2826491b58ef0',1,'GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], + ['gfnregistermessagecallback',['GfnRegisterMessageCallback',['../group__wrapper.html#ga35b0e52d38d41ac04854002a0e5e7df0',1,'GfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#ae5b74a7732c782eb448f5017115997c8',1,'gfnRegisterMessageCallback(MessageCallbackSig messageCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], + ['gfnregisternetworkstatuscallback',['GfnRegisterNetworkStatusCallback',['../group__wrapper.html#ga281cfc18e961dfcd537dce5ad4a73519',1,'GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#acaa9b6d41eac3e072f93f33429bba5e5',1,'gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], + ['gfnregisterpausecallback',['gfnRegisterPauseCallback',['../group__callbacks.html#gaf1965f1ccce59f6748ea4eed3df4edc0',1,'gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gac2ebe6a27df6165e2be6dac82923664f',1,'GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], + ['gfnregistersavecallback',['GfnRegisterSaveCallback',['../group__wrapper.html#gadcfae53ecb2d45b52ed2826491b58ef0',1,'GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a432fb9b340f4ee95166d537feee44ea0',1,'gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], ['gfnregistersessioninitcallback',['GfnRegisterSessionInitCallback',['../group__wrapper.html#gaa77104628b2a2779673e27dd52f0bfa7',1,'GfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#ac19b823f27eaffd4bd318eaf0fa02449',1,'gfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], ['gfnregisterstreamstatuscallback',['gfnRegisterStreamStatusCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a63f79659507415464e65d3feb96ba15a',1,'gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga658250f0c2178a8181bdc62b332c5aaf',1,'GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], - ['gfnsdk_5ffailed',['GFNSDK_FAILED',['../_gfn_sdk_8h.html#af1ab63ffcd0ec8cf72faabdc89ada570',1,'GfnSdk.h']]], - ['gfnsdk_5fsucceeded',['GFNSDK_SUCCEEDED',['../_gfn_sdk_8h.html#a3c1aa70801550fa1a48ab6fe0303a35c',1,'GfnSdk.h']]], ['gfnsendmessage',['gfnSendMessage',['../group__launcher.html#gab6a2bf6d5242c4f172d39096dda54cef',1,'gfnSendMessage(const char *pchMessage, unsigned int length): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga2148a6c3f952a7731b91b070fb08e30e',1,'GfnSendMessage(const char *pchMessage, unsigned int length): GfnRuntimeSdk_Wrapper.h']]], - ['gfnsetactionzone',['GfnSetActionZone',['../group__wrapper.html#ga1d0b3d941ab0d2127282d79df49a9130',1,'GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaa5e1081ccd6b903f12a6b9f05b11bf03',1,'gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_CAPI.h']]], + ['gfnsetactionzone',['gfnSetActionZone',['../group__launcher.html#gaa5e1081ccd6b903f12a6b9f05b11bf03',1,'gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga1d0b3d941ab0d2127282d79df49a9130',1,'GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_Wrapper.h']]], ['gfnsetuptitle',['gfnSetupTitle',['../group__launcher.html#gac3fd7e969aeaf3992dbb4e8220cacc6d',1,'gfnSetupTitle(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga764b9212ff5bfa2bc67f49034afa9b06',1,'GfnSetupTitle(const char *platformAppId): GfnRuntimeSdk_Wrapper.h']]], ['gfnshutdownruntimesdk',['gfnShutdownRuntimeSdk',['../group__general.html#gaef511b26bef12e55c0c12ea4911005a7',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnshutdownsdk',['GfnShutdownSdk',['../group__wrapper.html#ga3f9e4989832c06a2e431f997848732ac',1,'GfnRuntimeSdk_Wrapper.h']]], @@ -39,5 +37,5 @@ var searchData= ['gfnstopstream',['GfnStopStream',['../group__wrapper.html#ga5010fe92907ea2e4df986697d51acecc',1,'GfnStopStream(void): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaf187e90d0ba2eb566244c2d302fed86e',1,'gfnStopStream(void): GfnRuntimeSdk_CAPI.h']]], ['gfnstopstreamasync',['GfnStopStreamAsync',['../group__wrapper.html#gaefae1a18a508d60d0bf4f8baf1c1f3ee',1,'GfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga2392b3feb76dc6e77cc32d39c7193428',1,'gfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_CAPI.h']]], ['gfnstreamstatustostring',['GfnStreamStatusToString',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a20888129fbf3905d65cbc96d84b76f55',1,'GfnRuntimeSdk_CAPI.h']]], - ['gfntitleexited',['gfnTitleExited',['../group__launcher.html#gab50035d62ed28d63d1033694b0655f6d',1,'gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gac34f26953cd4f1ff82f37f0f84de8332',1,'GfnTitleExited(const char *platformId, const char *platformAppId): GfnRuntimeSdk_Wrapper.h']]] + ['gfntitleexited',['GfnTitleExited',['../group__wrapper.html#gac34f26953cd4f1ff82f37f0f84de8332',1,'GfnTitleExited(const char *platformId, const char *platformAppId): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gab50035d62ed28d63d1033694b0655f6d',1,'gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]] ]; diff --git a/doc/SDK-GFN-RUNTIME/html/search/pages_0.js b/doc/SDK-GFN-RUNTIME/html/search/pages_0.js index ab5cb18..0d6d5b9 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/pages_0.js +++ b/doc/SDK-GFN-RUNTIME/html/search/pages_0.js @@ -1,5 +1,5 @@ var searchData= [ - ['native_20runtime_20api_20reference',['Native Runtime API Reference',['../index.html',1,'']]], + ['native_20runtime_20application_20programming_20interface_20reference',['Native Runtime Application Programming Interface Reference',['../index.html',1,'']]], ['native_20runtime_20api_20export_20wrapper_20reference',['Native Runtime API Export Wrapper Reference',['../wrapper_apis.html',1,'']]] ]; diff --git a/doc/SDK-GFN-RUNTIME/html/sequence.png b/doc/SDK-GFN-RUNTIME/html/sequence.png deleted file mode 100644 index e83996e..0000000 Binary files a/doc/SDK-GFN-RUNTIME/html/sequence.png and /dev/null differ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info-members.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info-members.html index 73cd7bf..b44246c 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info.html index 1b6f520..8442b27 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info_update_data-members.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info_update_data-members.html index 7f16127..9363db0 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info_update_data-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info_update_data-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info_update_data.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info_update_data.html index 575162b..669de73 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info_update_data.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_client_info_update_data.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_network_status_update_data-members.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_network_status_update_data-members.html index dc84e01..31543b6 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_network_status_update_data-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_network_status_update_data-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_network_status_update_data.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_network_status_update_data.html index 0192323..85e2b5a 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_network_status_update_data.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_network_status_update_data.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_rect-members.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_rect-members.html index c817b4c..30e2826 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_rect-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_rect-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_rect.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_rect.html index 3a9e945..578a459 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_rect.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_rect.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_resolution_info-members.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_resolution_info-members.html index 8e3cec8..902e6d8 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_resolution_info-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_resolution_info-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_resolution_info.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_resolution_info.html index 8eba3f2..25bffac 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_resolution_info.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_resolution_info.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info-members.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info-members.html index 46fc84c..8fed1bd 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info.html index 1130f4b..b0fa75c 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_string-members.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_string-members.html index 00a7b08..7020401 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_string-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_string-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_string.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_string.html index 928356c..8ea99dd 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_string.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_string.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_start_stream_input-members.html b/doc/SDK-GFN-RUNTIME/html/struct_start_stream_input-members.html index a6a80eb..d54cbd9 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_start_stream_input-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_start_stream_input-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_start_stream_input.html b/doc/SDK-GFN-RUNTIME/html/struct_start_stream_input.html index 5d3ec55..db09784 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_start_stream_input.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_start_stream_input.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_start_stream_response-members.html b/doc/SDK-GFN-RUNTIME/html/struct_start_stream_response-members.html index d065e31..13b758a 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_start_stream_response-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_start_stream_response-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_start_stream_response.html b/doc/SDK-GFN-RUNTIME/html/struct_start_stream_response.html index 20a7e26..33a7811 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_start_stream_response.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_start_stream_response.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_title_installation_information-members.html b/doc/SDK-GFN-RUNTIME/html/struct_title_installation_information-members.html index a61f9aa..3f2bdf5 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_title_installation_information-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_title_installation_information-members.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/struct_title_installation_information.html b/doc/SDK-GFN-RUNTIME/html/struct_title_installation_information.html index a057470..08c1f79 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_title_installation_information.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_title_installation_information.html @@ -27,6 +27,7 @@ diff --git a/doc/SDK-GFN-RUNTIME/html/wrapper_apis.html b/doc/SDK-GFN-RUNTIME/html/wrapper_apis.html index 645376b..524cb29 100644 --- a/doc/SDK-GFN-RUNTIME/html/wrapper_apis.html +++ b/doc/SDK-GFN-RUNTIME/html/wrapper_apis.html @@ -27,6 +27,7 @@ @@ -100,6 +101,7 @@

GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
GeForce NOW SDK +  2.1.0.33843515
Description
Loads the GFN SDK dynamic library and calls gfnInitializeRuntimeSdk. By default, the function expects the library to be in the same folder as the loading process's executable. For security reasons, the dynamic library is loaded by fully-quanitified path. If the GFN SDK library is packaged in another folder, you will need to locally modify the function to reference that location.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call as soon as possible during application startup.
Parameters
@@ -125,6 +127,7 @@

Description
Calls gfnShutdownRuntimeSdk to releases the SDK and resources and disconnects from GFN backend and then unloads unloads the GFN SDK Library.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Call during application shutdown or when GFN Runtime API methods are no longer needed.
Return values
@@ -141,6 +144,7 @@

Description
Calls gfnIsRunningInCloud to determine if calling application is running in GFN environment, and without requiring process registration.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Use to quickly determine whether to enable / disable any low-value GFN cloud environment specific application logic, for example, to block any calls to GfnStartStream() to avoid an error, or to know if GetTitlesAvailable can be called without an error.
Warning
This API is meant to fill the need to quickly determine if the call looks to be in the GFN cloud environment. It purposefully trades off resource-intensive checks for fast response. Do not tie any logic or features of value to this API as the call stack could be tampered with. For that purpose, use GfnIsRunningInCloudSecure.
Parameters
@@ -167,6 +171,7 @@

Description
Calls gfnIsRunningInCloudSecure to determine if calling application is running in GFN environment, and what level of security assurance that the result is valid.
Environment
Cloud and Client
+
Platform
Windows
Usage
Call from an NVIDIA-approved process to securely determine whether running in GFN cloud, and use the GfnIsRunningInCloudAssurance value to decide the risk to enable any application specific logic for that environment.
Warning
This API must be called from a process that has been registered with NVIDIA, or it will return an error. Refer to the Cloud Check API Guide on how to get your application registered. To prevent man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudAssurance to decide if the check was certain enough without tampering to enable the logic or feature associated with the API call.
Parameters
@@ -192,6 +197,7 @@

Description
Calls gfnFree to free memory allocated by gfnGetTitlesAvailable
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to release memory after a call to a memory-allocated function and you are finished with the data. Should only be called if the memory is populated with valid data. Calling GfnFree with invalid pointer or data will result in an memory exception being thrown.
Parameters
@@ -214,6 +220,7 @@

Description
Calls gfnGetClientIp to get user client's IP address.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's external client IP address.
Parameters
@@ -241,6 +248,7 @@

Description
Calls gfnGetClientIp to get user client's IP address.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's external client IP address.
Parameters
@@ -268,6 +276,7 @@

Description
Calls gfnGetClientLanguageCode to gets user's client language code in the form "<lang>-<country>" using a standard ISO 639-1 language code and ISO 3166-1 Alpha-2 country code.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the user's language and country settings.
Parameters
@@ -295,10 +304,11 @@

Description
Calls GfnGetPartnerData to retrieves non-secure partner data that is either a) passed by the client in the gfnStartStream call or b) sent using Deep Link parameter.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use during cloud session to retrieve partner data
Parameters
- +
partnerData- Populated with the partner data, if found. Call GfnFree to free the memory.
partnerData- Populated with the partner data in string form if found Call GfnFree to free the memory
@@ -322,6 +332,7 @@

Description
Calls gfnIsTitleAvailable to determines if a specific title is available to launch in current streaming session.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to determine if a title is available to be launched from the active GFN cloud instance, for example, to show a "Play" button in a platform launcher's UI.
Parameters
@@ -348,6 +359,7 @@

Description
Calls gfnGetTitlesAvailable to retrieves all titles that can be launched in the current game streaming session.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to retrieve a list of all titles available to launch in the current streaming session, for example, to add "Play" buttons to all titles instead of calling gfnIsTitleAvailable on each title.
Parameters
@@ -374,6 +386,7 @@

Description
Gets user's client data.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this during application start or from the platform client in order to get the data on the user's client.
Parameters
@@ -400,6 +413,7 @@

Description
Gets various information about the current streaming session
Environment
Cloud
+
Platform
Windows, Linux
Usage
Call this from a streaming session to find out more information about the session, such as session time remaining, or if RTX is enabled for the current session.
Parameters
@@ -425,6 +439,7 @@

Description
Calls gfnRegisterStreamStatusCallback to register a callback that gets called on the user's PC when the streaming session state changes.
Environment
Client
+
Platform
Windows
Usage
Register a function to call when stream status changes on the user's client PC
Parameters
@@ -450,6 +465,7 @@

Description
Calls gfnStartStream to request GFN client to start a streaming session of an application in a synchronous (blocking) fashion.
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -477,6 +493,7 @@

Description
Calls gfnStartStreamAsync to request GFN client to start a streaming session of an application in an asynchronous fashion.
Environment
Client
+
Platform
Windows
Usage
Use to start a streaming session.
Parameters
@@ -506,6 +523,7 @@

Description
Calls gfnSetupTitle to notify Geforce NOW that an application should be readied for launch.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to prepare an application for launch on Geforce NOW, and block on the result.
Parameters
@@ -532,6 +550,7 @@

Description
Calls GfnTitleExited to notify GFN that an application has exited.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to notify GFN that your application has exited.
Parameters
@@ -558,6 +577,7 @@

Description
Calls gfnRegisterExitCallback to register an application function to call when Geforce NOW needs to exit the game.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when Geforce NOW needs to exit the game.
Parameters
@@ -584,6 +604,7 @@

Description
Calls gfnRegisterPauseCallback to register an application callback with Geforce NOW to be called when Geforce NOW needs to pause the game on the user's behalf.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when Geforce NOW needs to pause the game.
Parameters
@@ -610,6 +631,7 @@

Description
Calls gfnRegisterInstallCallback to register an application callback with Geforce NOW to be called after a successful call to gfnSetupTitle.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register a function to call after a successful call to gfnSetupTitle.
Parameters
@@ -636,6 +658,7 @@

Description
Calls gfnRegisterSaveCallback to register an application callback with GFN to be called when GFN needs the application to save user progress.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when GFN needs the application to save
Parameters
@@ -660,6 +683,7 @@

Description
Calls gfnRegisterSessionInitCallback to register an application callback to be called when a GFN user has connected to the game seat.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Register an application function to call when a GFN user has connected to the game seat
Parameters
@@ -686,6 +710,7 @@

Description
Calls GfnAppReady to notify GFN that an application is ready to be displayed.
Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to notify GFN that your application is ready to be streamed.
Parameters
@@ -712,6 +737,7 @@

Description
Sends Active zone coordinates to GFN Client

TO BE DEPRECATED SOON

Environment
Cloud
+
Platform
Windows, Linux
Usage
Use to invoke special events on the client from the GFN cloud environment Note : Marked for deprecation
Parameters

@@ -743,11 +769,12 @@

Description
Sends a custom message communication from the app to the client. This message is "fire-and-forget", and does not wait for the message to be delivered to return status. Latency is best effort and not guaranteed.
Environment
Cloud or Client
+
Platform
Windows, Linux
Usage
Use to communicate between cloud applications and streaming clients.
Parameters
- +
pchMessage- Character string
length- Length of pchMessage in characters
length- Length of pchMessage in characters, which cannot exceed 8K in length
@@ -756,8 +783,8 @@

gfnSuccess- Call was successful gfnComError- There was SDK internal communication error gfnInitFailure- SDK was not initialized - gfnInvalidParameter- Invalid parameters provided - gfnThrottled- API call was throttled for exceeding limit + gfnInvalidParameter- Invalid parameters provided, or message exceeded allowed length + gfnThrottled- API call was throttled for exceeding limit of 30 messages per second gfnUnhandledException- API ran into an unhandled error and caught an exception before it returned to client code gfnCloudLibraryNotFound- GFN SDK cloud-side library could not be found @@ -772,6 +799,7 @@

Description
Registers an application callback with GFN to be called when client info changes
Environment
Cloud
+
Platform
Windows, Linux
Parameters
@@ -794,6 +822,7 @@

clientInfoCallback- Function pointer to application code to call when GFN client data changes
Description
Registers an application callback with GFN to be called when network latency changes
Environment
Cloud
+
Platform
Windows, Linux
Parameters
@@ -818,6 +847,7 @@

networkStatusCallback- Function pointer to application code to call when network latency changes
Description
Calls gfnRegisterMessageCallback to register an application callback to be called when a message has been sent to the application.
Environment
Cloud and Client
+
Platform
Windows, Linux
Usage
Provide a callback function that will be called when a message is sent to the application.
Parameters
diff --git a/doc/SDK-GFN-RUNTIME/img/ecosystem.png b/doc/SDK-GFN-RUNTIME/img/ecosystem.png deleted file mode 100644 index 39a0359..0000000 Binary files a/doc/SDK-GFN-RUNTIME/img/ecosystem.png and /dev/null differ diff --git a/doc/SDK-GFN-RUNTIME/img/sequence.png b/doc/SDK-GFN-RUNTIME/img/sequence.png deleted file mode 100644 index e83996e..0000000 Binary files a/doc/SDK-GFN-RUNTIME/img/sequence.png and /dev/null differ diff --git a/generate.bat b/generate.bat deleted file mode 100644 index 577a06a..0000000 --- a/generate.bat +++ /dev/null @@ -1,21 +0,0 @@ -echo off - -echo == This script generates a Visual Studio solution. -echo == For more advanced usage, invoke cmake directly -echo == For best results, run this script from a Visual Studio Developer Command Prompt - -if not exist "build" ( - echo == Creating build directory: .\build - mkdir build -) - -echo == Generating Visual Studio solution -echo. - -pushd build -cmake -DCMAKE_GENERATOR_PLATFORM=x64 .. -popd - -echo == You can open the Visual Studio solution with the following command: -echo start build/GFNSDK.sln -echo. diff --git a/generate_x86.bat b/generate_x86.bat deleted file mode 100644 index 6e6e5d8..0000000 --- a/generate_x86.bat +++ /dev/null @@ -1,21 +0,0 @@ -echo off - -echo == This script generates a Visual Studio solution. -echo == For more advanced usage, invoke cmake directly -echo == For best results, run this script from a Visual Studio Developer Command Prompt - -if not exist "build" ( - echo == Creating build directory: .\build - mkdir build -) - -echo == Generating Visual Studio solution -echo. - -pushd build -cmake -DCMAKE_GENERATOR_PLATFORM=Win32 .. -popd - -echo == You can open the Visual Studio solution with the following command: -echo start build/GFNSDK.sln -echo. diff --git a/include/GfnRuntimeSdk_CAPI.h b/include/GfnRuntimeSdk_CAPI.h index 0b5ea22..4dc7bb8 100644 --- a/include/GfnRuntimeSdk_CAPI.h +++ b/include/GfnRuntimeSdk_CAPI.h @@ -37,51 +37,39 @@ * API definitions */ /// -/// @mainpage Native Runtime API Reference +/// @mainpage Native Runtime Application Programming Interface Reference /// /// @section introduction Introduction -/// The NVIDIA GFN Runtime SDK provides a set of interfaces to allow game developers and game -/// publishers to interact with parts of the NVIDIA GeForce NOW ecosystem. Integration is provided -/// by various means, from native C interfaces to RESTful Web API calls, depending on the feature -/// of the SDK. -/// -/// @image html ecosystem.png -/// -/// This document provides details of how to integrate the native APIs of GFN Runtime SDK features -/// into your application and its developer and deployment processes. +/// The NVIDIA GFN Runtime SDK provides an Application Programming Interface (API) +/// to allow game and application developers to interact with parts of the NVIDIA +/// GeForce NOW ecosystem. Overall integration is provided by various interfaces, +/// from the native C interfaces described in this documentation, to RESTful +/// endpoint calls, depending on the feature of the SDK. +/// +/// This documenation focuses solely on the native C interfaces, and provides the +/// specifications of each of the native APIs of GFN Runtime SDK, as well as the +/// requires to use the APIs. For example usage, refer to the Quick Start +/// documentation and the sample applications provided in the ./samples folder. /// /// @section overview Overview /// -/// The GFN Runtime SDK provides a dynamic library with API exports as defined in this document, -/// which is distributed with and loaded by the game/application that utilizes the APIs. The loading -/// of this library should be done in a way that validates the authenticity of the binary via checking -/// for a valid digital signature, and that signature is from NVIDIA Corporation. -/// -/// The behavior of the APIs depends on the environment the application is running in; either on a -/// client/user system or in the GeForce NOW (GFN) cloud environment. Each API defines which of the -/// environments it is designed to run in. -/// -/// On client systems, this library checks for the presence of the GeForce NOW (GFN) client -/// installation when any of the gfnStartStream API variants is called. If the client is not present, -/// then the library will initiate a download and installation of the latest GFN client, presenting UI -/// to the user for the download and installation process. If the GFN client is present, but out of date, -/// then a similar download and install process to update the client will take place before the -/// streaming session will start. -/// -/// Once the GFN client is installed, all API actions are deferred to the GFN client. This design allows -/// the dynamic library to stay as thin as possible in the application, and provides backward and forward -/// compatibility to new GFN client packages. +/// The GFN Runtime SDK provides a dynamic library with API exports as defined in +/// this document, which is distributed with and loaded by the game/application that +/// utilizes the APIs. The loading of this library should be done in a way that +/// validates the authenticity of the binary. For example, on Windows, checking for +/// a valid digital signature, and that signature is from NVIDIA Corporation. /// -/// Many of the APIs are no-ops depending on the environment they apply to only to either local client or -/// GFN cloud environments. In those cases, API calls will return a well-defined error code to denote the -/// call was not applicable to the environment. +/// The behavior of the APIs depends on the environment the application is running in; +/// either on a client/user system or in the GeForce NOW (GFN) cloud environment. Each +/// API defines which of the environments it is designed to run in. Some of the APIs +/// can execute in only one of the environments; either the local client or GFN cloud +/// environment. These APIs will return a well-defined error code "gfnCallWrongEnvironment" +/// to denote when call was not applicable to the execution environment. /// -/// Some of the APIs are used solely for authentication purposes in Account Linking and -/// Single Sign-On scenarios. For more information about NVIDIA's Account Linking and Single Sign-On -/// model, please refer to the SDK-GFN-ACCOUNT-LINKING-SSO-GUIDE.pdf document in the /doc folder. -/// -/// For additional high-level overview, please refer to the SDK primer available as part of the -/// documentation section of the SDK's repository. +/// For additional high-level overview, please refer to the SDK primer available as +/// part of the documentation section of the SDK's repository. For references on +/// correct API calls for the most common of integration scenarios, please prefer to +/// the SDK Quick Start Guide. /// /// @section keyconcepts Key Concepts /// @@ -97,8 +85,6 @@ /// application to check for errors. In addition, some methods are asynchronous /// by nature, but provide synchronous variants when possible. /// -/// @image html sequence.png -/// /// @section apiReference API Reference /// @subsection general_section General / Common methods /// @ref general @@ -533,6 +519,9 @@ /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call as soon as possible during application startup. @@ -555,6 +544,9 @@ /// @par Environment /// Cloud and Client /// + /// @par Platform + /// Windows, Linux + /// /// @par Usage /// Call during application shutdown or when GFN Runtime API methods are no longer needed. NVGFNSDK_EXPORT void NVGFNSDKApi gfnShutdownRuntimeSdk(); @@ -571,6 +563,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Register an application function to call when Geforce NOW needs to exit the game. @@ -596,6 +591,9 @@ /// @par Environment /// Cloud /// + /// @par Platform + /// Windows, Linux + /// /// @par Usage /// Register an application function to call when Geforce NOW needs to pause the game. /// @@ -620,6 +618,9 @@ /// @par Environment /// Cloud /// + /// @par Platform + /// Windows, Linux + /// /// @par Usage /// Register a function to call after a successful call to gfnSetupTitle. /// @@ -642,6 +643,9 @@ /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Register a function to call when stream status changes on the user's client PC @@ -663,6 +667,12 @@ /// to save user progress. It is recommended that this be implemented as an autosave if /// such a feature is supported by your application. /// + /// @par Environment + /// Cloud + /// + /// @par Platform + /// Windows, Linux + /// /// @par Usage /// Register an application function to call when GFN needs the application to save /// @@ -680,6 +690,12 @@ /// @par Description /// Register an application callback with GFN to be called when a GFN user has connected to the game seat /// + /// @par Environment + /// Cloud + /// + /// @par Platform + /// Windows, Linux + /// /// @par Usage /// Register an application function to call when a GFN user has connected to the game seat /// @@ -700,6 +716,12 @@ /// @par Description /// Register an application callback with GFN to be called when a message is sent to the application. /// + /// @par Environment + /// Cloud + /// + /// @par Platform + /// Windows, Linux + /// /// @par Usage /// Provide a callback function that will be called when a message is sent to the application. /// @@ -716,8 +738,14 @@ NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterMessageCallback(MessageCallbackSig messageCallback, void* pUserContext); /// /// @par Description - /// Register an application callback with GFN to be called when certain client info that is part of @ref GetClientInfo API changes + /// Register an application callback with GFN to be called when certain client info that is part of @ref gfnGetClientInfo API changes /// + /// @par Environment + /// Cloud + /// + /// @par Platform + /// Windows, Linux + /// /// @par Usage /// Register an application function to call when a the client information from the GFN user's client system has changed /// @@ -737,6 +765,12 @@ /// @par Description /// Register an application callback with GFN to be called when client latency changes /// + /// @par Environment + /// Cloud + /// + /// @par Platform + /// Windows, Linux + /// /// @par Usage /// Register an application function to call when a the network latency from the GFN user's client system has changed /// @@ -768,6 +802,9 @@ /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to quickly determine whether to enable / disable any low-value GFN cloud environment @@ -795,6 +832,9 @@ /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Call from an NVIDIA-approved process to securely determine whether running in GFN cloud, and use the @@ -822,6 +862,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to determine if a title is available to be streamed from the active GFN cloud instance, @@ -841,6 +884,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to retrieve a list of all titles available to launch in the current streaming session, @@ -868,6 +914,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to prepare an application for launch on Geforce NOW, and block on the result. @@ -890,6 +939,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to notify GFN that your application has exited. @@ -914,6 +966,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this during application start or from the platform client in @@ -941,6 +996,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this during application start or from the platform client in @@ -964,6 +1022,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this during application start or from the platform client in order to get @@ -984,6 +1045,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this during application start or from the platform client in order to get @@ -1011,6 +1075,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this from a streaming session to find out more information about the session, such @@ -1037,6 +1104,9 @@ /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Use to start a streaming session. @@ -1053,6 +1123,9 @@ /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Use to start a streaming session. @@ -1074,6 +1147,9 @@ /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Use to request the streaming session be stopped @@ -1091,6 +1167,9 @@ /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Use to request the streaming session be stopped @@ -1107,11 +1186,14 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use during cloud session to retrieve partner data based in during session initialization. /// - /// @param ppchPartnerData - Populated with the partner data, if found + /// @param ppchPartnerData - Populated with the partner data in string form if found /// Call @ref gfnFree to release the memory when done with data /// /// @retval gfnSuccess - Partner data successfully retrieved from session data @@ -1129,11 +1211,14 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use during cloud session to retrieve secure partner data /// - /// @param ppchPartnerSecureData - Populated with the secure partner data, if found + /// @param ppchPartnerSecureData - Populated with the secure partner data in string form if found /// Call @ref gfnFree to release the memory when done. /// /// @retval gfnSuccess - Secure partner data successfully retrieved from session data @@ -1152,6 +1237,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to release memory after a call to a memory-allocated function and you are finished with the data. @@ -1171,6 +1259,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to notify GFN that your application is ready to be displayed. @@ -1188,6 +1279,9 @@ /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to invoke special events on the client from the GFN cloud environment @@ -1214,18 +1308,21 @@ /// /// @par Environment /// Cloud or Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to communicate between cloud applications and streaming clients. /// /// @param pchMessage - Character string - /// @param length - Length of pchMessage in characters + /// @param length - Length of pchMessage in characters, which cannot exceed 8K in length /// /// @retval gfnSuccess - Call was successful /// @retval gfnComError - There was SDK internal communication error /// @retval gfnInitFailure - SDK was not initialized - /// @retval gfnInvalidParameter - Invalid parameters provided - /// @retval gfnThrottled - API call was throttled for exceeding limit + /// @retval gfnInvalidParameter - Invalid parameters provided, or message exceeded allowed length + /// @retval gfnThrottled - API call was throttled for exceeding limit of 30 messages per second /// @retval gfnUnhandledException - API ran into an unhandled error and caught an exception before it returned to client code /// @retval gfnCloudLibraryNotFound - GFN SDK cloud-side library could not be found /// @return Otherwise, appropriate error code diff --git a/include/GfnRuntimeSdk_Wrapper.c b/include/GfnRuntimeSdk_Wrapper.c index 8e62c35..699a262 100644 --- a/include/GfnRuntimeSdk_Wrapper.c +++ b/include/GfnRuntimeSdk_Wrapper.c @@ -31,7 +31,43 @@ #include "GfnSdk_SecureLoadLibrary.h" #endif +#include +#include #include +#include +#include + +#ifdef _WIN32 +# include +# include +# ifdef _WIN64 +# define GFN_DLL L"GFN_V2.dll" +# else +# define GFN_DLL L"GFN32_V2.dll" +# endif +# define GFN_CLIENT_SHARED_LIBRARY L"GfnRuntimeSdk.dll" +# define GFN_DLL_SUBPATH L"\\NVIDIA Corporation\\GeForceNOW\\SDK\\" GFN_DLL +# define PLATFORM_MAX_PATH MAX_PATH + HMODULE g_gfnSdkModule; + CHAR_TYPE g_cloudLibraryPath[PLATFORM_MAX_PATH]; +#elif __linux__ +# include // time functions for log prints +# include // PATH_MAX +# include // stat +# include // stat +# include // dlopen +# include // dirname +# include // readlink +# define GFN_SHARED_OBJECT "GfnSdk.so" +# define GFN_CLIENT_SHARED_LIBRARY "GfnRuntimeSdk.so" +# define GFN_SHARED_OBJECT_PATH "/opt/nvidia/GfnSdk/" GFN_SHARED_OBJECT +# define PLATFORM_MAX_PATH PATH_MAX + + void* g_gfnSdkModule = NULL; + CHAR_TYPE g_cloudLibraryPath[] = GFN_SHARED_OBJECT_PATH; +#else +# error "Unsupported platform" +#endif // Set compile flag GFN_SDK_WRAPPER_LOG to enable simple logging #ifdef GFN_SDK_WRAPPER_LOG @@ -42,7 +78,11 @@ typedef struct gfnLogData { char buffer[kGfnLogBufLen]; +#if _WIN32 SYSTEMTIME timeBuffer; +#elif __linux__ + struct tm timeBuffer; +#endif } gfnLogData; static gfnLogData s_logData; static FILE* s_logfile = NULL; @@ -56,17 +96,8 @@ #endif bool g_LoggingInitialized = false; -#ifdef _WIN32 -# include -# include -# ifdef _WIN64 -# define GFN_DLL L"GFN_V2.dll" -# else -# define GFN_DLL L"GFN32_V2.dll" -# endif -# define GFN_DLL_SUBPATH L"\\NVIDIA Corporation\\GeForceNOW\\SDK\\" GFN_DLL - -HMODULE g_gfnSdkModule; +// Function declarations +GfnRuntimeError GfnInitializeSdkFromPathDefault(GfnDisplayLanguage language, const CHAR_TYPE* sdkLibraryPath); // Generic callback function pointer used to wrap the typed callbacks typedef void (GFN_CALLBACK* _cb)(int, void* pOptionalData, void* pContext); @@ -113,6 +144,7 @@ typedef GfnRuntimeError(*gfnRegisteCallbackFnWithUIntParam)(_cb callback, unsign typedef GfnRuntimeError(*gfnAppReadyFn)(bool success, const char* status); typedef GfnRuntimeError (*gfnSetActionZoneFn)(GfnActionType type, unsigned int id, GfnRect* zone); typedef GfnRuntimeError(*gfnSendMessageFn)(const char* pchMessage, unsigned int length); + typedef struct GfnSdkCloudLibrary_t { void* handle; @@ -147,15 +179,13 @@ typedef struct GfnSdkCloudLibrary_t gfnRegisterCallbackFn RegisterMessageCallback; gfnGetSessionInfoFn GetSessionInfo; - } GfnSdkCloudLibrary; GfnSdkCloudLibrary* g_pCloudLibrary = NULL; -wchar_t g_cloudDllPath[MAX_PATH]; GfnRuntimeError g_cloudLibraryStatus = gfnAPINotInit; -#ifdef _WIN32 inline bool GfnUtf8ToWide(const char* in, wchar_t* out, int outSize) { +#ifdef _WIN32 int result = MultiByteToWideChar(CP_UTF8, 0, in, -1, NULL, 0); if (result <= 0 || outSize < result) { @@ -168,10 +198,14 @@ inline bool GfnUtf8ToWide(const char* in, wchar_t* out, int outSize) return false; } return true; +#elif __linux__ + return false; +#endif } inline bool GfnWideToUtf8(const wchar_t* in, char* out, int outSize) { +#ifdef _WIN32 int length = WideCharToMultiByte(CP_UTF8, 0, in, -1, NULL, 0, NULL, NULL); if (length <= 0 || outSize < length) { @@ -183,21 +217,30 @@ inline bool GfnWideToUtf8(const wchar_t* in, char* out, int outSize) return false; } return true; +#elif __linux__ + return false; +#endif } + +static void gfnFreeLibrary(void* library) +{ +#ifdef _WIN32 + FreeLibrary(library); +#elif __linux__ + dlclose(library); #endif +} static void gfnFreeCloudLibrary(GfnSdkCloudLibrary* pCloudLibrary) { -#ifdef _WIN32 if (pCloudLibrary != NULL) { if (pCloudLibrary->handle) { - FreeLibrary((HMODULE)pCloudLibrary->handle); + gfnFreeLibrary(pCloudLibrary->handle); } free(pCloudLibrary); } -#endif } static GfnRuntimeError gfnTranslateCloudStatus(int status) @@ -222,6 +265,150 @@ GfnRuntimeError gfnShutDownCloudSdk(void) return gfnSuccess; } +bool gfnPathExists(const CHAR_TYPE* path) +{ +#ifdef _WIN32 + return (PathFileExistsW(path) != FALSE); +#elif __linux__ + struct stat buffer; + return (stat(path, &buffer) == 0); +#endif +} + +const CHAR_TYPE* gfnGetFilenameFromPath(const CHAR_TYPE* path) +{ +#ifdef _WIN32 + CHAR_TYPE *lastBackSepPos = wcsrchr(path, L'/'); + CHAR_TYPE *lastForeSepPos = wcsrchr(path, L'\\'); +#elif __linux__ + CHAR_TYPE *lastBackSepPos = strrchr(path, '/'); + CHAR_TYPE *lastForeSepPos = strrchr(path, '\\'); +#endif + + CHAR_TYPE* lastSepPos = (lastBackSepPos != NULL && lastBackSepPos > lastForeSepPos) ? lastBackSepPos : lastForeSepPos; + + if (lastSepPos == NULL) + { + return path; + } + else + { + return lastSepPos + 1; + } +} + +// This is case sensitive for POSIX, insensitive for WIN32 +bool gfnPathEqual(const CHAR_TYPE* path1, const CHAR_TYPE* path2) +{ +#ifdef _WIN32 + return _wcsicmp(path1, path2) == 0; +#elif __linux__ + return strcmp(path1, path2) == 0; +#endif +} + +void* gfnLoadLibrary(const CHAR_TYPE* path) +{ + // For security reasons, it is preferred to check the digital signature before loading the DLL. + // Such code is not provided here to reduce code complexity and library size, and in favor of + // any internal libraries built for this purpose. +#ifdef _WIN32 +# ifdef _DEBUG + return LoadLibraryW(path); +# else + return gfnSecureLoadCloudLibraryW(path, 0); +# endif +#elif __linux__ + return dlopen(path, RTLD_LAZY); +#endif +} + +void* gfnGetSymbol(void* library, char* name) +{ +#ifdef _WIN32 + return (void*)GetProcAddress((HMODULE)library, name); +#elif __linux__ + return dlsym(library, name); +#endif +} + +GfnRuntimeError gfnGetDefaultClientLibraryPath(CHAR_TYPE* path) +{ +#ifdef _WIN32 + wchar_t* filename = (wchar_t*)malloc(sizeof(wchar_t) * PLATFORM_MAX_PATH); + DWORD pathSize = GetModuleFileNameW(NULL, filename, PLATFORM_MAX_PATH); + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + free(filename); + filename = (wchar_t*)malloc(sizeof(wchar_t) * (pathSize + 1)); //Room for \0 + if (!filename) + { + return gfnInternalError; + } + pathSize = GetModuleFileNameW(NULL, filename, pathSize + 1); + } + + wchar_t* lastSepPos = wcsrchr(filename, L'\\'); + size_t pathLength = lastSepPos - filename + 1; + size_t dllPathLength = pathLength + 18; // "GfnRuntimeSdk.dll\0" + + if (!path) + { + free(filename); + return gfnInternalError; + } + wcsncpy_s(path, dllPathLength, filename, _TRUNCATE); + + path[pathLength] = L'\0'; + free(filename); + wcsncat_s(path, dllPathLength, L"GfnRuntimeSdk.dll", 17); +#elif __linux__ + char buffer[PLATFORM_MAX_PATH]; + ssize_t len; + + // Get the absolute path of the executable + len = readlink("/proc/self/exe", buffer, sizeof(buffer) - 1); + + // Check for errors + if (len == -1) { + return gfnInternalError; + } + + // Null-terminate the string + buffer[len] = '\0'; + + // Get the directory path, excluding the executable name + char* directory = dirname(buffer); + strncpy(path, directory, PLATFORM_MAX_PATH); + + // Append "GfnRuntimeSdk.so" to the directory path + if (strlen(path) + strlen("/" GFN_CLIENT_SHARED_LIBRARY) + 1 > PLATFORM_MAX_PATH) { + GFN_SDK_LOG("ERROR: Could not get default client library path name: Path too long"); + return gfnInternalError; + } + + strcat(path, "/GfnRuntimeSdk.so"); +#endif + return gfnSuccess; +} + +// Places the null terminator where the path ends +GfnRuntimeError gfnStripFilename(char* path) +{ + char *lastBackSepPos = strrchr(path, '/'); + char *lastForeSepPos = strrchr(path, '\\'); + char* lastSepPos = (lastBackSepPos != NULL && lastBackSepPos > lastForeSepPos) ? lastBackSepPos : lastForeSepPos; + if (lastSepPos) + { + *lastSepPos = '\0'; + } + else + { + return gfnInvalidParameter; + } + return gfnSuccess; +} + GfnRuntimeError gfnLoadCloudLibrary(GfnSdkCloudLibrary** ppCloudLibrary) { // If we've already attempted to load this, return the previous results and library @@ -234,9 +421,9 @@ GfnRuntimeError gfnLoadCloudLibrary(GfnSdkCloudLibrary** ppCloudLibrary) *ppCloudLibrary = NULL; #ifdef _WIN32 - if (SHGetSpecialFolderPathW(NULL, g_cloudDllPath, CSIDL_PROGRAM_FILES, false) == TRUE) + if (SHGetSpecialFolderPathW(NULL, g_cloudLibraryPath, CSIDL_PROGRAM_FILES, false) == TRUE) { - if (wcscat_s(g_cloudDllPath, MAX_PATH, GFN_DLL_SUBPATH) != 0) + if (wcscat_s(g_cloudLibraryPath, PLATFORM_MAX_PATH, GFN_DLL_SUBPATH) != 0) { GFN_SDK_LOG("FAIL: Unable to concatenate path to Runtime SDK binaries"); return gfnInitFailure; @@ -247,21 +434,18 @@ GfnRuntimeError gfnLoadCloudLibrary(GfnSdkCloudLibrary** ppCloudLibrary) GFN_SDK_LOG("FAIL: Unable to get path to Runtime SDK binaries"); return gfnInitFailure; } +#endif // _WIN32 - if (PathFileExistsW(g_cloudDllPath) == FALSE) + if (!gfnPathExists(g_cloudLibraryPath)) { GFN_SDK_LOG("SUCCESS: Cloud library does not exist, this is running on the user client"); return gfnCloudLibraryNotFound; } -#ifdef _DEBUG - HMODULE library = LoadLibraryW(g_cloudDllPath); -#else - HMODULE library = gfnSecureLoadCloudLibraryW(g_cloudDllPath, 0); -#endif - + void* library = gfnLoadLibrary(g_cloudLibraryPath); if (!library) { +#ifdef _WIN32 DWORD lastError = GetLastError(); if (lastError == CRYPT_E_NO_MATCH) { @@ -273,50 +457,52 @@ GfnRuntimeError gfnLoadCloudLibrary(GfnSdkCloudLibrary** ppCloudLibrary) GFN_SDK_LOG("ERROR: GFN library is present but unable to be loaded! LastError=0x%08X", lastError); return gfnInitFailure; } +#elif __linux__ + GFN_SDK_LOG("GFN library is present but unable to be loaded! dlerror=%s", dlerror()); + return gfnInitFailure; +#endif } GfnSdkCloudLibrary* pCloudLibrary = (GfnSdkCloudLibrary*)malloc(sizeof(GfnSdkCloudLibrary)); if (pCloudLibrary == NULL) { GFN_SDK_LOG("ERROR: Unable to allocate memory to hold GFN function pointers"); -#ifdef _WIN32 - FreeLibrary(library); -#endif + gfnFreeLibrary(library); return gfnUnableToAllocateMemory; } pCloudLibrary->handle = library; // Old Initialization method. Deprecate when all libraries have updated to 1.7.1 or greater. - pCloudLibrary->InitializeRuntimeSdk = (gfnCloudInitializeRuntimeSdkFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnInitializeRuntimeSdk2"); - pCloudLibrary->InitializeRuntimeSdkV3 = (gfnCloudInitializeRuntimeSdkV3Fn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnInitializeRuntimeSdk3"); - pCloudLibrary->ShutdownRuntimeSdk = (gfnCloudShutdownRuntimeSdkFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnShutdownRuntimeSdk2"); - pCloudLibrary->IsInitialized = (gfnIsInitializedFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnIsInitialized"); - pCloudLibrary->IsRunningInCloud = (gfnIsRunningInCloudFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnIsRunningInCloud"); - pCloudLibrary->IsRunningInCloudSecure = (gfnIsRunningInCloudSecureFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnIsRunningInCloudSecure"); - pCloudLibrary->IsTitleAvailable = (gfnIsTitleAvailableFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnIsTitleAvailable"); - pCloudLibrary->GetTitlesAvailable = (gfnGetTitlesAvailableFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnGetTitlesAvailable"); - pCloudLibrary->SetupTitle = (gfnSetupTitleFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnSetupTitle"); - pCloudLibrary->TitleExited = (gfnTitleExitedFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnTitleExited"); - pCloudLibrary->GetClientIp = (gfnGetClientIpFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnGetClientIp"); - pCloudLibrary->GetClientLanguageCode = (gfnGetClientLanguageCodeFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnGetClientLanguageCode"); - pCloudLibrary->GetClientCountryCode = (gfnGetClientCountryCodeFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnGetClientCountryCode"); - pCloudLibrary->GetPartnerData = (gfnGetPartnerDataFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnGetPartnerData"); - pCloudLibrary->GetPartnerSecureData = (gfnGetPartnerSecureDataFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnGetPartnerSecureData"); - pCloudLibrary->Free = (gfnFreeFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnFree"); - pCloudLibrary->AppReady = (gfnAppReadyFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnAppReady"); - pCloudLibrary->SetActionZone = (gfnSetActionZoneFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnSetActionZone"); - pCloudLibrary->SendMessage = (gfnSendMessageFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnSendCustomMessageToClient"); - pCloudLibrary->RegisterExitCallback = (gfnRegisterCallbackFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnRegisterExitCallback"); - pCloudLibrary->RegisterPauseCallback = (gfnRegisterCallbackFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnRegisterPauseCallback"); - pCloudLibrary->RegisterInstallCallback = (gfnRegisterCallbackFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnRegisterInstallCallback"); - pCloudLibrary->RegisterSaveCallback = (gfnRegisterCallbackFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnRegisterSaveCallback"); - pCloudLibrary->RegisterSessionInitCallback = (gfnRegisterCallbackFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnRegisterSessionInitCallback"); - - pCloudLibrary->GetClientInfo = (gfnGetClientInfoFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnGetClientInfo"); - pCloudLibrary->RegisterClientInfoCallback = (gfnRegisterCallbackFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnRegisterClientInfoCallback"); - pCloudLibrary->RegisterNetworkStatusCallback = (gfnRegisteCallbackFnWithUIntParam)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnRegisterNetworkStatusCallback"); - pCloudLibrary->RegisterMessageCallback = (gfnRegisterCallbackFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnRegisterCustomMessageCallback"); - pCloudLibrary->GetSessionInfo = (gfnGetSessionInfoFn)(void*)GetProcAddress((HMODULE)pCloudLibrary->handle, "gfnGetSessionInfo"); + pCloudLibrary->InitializeRuntimeSdk = (gfnCloudInitializeRuntimeSdkFn)gfnGetSymbol(pCloudLibrary->handle, "gfnInitializeRuntimeSdk2"); + pCloudLibrary->InitializeRuntimeSdkV3 = (gfnCloudInitializeRuntimeSdkV3Fn)gfnGetSymbol(pCloudLibrary->handle, "gfnInitializeRuntimeSdk3"); + pCloudLibrary->ShutdownRuntimeSdk = (gfnCloudShutdownRuntimeSdkFn)gfnGetSymbol(pCloudLibrary->handle, "gfnShutdownRuntimeSdk2"); + pCloudLibrary->IsInitialized = (gfnIsInitializedFn)gfnGetSymbol(pCloudLibrary->handle, "gfnIsInitialized"); + pCloudLibrary->IsRunningInCloud = (gfnIsRunningInCloudFn)gfnGetSymbol(pCloudLibrary->handle, "gfnIsRunningInCloud"); + pCloudLibrary->IsRunningInCloudSecure = (gfnIsRunningInCloudSecureFn)gfnGetSymbol(pCloudLibrary->handle, "gfnIsRunningInCloudSecure"); + pCloudLibrary->IsTitleAvailable = (gfnIsTitleAvailableFn)gfnGetSymbol(pCloudLibrary->handle, "gfnIsTitleAvailable"); + pCloudLibrary->GetTitlesAvailable = (gfnGetTitlesAvailableFn)gfnGetSymbol(pCloudLibrary->handle, "gfnGetTitlesAvailable"); + pCloudLibrary->SetupTitle = (gfnSetupTitleFn)gfnGetSymbol(pCloudLibrary->handle, "gfnSetupTitle"); + pCloudLibrary->TitleExited = (gfnTitleExitedFn)gfnGetSymbol(pCloudLibrary->handle, "gfnTitleExited"); + pCloudLibrary->GetClientIp = (gfnGetClientIpFn)gfnGetSymbol(pCloudLibrary->handle, "gfnGetClientIp"); + pCloudLibrary->GetClientLanguageCode = (gfnGetClientLanguageCodeFn)gfnGetSymbol(pCloudLibrary->handle, "gfnGetClientLanguageCode"); + pCloudLibrary->GetClientCountryCode = (gfnGetClientCountryCodeFn)gfnGetSymbol(pCloudLibrary->handle, "gfnGetClientCountryCode"); + pCloudLibrary->GetPartnerData = (gfnGetPartnerDataFn)gfnGetSymbol(pCloudLibrary->handle, "gfnGetPartnerData"); + pCloudLibrary->GetPartnerSecureData = (gfnGetPartnerSecureDataFn)gfnGetSymbol(pCloudLibrary->handle, "gfnGetPartnerSecureData"); + pCloudLibrary->Free = (gfnFreeFn)gfnGetSymbol(pCloudLibrary->handle, "gfnFree"); + pCloudLibrary->AppReady = (gfnAppReadyFn)gfnGetSymbol(pCloudLibrary->handle, "gfnAppReady"); + pCloudLibrary->SetActionZone = (gfnSetActionZoneFn)gfnGetSymbol(pCloudLibrary->handle, "gfnSetActionZone"); + pCloudLibrary->SendMessage = (gfnSendMessageFn)gfnGetSymbol(pCloudLibrary->handle, "gfnSendCustomMessageToClient"); + pCloudLibrary->RegisterExitCallback = (gfnRegisterCallbackFn)gfnGetSymbol(pCloudLibrary->handle, "gfnRegisterExitCallback"); + pCloudLibrary->RegisterPauseCallback = (gfnRegisterCallbackFn)gfnGetSymbol(pCloudLibrary->handle, "gfnRegisterPauseCallback"); + pCloudLibrary->RegisterInstallCallback = (gfnRegisterCallbackFn)gfnGetSymbol(pCloudLibrary->handle, "gfnRegisterInstallCallback"); + pCloudLibrary->RegisterSaveCallback = (gfnRegisterCallbackFn)gfnGetSymbol(pCloudLibrary->handle, "gfnRegisterSaveCallback"); + pCloudLibrary->RegisterSessionInitCallback = (gfnRegisterCallbackFn)gfnGetSymbol(pCloudLibrary->handle, "gfnRegisterSessionInitCallback"); + + pCloudLibrary->GetClientInfo = (gfnGetClientInfoFn)gfnGetSymbol(pCloudLibrary->handle, "gfnGetClientInfo"); + pCloudLibrary->RegisterClientInfoCallback = (gfnRegisterCallbackFn)gfnGetSymbol(pCloudLibrary->handle, "gfnRegisterClientInfoCallback"); + pCloudLibrary->RegisterNetworkStatusCallback = (gfnRegisteCallbackFnWithUIntParam)gfnGetSymbol(pCloudLibrary->handle, "gfnRegisterNetworkStatusCallback"); + pCloudLibrary->RegisterMessageCallback = (gfnRegisterCallbackFn)gfnGetSymbol(pCloudLibrary->handle, "gfnRegisterCustomMessageCallback"); + pCloudLibrary->GetSessionInfo = (gfnGetSessionInfoFn)gfnGetSymbol(pCloudLibrary->handle, "gfnGetSessionInfo"); GFN_SDK_LOG("Successfully loaded cloud libary"); @@ -329,7 +515,6 @@ GfnRuntimeError gfnLoadCloudLibrary(GfnSdkCloudLibrary** ppCloudLibrary) *ppCloudLibrary = pCloudLibrary; -#endif // _WIN32 return gfnSuccess; } @@ -432,40 +617,21 @@ GfnRuntimeError GfnInitializeSdk(GfnDisplayLanguage language) } else { - wchar_t* filename = (wchar_t*)malloc(sizeof(wchar_t) * MAX_PATH); + CHAR_TYPE* filename = (CHAR_TYPE*)malloc(sizeof(CHAR_TYPE) * PLATFORM_MAX_PATH); if (!filename) { return gfnInternalError; } - DWORD pathSize = GetModuleFileNameW(NULL, filename, MAX_PATH); - if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - free(filename); - filename = (wchar_t*)malloc(sizeof(wchar_t) * (pathSize + 1)); //Room for \0 - if (!filename) - { - return gfnInternalError; - } - pathSize = GetModuleFileNameW(NULL, filename, pathSize + 1); - } - wchar_t* lastSepPos = wcsrchr(filename, L'\\'); - size_t pathLength = lastSepPos - filename + 1; - size_t dllPathLength = pathLength + 18; // "GfnRuntimeSdk.dll\0" - wchar_t* dllPath = (wchar_t*)malloc(sizeof(wchar_t) * dllPathLength); - if (!dllPath) + GfnRuntimeError err = gfnGetDefaultClientLibraryPath(filename); + if (GFNSDK_FAILED(err)) { free(filename); - return gfnInternalError; + return err; } - wcsncpy_s(dllPath, dllPathLength, filename, _TRUNCATE); - dllPath[pathLength] = L'\0'; + clientStatus = GfnInitializeSdkFromPathDefault(language, filename); free(filename); - wcsncat_s(dllPath, dllPathLength, L"GfnRuntimeSdk.dll", 17); - - clientStatus = GfnInitializeSdkFromPathW(language, dllPath); - free(dllPath); } if (GFNSDK_FAILED(clientStatus)) @@ -477,35 +643,9 @@ GfnRuntimeError GfnInitializeSdk(GfnDisplayLanguage language) return clientStatus; } -GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char* sdkLibraryPath) -{ - if (sdkLibraryPath == NULL) - { - GFN_SDK_LOG("Invalid SDK library path"); - return gfnInvalidParameter; - } - - size_t libPathSize = strlen(sdkLibraryPath) + 1; - wchar_t* wSdkLibraryPath = (wchar_t*)malloc(libPathSize * sizeof(wchar_t)); - if (!wSdkLibraryPath) - { - GFN_SDK_LOG("Failed to allocate for SDK library path"); - return gfnUnableToAllocateMemory; - } - int outSize = (int)libPathSize * sizeof(wchar_t); - if (!GfnUtf8ToWide(sdkLibraryPath, wSdkLibraryPath, outSize)) - { - GFN_SDK_LOG("Failed to convert SDK library path"); - free(wSdkLibraryPath); - return gfnInternalError; - } - - GfnError status = GfnInitializeSdkFromPathW(language, wSdkLibraryPath); - free(wSdkLibraryPath); - return status; -} - -GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wchar_t* wSdkLibraryPath) +// On WIN32, this accepts a wide char string. +// On all other platforms, this accepts a UTF-8 string. +GfnRuntimeError GfnInitializeSdkFromPathDefault(GfnDisplayLanguage language, const CHAR_TYPE* sdkLibraryPath) { // If "client" library is already initialized, then we're good to go. if (g_gfnSdkModule != NULL) @@ -521,16 +661,14 @@ GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wch g_LoggingInitialized = true; } - wchar_t* lastBackSepPos = wcsrchr(wSdkLibraryPath, L'\\'); - wchar_t* lastForeSepPos = wcsrchr(wSdkLibraryPath, L'/'); - wchar_t* lastSepPos = (lastBackSepPos != NULL && lastBackSepPos > lastForeSepPos) ? lastBackSepPos : lastForeSepPos; - if (_wcsicmp((lastBackSepPos == NULL && lastForeSepPos == NULL) ? wSdkLibraryPath : lastSepPos + 1, L"GfnRuntimeSdk.dll") != 0) + const CHAR_TYPE* filename = gfnGetFilenameFromPath(sdkLibraryPath); + if (!filename || !gfnPathEqual(filename, GFN_CLIENT_SHARED_LIBRARY)) { GFN_SDK_LOG("Invalid SDK library name"); return gfnInvalidParameter; } - if (PathFileExistsW(wSdkLibraryPath) == FALSE) + if (!gfnPathExists(sdkLibraryPath)) { clientStatus = gfnClientLibraryNotFound; } @@ -541,24 +679,24 @@ GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wch // For security reasons, it is preferred to check the digital signature before loading the DLL. // Such code is not provided here to reduce code complexity and library size, and in favor of // any internal libraries built for this purpose. -#ifdef _DEBUG - g_gfnSdkModule = LoadLibraryW(wSdkLibraryPath); + g_gfnSdkModule = gfnLoadLibrary(sdkLibraryPath); if (g_gfnSdkModule == NULL) { - GFN_SDK_LOG("Not able to load SDK library. LastError=0x%08X", GetLastError()); clientStatus = gfnClientLibraryNotFound; - } -#else - g_gfnSdkModule = gfnSecureLoadClientLibraryW(wSdkLibraryPath, 0); - if (g_gfnSdkModule == NULL) - { - GFN_SDK_LOG("Not able to securely load SDK library. LastError=0x%08X", GetLastError()); - clientStatus = gfnBinarySignatureInvalid; - } +#ifdef _WIN32 + DWORD lastError = GetLastError(); + if (lastError == CRYPT_E_NO_MATCH) + { + GFN_SDK_LOG("ERROR: GFN library failed to load due to invalid signature"); + clientStatus = gfnBinarySignatureInvalid; + } +#elif __linux__ + GFN_SDK_LOG("GFN client library is present but unable to be loaded! dlerror=%s", dlerror()); #endif + } else { - gfnInitializeRuntimeSdkFn fnGfnInitializeRuntimeSdk = (gfnInitializeRuntimeSdkFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnInitializeRuntimeSdk"); + gfnInitializeRuntimeSdkFn fnGfnInitializeRuntimeSdk = (gfnInitializeRuntimeSdkFn)gfnGetSymbol(g_gfnSdkModule, "gfnInitializeRuntimeSdk"); if (fnGfnInitializeRuntimeSdk == NULL) { clientStatus = gfnAPINotFound; @@ -613,6 +751,57 @@ GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wch return gfnSuccess; } +GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char* utf8SdkLibraryPath) +{ + if (utf8SdkLibraryPath == NULL) + { + GFN_SDK_LOG("Invalid SDK library path"); + return gfnInvalidParameter; + } + +#ifdef _WIN32 + // On windows, first convert to Unicode-16, then call the implementation. + size_t libPathSize = strlen(utf8SdkLibraryPath) + 1; + wchar_t* wSdkLibraryPath = (wchar_t*)malloc(libPathSize * sizeof(wchar_t)); + if (!wSdkLibraryPath) + { + GFN_SDK_LOG("Failed to allocate for SDK library path"); + return gfnUnableToAllocateMemory; + } + int outSize = (int)libPathSize * sizeof(wchar_t); + if (!GfnUtf8ToWide(utf8SdkLibraryPath, wSdkLibraryPath, outSize)) + { + GFN_SDK_LOG("Failed to convert SDK library path"); + free(wSdkLibraryPath); + return gfnInternalError; + } + + GfnError status = GfnInitializeSdkFromPathDefault(language, wSdkLibraryPath); + free(wSdkLibraryPath); + return status; +#elif __linux__ + // On linux, this is the default encoding. Directly call the implementation. + return GfnInitializeSdkFromPathDefault(language, utf8SdkLibraryPath); +#endif +} + +GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wchar_t* wSdkLibraryPath) +{ + if (wSdkLibraryPath == NULL) + { + GFN_SDK_LOG("Invalid SDK library path"); + return gfnInvalidParameter; + } + +#ifdef _WIN32 + // On windows, this is the default encoding. Directly call the implementation. + return GfnInitializeSdkFromPathDefault(language, wSdkLibraryPath); +#elif __linux__ + GFN_SDK_LOG("GfnInitializeSdkFromPathW is unsupported on linux"); + return gfnInvalidParameter; +#endif +} + GfnRuntimeError GfnShutdownSdk(void) { gfnShutDownCloudSdk(); @@ -623,7 +812,7 @@ GfnRuntimeError GfnShutdownSdk(void) return gfnSuccess; } - gfnShutdownRuntimeSdkFn fnGfnShutdownRuntimeSdk = (gfnShutdownRuntimeSdkFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnShutdownRuntimeSdk"); + gfnShutdownRuntimeSdkFn fnGfnShutdownRuntimeSdk = (gfnShutdownRuntimeSdkFn)gfnGetSymbol(g_gfnSdkModule, "gfnShutdownRuntimeSdk"); if (fnGfnShutdownRuntimeSdk == NULL) { return gfnAPINotFound; @@ -631,7 +820,7 @@ GfnRuntimeError GfnShutdownSdk(void) fnGfnShutdownRuntimeSdk(); - FreeLibrary(g_gfnSdkModule); + gfnFreeLibrary(g_gfnSdkModule); g_gfnSdkModule = NULL; GFN_SDK_DEINIT_LOGGING(); @@ -676,17 +865,23 @@ GfnRuntimeError GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance* assuranc return gfnAPINotInit; } - if (wcslen(g_cloudDllPath) == 0) +#ifdef _WIN32 + if (wcslen(g_cloudLibraryPath) == 0) +#elif __linux__ + if (strlen(g_cloudLibraryPath) == 0) +#endif { GFN_SDK_LOG("Cloud library path not defined, which denotes an API call without Initialize succeeding, treating as not in cloud"); return gfnSuccess; } - if (gfnCheckLibraryGfnSignatureW(g_cloudDllPath) == FALSE) +#ifdef _WIN32 + if (gfnCheckLibraryGfnSignatureW(g_cloudLibraryPath) == FALSE) { GFN_SDK_LOG("Cloud library path does not have valid GFN signing, treating as not in cloud"); return gfnSuccess; } +#endif if (g_pCloudLibrary == NULL) { @@ -863,7 +1058,7 @@ GfnRuntimeError GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamSt return gfnAPINotInit; } - gfnRegisterStreamStatusCallbackFn fnRegisterStreamStatusCallback = (gfnRegisterStreamStatusCallbackFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnRegisterStreamStatusCallback"); + gfnRegisterStreamStatusCallbackFn fnRegisterStreamStatusCallback = (gfnRegisterStreamStatusCallbackFn)gfnGetSymbol(g_gfnSdkModule, "gfnRegisterStreamStatusCallback"); if (fnRegisterStreamStatusCallback == NULL) { @@ -880,7 +1075,7 @@ GfnRuntimeError GfnStartStream(StartStreamInput * startStreamInput, StartStreamR return gfnAPINotInit; } - gfnStartStreamFn fnGfnStartStream = (gfnStartStreamFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnStartStream"); + gfnStartStreamFn fnGfnStartStream = (gfnStartStreamFn)gfnGetSymbol(g_gfnSdkModule, "gfnStartStream"); if (fnGfnStartStream == NULL) { @@ -897,7 +1092,7 @@ GfnRuntimeError GfnStartStreamAsync(const StartStreamInput* startStreamInput, St return gfnAPINotInit; } - gfnStartStreamAsyncFn fnGfnStartStreamAsync = (gfnStartStreamAsyncFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnStartStreamAsync"); + gfnStartStreamAsyncFn fnGfnStartStreamAsync = (gfnStartStreamAsyncFn)gfnGetSymbol(g_gfnSdkModule, "gfnStartStreamAsync"); if (fnGfnStartStreamAsync == NULL) { @@ -916,7 +1111,7 @@ GfnRuntimeError GfnStopStream(void) return gfnAPINotInit; } - gfnStopStreamFn fnGfnStopStream = (gfnStopStreamFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnStopStream"); + gfnStopStreamFn fnGfnStopStream = (gfnStopStreamFn)gfnGetSymbol(g_gfnSdkModule, "gfnStopStream"); if (fnGfnStopStream == NULL) { @@ -933,7 +1128,7 @@ GfnRuntimeError GfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsi return gfnAPINotInit; } - gfnStopStreamAsyncFn fnGfnStopStreamAsync = (gfnStopStreamAsyncFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnStopStreamAsync"); + gfnStopStreamAsyncFn fnGfnStopStreamAsync = (gfnStopStreamAsyncFn)gfnGetSymbol(g_gfnSdkModule, "gfnStopStreamAsync"); if (fnGfnStopStreamAsync == NULL) { @@ -984,7 +1179,7 @@ GfnRuntimeError GfnSendMessage(const char* pchMessage, unsigned int length) { return gfnAPINotInit; } - gfnSendMessageFn fnSendMessage = (gfnSendMessageFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnSendMessage"); + gfnSendMessageFn fnSendMessage = (gfnSendMessageFn)gfnGetSymbol(g_gfnSdkModule, "gfnSendMessage"); if (fnSendMessage == NULL) { @@ -1160,7 +1355,7 @@ GfnRuntimeError GfnRegisterMessageCallback(MessageCallbackSig messageCallback, v return gfnAPINotInit; } - gfnRegisterMessageCallbackFn fnRegisterMessageCallback = (gfnRegisterMessageCallbackFn)(void*)GetProcAddress(g_gfnSdkModule, "gfnRegisterMessageCallback"); + gfnRegisterMessageCallbackFn fnRegisterMessageCallback = (gfnRegisterMessageCallbackFn)gfnGetSymbol(g_gfnSdkModule, "gfnRegisterMessageCallback"); if (fnRegisterMessageCallback == NULL) { return gfnAPINotFound; @@ -1174,6 +1369,7 @@ GfnRuntimeError GfnRegisterMessageCallback(MessageCallbackSig messageCallback, v #ifdef GFN_SDK_WRAPPER_LOG void gfnInitLogging() { +#ifdef _WIN32 wchar_t localAppDataPath[1024] = { L"" }; if (SHGetSpecialFolderPathW(NULL, localAppDataPath, CSIDL_COMMON_APPDATA, false) == FALSE) { @@ -1188,6 +1384,10 @@ void gfnInitLogging() } wcscat_s(localAppDataPath, 1024, L"\\GfnRuntimeSdkWrapper.log"); _wfopen_s(&s_logfile, localAppDataPath, L"w+"); +#elif __linux__ + const char* logPath = "~/.nvidia/GfnRuntimeSdk/GfnRuntimeSdkWrapper.log"; + s_logfile = fopen(logPath, "r"); +#endif } void gfnDeinitLogging() @@ -1204,6 +1404,7 @@ void gfnLog(char const* func, int line, char const* format, ...) va_list args; va_start(args, format); +#ifdef _WIN32 // Format date and time GetLocalTime(&s_logData.timeBuffer); size_t n = sprintf_s(s_logData.buffer, 24, "%04d-%02d-%02dT%02d:%02d:%02d.%03d", s_logData.timeBuffer.wYear, s_logData.timeBuffer.wMonth, s_logData.timeBuffer.wDay, @@ -1219,20 +1420,45 @@ void gfnLog(char const* func, int line, char const* format, ...) n = kGfnLogBufLen - 2; } _snprintf_s(s_logData.buffer + n, kGfnLogBufLen - n, kGfnLogBufLen - n, "\n"); // Add linebreak at end +#elif __linux__ + // Format date and time + time_t t = time(NULL); + localtime_r(&t, &s_logData.timeBuffer); + + size_t n = snprintf(s_logData.buffer, 24, "%04d-%02d-%02dT%02d:%02d:%02d.%03d", + s_logData.timeBuffer.tm_year + 1900, + s_logData.timeBuffer.tm_mon + 1, + s_logData.timeBuffer.tm_mday, + s_logData.timeBuffer.tm_hour, + s_logData.timeBuffer.tm_min, + s_logData.timeBuffer.tm_sec, + 0); + + // Format function, line number + n += snprintf(s_logData.buffer + n, kGfnLogBufLen - n, " %24.24s:%-5d", func, line); + + // Format the actual message/format + n += vsnprintf(s_logData.buffer + n, kGfnLogBufLen - n - 2, format, args); + if (kGfnLogBufLen - 2 < n) // returns amount it WOULD have written if buffer were big enough + { + n = kGfnLogBufLen - 2; + } + + // Add linebreak at end + snprintf(s_logData.buffer + n, kGfnLogBufLen - n, "\n"); +#endif if (s_logfile) { - fprintf(s_logfile, s_logData.buffer); + fputs(s_logData.buffer, s_logfile); fflush(s_logfile); } else { - fprintf(stderr, s_logData.buffer); + fputs(s_logData.buffer, stderr); fflush(stderr); } va_end(args); } #endif // GFN_SDK_WRAPPER_LOG - -#endif //end Win32 diff --git a/include/GfnRuntimeSdk_Wrapper.h b/include/GfnRuntimeSdk_Wrapper.h index c6a081b..4bd3ec0 100644 --- a/include/GfnRuntimeSdk_Wrapper.h +++ b/include/GfnRuntimeSdk_Wrapper.h @@ -233,13 +233,18 @@ #include "GfnRuntimeSdk_CAPI.h" +#include + #ifdef _WIN32 + #define CHAR_TYPE wchar_t #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include /// @brief Global handle to loaded GFN SDK Library module extern HMODULE g_gfnSdkModule; +#elif __linux__ + #define CHAR_TYPE char #endif #ifdef __cplusplus @@ -258,6 +263,9 @@ extern "C" /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call as soon as possible during application startup. @@ -277,18 +285,21 @@ extern "C" #define GfnInitializeSdkFromPath GfnInitializeSdkFromPathA /// @par Description - /// Loads the GFN SDK dynamic library from the given path and calls @ref gfnInitializeRuntimeSdk. + /// Loads the GFN SDK dynamic library from the given path and calls @ref gfnInitializeRuntimeSdk. (UTF-8 / ASCII version) /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call as soon as possible during application startup. /// /// @param language - Language to use for any UI, such as GFN download and install progress dialogs. /// Defaults to system language if not defined. - /// @param sdkLibraryPath - Fully-quantified path to GFN SDK Library including the name GfnRuntimeSdk.dll, - /// note that dll cannot be renamed to any other string. + /// @param sdkLibraryPath - Fully-quantified path to GFN SDK library file including the library filename, + /// note that for security reasons, library cannot be renamed to any other string. /// @retval gfnSuccess - If the SDK was initialized and all SDK features are available. /// @retval gfnInitSuccessClientOnly - If the SDK was initialized, but only client-side functionality is available, such as /// calls to gfnStartStream. By definition, gfnIsRunningInCloud is expected to return false @@ -299,18 +310,21 @@ extern "C" GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char* sdkLibraryPath); /// @par Description - /// Loads the GFN SDK dynamic library from the given path and calls @ref gfnInitializeRuntimeSdk. + /// Loads the GFN SDK dynamic library from the given path and calls @ref gfnInitializeRuntimeSdk. (Wide char version) /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call as soon as possible during application startup. /// /// @param language - Language to use for any UI, such as GFN download and install progress dialogs. /// Defaults to system language if not defined. - /// @param wSdkLibraryPath - Wide Char string with Fully-quantified path to GFN SDK Library including the - /// name GfnRuntimeSdk.dll, note that dll cannot be renamed to any other string. + /// @param wSdkLibraryPath - Wide Char string with fully-quantified path to GFN SDK library file including the library + /// filename, note that for security reasons, library cannot be renamed to any other string. /// @retval gfnSuccess - If the SDK was initialized and all SDK features are available. /// @retval gfnInitSuccessClientOnly - If the SDK was initialized, but only client-side functionality is available, such as /// calls to gfnStartStream. By definition, gfnIsRunningInCloud is expected to return false @@ -327,6 +341,9 @@ extern "C" /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call during application shutdown or when GFN Runtime API methods are no longer needed. @@ -341,6 +358,9 @@ extern "C" /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to quickly determine whether to enable / disable any low-value GFN cloud environment @@ -372,6 +392,9 @@ extern "C" /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Call from an NVIDIA-approved process to securely determine whether running in GFN cloud, and use the @@ -400,6 +423,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this during application start or from the platform client in @@ -424,6 +450,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this during application start or from the platform client in @@ -447,6 +476,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this during application start or from the platform client in order to get @@ -468,6 +500,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this during application start or from the platform client in order to get @@ -495,6 +530,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Call this from a streaming session to find out more information about the session, such @@ -522,11 +560,15 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use during cloud session to retrieve partner data /// - /// @param partnerData - Populated with the partner data, if found. Call @ref GfnFree to free the memory. + /// @param partnerData - Populated with the partner data in string form if found + /// Call @ref GfnFree to free the memory /// /// @retval gfnSuccess - Partner data successfully retrieved from session data /// @retval gfnNoData - No partner data found in session data @@ -545,11 +587,15 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use during cloud session to retrieve secure partner data /// - /// @param partnerSecureData - Populated with the secure partner data, if found. Call @ref GfnFree to free the memory. + /// @param partnerSecureData - Populated with the secure partner data in string for if found + /// Call @ref GfnFree to free the memory /// /// @retval gfnSuccess - Secure partner data successfully retrieved from session data /// @retval gfnNoData - No secure partner data found in session data @@ -568,6 +614,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to determine if a title is available to be launched from the active GFN cloud instance, @@ -594,6 +643,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to retrieve a list of all titles available to launch in the current streaming session, @@ -619,6 +671,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to release memory after a call to a memory-allocated function and you are finished with the data. @@ -639,6 +694,9 @@ extern "C" /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Register a function to call when stream status changes on the user's client PC @@ -661,6 +719,9 @@ extern "C" /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Use to start a streaming session. @@ -683,6 +744,9 @@ extern "C" /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Use to start a streaming session. @@ -710,6 +774,9 @@ extern "C" /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Use to stop a streaming session started by the same process @@ -728,6 +795,9 @@ extern "C" /// /// @par Environment /// Client + /// + /// @par Platform + /// Windows /// /// @par Usage /// Use to start a streaming session. @@ -754,6 +824,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to prepare an application for launch on Geforce NOW, and block on the result. @@ -774,6 +847,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to notify GFN that your application has exited. @@ -795,6 +871,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Register an application function to call when Geforce NOW needs to exit the game. @@ -819,6 +898,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Register an application function to call when Geforce NOW needs to pause the game. @@ -843,6 +925,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Register a function to call after a successful call to gfnSetupTitle. @@ -868,6 +953,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Register an application function to call when GFN needs the application to save @@ -888,6 +976,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Register an application function to call when a GFN user has connected to the game seat @@ -910,6 +1001,9 @@ extern "C" /// /// @par Environment /// Cloud and Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Provide a callback function that will be called when a message is sent to the application. @@ -932,6 +1026,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @param clientInfoCallback - Function pointer to application code to call when GFN client data changes /// @@ -947,6 +1044,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @param networkStatusCallback - Function pointer to application code to call when network latency changes /// @param updateRateMs - Time interval for updates @@ -964,6 +1064,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to notify GFN that your application is ready to be streamed. @@ -985,6 +1088,9 @@ extern "C" /// /// @par Environment /// Cloud + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to invoke special events on the client from the GFN cloud environment @@ -1014,18 +1120,21 @@ extern "C" /// /// @par Environment /// Cloud or Client + /// + /// @par Platform + /// Windows, Linux /// /// @par Usage /// Use to communicate between cloud applications and streaming clients. /// /// @param pchMessage - Character string - /// @param length - Length of pchMessage in characters + /// @param length - Length of pchMessage in characters, which cannot exceed 8K in length /// /// @retval gfnSuccess - Call was successful /// @retval gfnComError - There was SDK internal communication error /// @retval gfnInitFailure - SDK was not initialized - /// @retval gfnInvalidParameter - Invalid parameters provided - /// @retval gfnThrottled - API call was throttled for exceeding limit + /// @retval gfnInvalidParameter - Invalid parameters provided, or message exceeded allowed length + /// @retval gfnThrottled - API call was throttled for exceeding limit of 30 messages per second /// @retval gfnUnhandledException - API ran into an unhandled error and caught an exception before it returned to client code /// @retval gfnCloudLibraryNotFound - GFN SDK cloud-side library could not be found /// @return Otherwise, appropriate error code diff --git a/include/GfnSdk.h b/include/GfnSdk.h index 06e9c29..0125c86 100644 --- a/include/GfnSdk.h +++ b/include/GfnSdk.h @@ -80,28 +80,28 @@ typedef char bool; #define NVGFNSDK_VERSION_MAJOR 2 /// @brief GFN SDK Minor Version -#define NVGFNSDK_VERSION_MINOR 0 +#define NVGFNSDK_VERSION_MINOR 1 /// @brief GFN SDK Version -#define NVGFNSDK_VERSION_SHORT 2.0 +#define NVGFNSDK_VERSION_SHORT 2.1 /// @brief GFN SDK Patch Version #define NVGFNSDK_VERSION_PATCH 0 /// @brief GFN SDK Build Version -#define NVGFNSDK_VERSION_BUILD 33103756 +#define NVGFNSDK_VERSION_BUILD 33843515 /// @brief GFN SDK Version -#define NVGFNSDK_VERSION_LONG 2.0.0.33103756 +#define NVGFNSDK_VERSION_LONG 2.1.0.33843515 /// @brief GFN SDK Version string -#define NVGFNSDK_VERSION_STR "2.0.0.33103756" -#define NVGFNSDK_VERSION_STR_PROD "2.0.0" +#define NVGFNSDK_VERSION_STR "2.1.0.33843515" +#define NVGFNSDK_VERSION_STR_PROD "2.1.0" /// @brief GFN SDK Build CL -#define NVGFNSDK_VERSION_BUILDCL 33103756 -#define NVGFNSDK_VERSION_BUILDH 3310 -#define NVGFNSDK_VERSION_BUILDL 3756 +#define NVGFNSDK_VERSION_BUILDCL 33843515 +#define NVGFNSDK_VERSION_BUILDH 3384 +#define NVGFNSDK_VERSION_BUILDL 3515 #ifdef __cplusplus @@ -146,7 +146,9 @@ typedef char bool; gfnBinarySignatureInvalid = -26, ///< An attempt to load a binary failed because the digital signature was found to be invalid gfnCloudLibraryNotFound = -27, ///< Necessary GFN cloud-based SDK library cannot be found gfnClientLibraryNotFound = -28, ///< Necessary GFN client-based SDK library cannot be found - gfnNoData = -29 ///< Requested data is empty or doesn't exist + gfnNoData = -29, ///< Requested data is empty or doesn't exist + gfnNotAuthorized = -30, ///= 0; } @@ -176,7 +178,7 @@ typedef char bool; /// /// @retval true - GfnRuntimeError value indicates failure /// @retval false - GfnRuntimeError value indicates success - inline bool GFNSDK_FAILED(GfnError code) + static inline bool GFNSDK_FAILED(GfnError code) { return code < 0; } diff --git a/include/GfnSdk_SecureLoadLibrary.c b/include/GfnSdk_SecureLoadLibrary.c index 9f6f3ad..593364b 100644 --- a/include/GfnSdk_SecureLoadLibrary.c +++ b/include/GfnSdk_SecureLoadLibrary.c @@ -778,25 +778,6 @@ static BOOL gfnInteralPreloadCryptDlls() return ret; } -static BOOL gfnInteralGetSignerInfoTimeStamp(PCMSG_SIGNER_INFO pSignerInfo, FILETIME* pFiletime) -{ -#ifndef szOID_RSA_signingTime -#define szOID_RSA_signingTime "1.2.840.113549.1.9.5" -#endif - DWORD dwSize = sizeof(FILETIME), n; - for (n = 0; n < pSignerInfo->AuthAttrs.cAttr; n++) - { - if (lstrcmpA(pSignerInfo->AuthAttrs.rgAttr[n].pszObjId, szOID_RSA_signingTime)) - continue; - - return pfnCryptDecodeObjectEx(ENCODING, szOID_RSA_signingTime, - pSignerInfo->AuthAttrs.rgAttr[n].rgValue[0].pbData, - pSignerInfo->AuthAttrs.rgAttr[n].rgValue[0].cbData, - 0, NULL, (PVOID)pFiletime, &dwSize); - } - return FALSE; -} - static BOOL gfnInternalGetSignerInfoTimeStamp(PCMSG_SIGNER_INFO pSignerInfo, FILETIME* pFiletime) { #ifndef szOID_RSA_signingTime @@ -1332,7 +1313,7 @@ static BOOL gfnInternalVerifyFileSignatureInfo( goto verifyFileSignatureInfoDone; } - if (!gfnInteralGetSignerInfoTimeStamp(pSignerInfo, &signingtime)) + if (!gfnInternalGetSignerInfoTimeStamp(pSignerInfo, &signingtime)) { memset(&signingtime, 0, sizeof(signingtime)); } diff --git a/lib/linux/x64/GfnRuntimeSdk.so b/lib/linux/x64/GfnRuntimeSdk.so new file mode 100644 index 0000000..ac573d5 Binary files /dev/null and b/lib/linux/x64/GfnRuntimeSdk.so differ diff --git a/lib/win/x64/GfnRuntimeSdk.dll b/lib/win/x64/GfnRuntimeSdk.dll new file mode 100644 index 0000000..56e19f0 Binary files /dev/null and b/lib/win/x64/GfnRuntimeSdk.dll differ diff --git a/lib/win/x86/GfnRuntimeSdk.dll b/lib/win/x86/GfnRuntimeSdk.dll new file mode 100644 index 0000000..e94250a Binary files /dev/null and b/lib/win/x86/GfnRuntimeSdk.dll differ diff --git a/lib/x64/GfnRuntimeSdk.dll b/lib/x64/GfnRuntimeSdk.dll deleted file mode 100644 index 5b8913c..0000000 Binary files a/lib/x64/GfnRuntimeSdk.dll and /dev/null differ diff --git a/lib/x86/GfnRuntimeSdk.dll b/lib/x86/GfnRuntimeSdk.dll deleted file mode 100644 index af61f3c..0000000 Binary files a/lib/x86/GfnRuntimeSdk.dll and /dev/null differ diff --git a/samples/CGameAPISample/CMakeLists.txt b/samples/CGameAPISample/CMakeLists.txt index f7eee5a..4408f85 100644 --- a/samples/CGameAPISample/CMakeLists.txt +++ b/samples/CGameAPISample/CMakeLists.txt @@ -1,25 +1,30 @@ set(GFN_SDK_SAMPLE_SOURCES - ${GFN_SDK_RUNTIME_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/Main.c ${CMAKE_CURRENT_SOURCE_DIR}/SampleModule.c ${CMAKE_CURRENT_SOURCE_DIR}/SampleModule.h ) add_executable(CGameAPISample ${GFN_SDK_SAMPLE_SOURCES}) -set_target_properties(CGameAPISample PROPERTIES FOLDER "Samples") -set_target_properties(CGameAPISample PROPERTIES LINK_FLAGS "/ignore:4099") +set_target_properties(CGameAPISample PROPERTIES FOLDER "Dist/Samples") + +target_link_libraries(CGameAPISample PRIVATE GfnSdkWrapper) target_include_directories(CGameAPISample PRIVATE ${GFN_SDK_DIST_DIR}/include) +target_include_directories(CGameAPISample PRIVATE ${GFN_SDK_DIST_DIR}/samples/Common) target_compile_definitions(CGameAPISample PRIVATE GFN_SDK_WRAPPER_LOG=1 FEATURECONFIG_HEADER) -# Set the configuration-specific binary output directory. -set(TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$") +if (WIN32) + set_target_properties(CGameAPISample PROPERTIES LINK_FLAGS "/ignore:4099") + set(_gfn_runtime_shared_lib "${CMAKE_CURRENT_BINARY_DIR}/GfnRuntimeSdk.dll") +elseif (LINUX) + set(_gfn_runtime_shared_lib "${CMAKE_CURRENT_BINARY_DIR}/GfnRuntimeSdk.so") +endif (WIN32) -# Copy SDK dll to output directory. -add_custom_command(TARGET CGameAPISample - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${GFN_SDK_LIB_DIR}/GfnRuntimeSdk.dll" - "${TARGET_OUT_DIR}" - COMMENT "Copying SDK DLL to build..." +# Copy SDK shared library to output directory to bring the sample up to date +add_custom_command( + OUTPUT "${_gfn_runtime_shared_lib}" + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${_gfn_runtime_shared_lib} + DEPENDS GfnRuntime ) +target_sources(CGameAPISample PRIVATE "${_gfn_runtime_shared_lib}") \ No newline at end of file diff --git a/samples/CGameAPISample/Main.c b/samples/CGameAPISample/Main.c index 3a52033..285e32a 100644 --- a/samples/CGameAPISample/Main.c +++ b/samples/CGameAPISample/Main.c @@ -26,14 +26,46 @@ // Copyright (c) 2019-2021 NVIDIA Corporation. All rights reserved. #include -#include -#include // For GetAsyncKeyState #include "SampleModule.h" + +#ifdef _WIN32 +# include +#elif __linux__ +# include +# include +#endif + bool g_MainDone = false; int g_pause_call_counter = 0; const char* platformAppId = "GeForce NOW SDK - Sample C App"; const char* platformId = "GeForce NOW SDK - Sample Test Platform"; +#define CLOUD_CHECK_MIN_NONCE_SIZE 16 + +static char getKeyPress() { +#ifdef _WIN32 + return _getch(); +#else + struct termios oldt, newt; + char ch; + tcgetattr(STDIN_FILENO, &oldt); + newt = oldt; + newt.c_lflag &= ~(ICANON | ECHO); + tcsetattr(STDIN_FILENO, TCSANOW, &newt); + ch = getchar(); + tcsetattr(STDIN_FILENO, TCSANOW, &oldt); + return ch; +#endif +} + +static void waitForSpaceBar() { + printf("\n\nApplication: In main application loop; Press space bar to exit...\n\n"); + char c; + do + { + c = getKeyPress(); + } while (c != ' '); +} // Example application initialization method with a call to initialize the Geforce NOW Runtime SDK. // Application callbacks are registered with the SDK after it is initialized if running in Cloud mode. @@ -115,20 +147,22 @@ void ApplicationShutdown() } // Example application main -int _tmain(int argc, _TCHAR* argv[]) +int main(int argc, char* argv[]) { + GfnError runtimeError = gfnSuccess; + ApplicationInitialize(); - // Sample C API call + // Simple Cloud Check API call bool bIsCloudEnvironment = false; GfnIsRunningInCloud(&bIsCloudEnvironment); - printf("\nApplication executing in Geforce NOW environment: %s\n", (bIsCloudEnvironment == true) ? "true" : "false"); + printf("\nGfnIsRunningInCloud: Application executing in Geforce NOW environment: %s\n", (bIsCloudEnvironment == true) ? "true" : "false"); if (bIsCloudEnvironment) // More sample C API calls. { GfnError runtimeError = gfnSuccess; - char* clientIp = NULL; + char const* clientIp = NULL; runtimeError = GfnGetClientIpV4(&clientIp); if (runtimeError == gfnSuccess) { @@ -139,7 +173,7 @@ int _tmain(int argc, _TCHAR* argv[]) printf("Failed to retrieve Geforce NOW Client I.P. GfnError: %d\n", (int) runtimeError); } - char* clientLanguageCode = NULL; + char const* clientLanguageCode = NULL; runtimeError = GfnGetClientLanguageCode(&clientLanguageCode); if (runtimeError == gfnSuccess) { @@ -160,7 +194,7 @@ int _tmain(int argc, _TCHAR* argv[]) { printf("Failed to retrieve Geforce NOW client Country code. GfnError: %d\n", (int)runtimeError); } - char* partnerSecureData = NULL; + char const* partnerSecureData = NULL; runtimeError = GfnGetPartnerSecureData(&partnerSecureData); if (GFNSDK_SUCCEEDED(runtimeError)) { printf("GfnGetPartnerSecureData: [%s]\n", partnerSecureData); @@ -170,7 +204,7 @@ int _tmain(int argc, _TCHAR* argv[]) printf("Failed to retrieve PartnerSecureData\n"); } - char* partnerData = NULL; + char const* partnerData = NULL; runtimeError = GfnGetPartnerData(&partnerData); if (GFNSDK_SUCCEEDED(runtimeError)) { printf("GfnGetPartnerData: [%s]\n", partnerData); @@ -228,19 +262,10 @@ int _tmain(int argc, _TCHAR* argv[]) } // Application main loop - printf("\n\nApplication: In main application loop; Press space bar to exit...\n\n"); - GetAsyncKeyState(' '); // Clear space bar change bit - while (!g_MainDone) - { - // Do application stuff here.. - if (GetAsyncKeyState(' ') != 0) - { - g_MainDone = true; - } - } + waitForSpaceBar(); // Notify Title exited - GfnRuntimeError runtimeError = GfnTitleExited(platformId, platformAppId); + runtimeError = GfnTitleExited(platformId, platformAppId); if (runtimeError == gfnSuccess) { printf("GFN Title Exited\n"); diff --git a/samples/README.md b/samples/README.md index 4c4db8c..59074ad 100644 --- a/samples/README.md +++ b/samples/README.md @@ -1,46 +1,41 @@ -This directory contains sample projectors that demonstrate use of the GeForce Now (GFN) Runtime API. +This directory contains sample projects that demonstrate proper use of the +various APIs that are part of GeForce NOW (GFN) SDK. Each sample is designed +to provide examples of API usage in the most comment integration scenarios. -Sample Overview: -==================================================================================================== -CGameAPISample: - This sample demonstrates usage of the application-focused APIs to control behavior of a - title running in the GeForce NOW environment. The sample focuses on use of callbacks to notify - a title of environment state changes. +## Sample Overview -SDKDllDirectRefSample: - This sample demonstrates basic SDK usage without relying on the wrapper helper functions. This - can be useful for partners who are unable to utilize the wrapper in their environment. +CGameAPISample: +This C-based simple command-line sample demonstrates usage of the game-focused +APIs to detect the GeForce NOW cloud environment and control behavior of a game +in that environment. This sample focuses on use of callbacks to notify a title +of GeForce NOW cloud environment state changes. SampleLauncher: - This sample demonstrates usage of the Launcher/Publisher-focused APIs, including getting a list - of supported titles as well as invoking GeForce NOW to start a streaming session of a title. +This C++-based sample demonstrates usage of the Launcher/Publisher application- +focused APIs, including getting a list of supported titles supported by GeForce +NOW, as well as invoking the GeForce NOW Windows client to start a streaming +session of a title. This sample is meant to be run on both the local client and +GeForce NOW cloud environment to understand how all the APIs behave in each +environment. - In addition, this sample is CEF-based to provide a view of how a CEF-based Launcher application - can make use of the API. Sample source is a fork of the CEF project's example source found at - https://bitbucket.org/chromiumembedded/cef-project/src. - - For applications that are not CEF-based, users can focus on API calls as found in the - src/gfn_sdk_demo/gfn_sdk_helper.cc file. +In addition to supporting both execution environments, this sample is built on +Chromium Embedded Framework (CEF) to provide a view of how a CEF-based +application can make use of the API. The sample source is a fork of the CEF +project's example source found at +https://bitbucket.org/chromiumembedded/cef-project/src. -Building: -==================================================================================================== -Prerequisites: - Visual Studio 2015 or later is required to build the samples against the GFN Runtime API static - libraries. +When building for Linux, this sample requires the X11-dev libraries be +installed to compile successfully. + +For applications that are not CEF-based, users can focus on API calls as found in +[SampleLauncher's gfn_sdk_helper.cc file](./SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc). - Version 3.11 or later of cmake or later is required to generate the Visual Studio solution. - Please visit( https://cmake.org/download/ ) to install or update. +SDKDllDirectRefSample: +This C-based sample demonstrates basic SDK usage without relying on the wrapper +helper functions. This can be useful for partners who are unable to utilize the +wrapper in their build environment or want finer control on SDK library loading +and how the library exports are called from an application. -Generating Visual Studio Solution: - There is a BATCH file at the root of the distribution package that provides sample generation of - GfnRuntimeSdk.sln against your latest Visual Studio installation with x86 Debug target in a new - folder called "build". For more advanced or custom usage, invoke cmake directly. Example for - generating a Visual Studio 2017 solution with x64 targets: - mkdir build - cd build - cmake .. -G "Visual Studio 15 2017" -A x64 +## Building the Samples -Compiling: - Once the solution is built, simply run or debug the samples, as the generator will correctly - set links back to the GFN Runtime API include and lib folders. - \ No newline at end of file +Please see the [root README](./README.md) for details on how to build the samples. \ No newline at end of file diff --git a/samples/SDKDllDirectRefSample/CMakeLists.txt b/samples/SDKDllDirectRefSample/CMakeLists.txt index a6103eb..b07d9a5 100644 --- a/samples/SDKDllDirectRefSample/CMakeLists.txt +++ b/samples/SDKDllDirectRefSample/CMakeLists.txt @@ -1,24 +1,29 @@ set(GFN_SDK_SAMPLE_SOURCES - ${GFN_SDK_RUNTIME_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/Main.c ${CMAKE_CURRENT_SOURCE_DIR}/SampleModule.c ${CMAKE_CURRENT_SOURCE_DIR}/SampleModule.h ) add_executable(SDKDllDirectRefSample ${GFN_SDK_SAMPLE_SOURCES}) -set_target_properties(SDKDllDirectRefSample PROPERTIES FOLDER "Samples") -set_target_properties(SDKDllDirectRefSample PROPERTIES LINK_FLAGS "/ignore:4099") +set_target_properties(SDKDllDirectRefSample PROPERTIES FOLDER "Dist/Samples") target_include_directories(SDKDllDirectRefSample PRIVATE ${GFN_SDK_DIST_DIR}/include) -# Set the configuration-specific binary output directory. -set(TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$") +if (WIN32) + target_link_libraries(SDKDllDirectRefSample PRIVATE GfnSdkSecureLoadLibrary) + set_target_properties(SDKDllDirectRefSample PROPERTIES LINK_FLAGS "/ignore:4099") + set(_gfn_runtime_shared_lib "${CMAKE_CURRENT_BINARY_DIR}/GfnRuntimeSdk.dll") +elseif (LINUX) + target_link_libraries(SDKDllDirectRefSample PRIVATE ${CMAKE_DL_LIBS}) + set(_gfn_runtime_shared_lib "${CMAKE_CURRENT_BINARY_DIR}/GfnRuntimeSdk.so") +endif (WIN32) -# Copy SDK dll to output directory. -add_custom_command(TARGET SDKDllDirectRefSample - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${GFN_SDK_LIB_DIR}/GfnRuntimeSdk.dll" - "${TARGET_OUT_DIR}" - COMMENT "Copying SDK DLL to build..." +# Copy SDK shared library to output directory to bring the sample up to date +add_custom_command( + OUTPUT "${_gfn_runtime_shared_lib}" + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${_gfn_runtime_shared_lib} + DEPENDS GfnRuntime ) + +target_sources(SDKDllDirectRefSample PRIVATE "${_gfn_runtime_shared_lib}") diff --git a/samples/SDKDllDirectRefSample/Main.c b/samples/SDKDllDirectRefSample/Main.c index 98e43b9..d5bbfbb 100644 --- a/samples/SDKDllDirectRefSample/Main.c +++ b/samples/SDKDllDirectRefSample/Main.c @@ -26,14 +26,33 @@ // Copyright (c) 2019-2021 NVIDIA Corporation. All rights reserved. #include -#include -#include // For GetAsyncKeyState +#include #include "SampleModule.h" + +#ifdef _WIN32 +#include +#include // For GetAsyncKeyState #include "GfnSdk_SecureLoadLibrary.h" +#define PLATFORM_MAX_PATH MAX_PATH +typedef _TCHAR CHAR_TYPE; +typedef HMODULE HANDLE_TYPE; +#elif defined(__linux__) +#include +#include +#include // dlopen +#include // dirname +#include // PATH_MAX +#define PLATFORM_MAX_PATH PATH_MAX +typedef char CHAR_TYPE; +typedef void* HANDLE_TYPE; +#else +#error "Unsupported platform" +#endif +HANDLE_TYPE gfnSdkModule = NULL; bool g_MainDone = false; int g_pause_call_counter = 0; -HMODULE gfnSdkModule = NULL; + typedef GfnRuntimeError(*gfnInitializeRuntimeSdkSig)(GfnDisplayLanguage displayLanguage); typedef void (*gfnShutdownRuntimeSdkSig)(void); @@ -47,6 +66,11 @@ static void IsRunningInCloud(bool* bIsCloudEnvironment); static GfnRuntimeError GetClientInfo(GfnClientInfo* info); static GfnRuntimeError RegisterClientInfoCallback(ClientInfoCallbackSig cbFn); +static void GetSharedLibraryPath(CHAR_TYPE* path); +static HANDLE_TYPE LoadSdkLibrary(); +static void* GetSymbol(HANDLE_TYPE library, char* name); +static void ApplicationMainLoop(); + // Example application initialization method with a call to initialize the Geforce NOW Runtime SDK. // Application callbacks are registered with the SDK after it is initialized if running in Cloud mode. void ApplicationInitialize() @@ -90,7 +114,11 @@ void ApplicationShutdown() } // Example application main -int _tmain(int argc, _TCHAR* argv[]) +#ifdef _WIN32 +int _tmain(int argc, CHAR_TYPE* argv[]) +#elif defined(__linux__) +int main(int argc, CHAR_TYPE* argv[]) +#endif { ApplicationInitialize(); @@ -122,16 +150,7 @@ int _tmain(int argc, _TCHAR* argv[]) } // Application main loop - printf("\n\nApplication: In main application loop; Press space bar to exit...\n\n"); - GetAsyncKeyState(' '); // Clear space bar change bit - while (!g_MainDone) - { - // Do application stuff here.. - if (GetAsyncKeyState(' ') != 0) - { - g_MainDone = true; - } - } + ApplicationMainLoop(); // Application Shutdown // It's safe to call ShutdownShieldXLinkSDK even if the SDK was not initialized. @@ -144,22 +163,15 @@ static GfnRuntimeError InitSdk() { GfnRuntimeError ret = gfnSuccess; GfnRuntimeError clientStatus = gfnSuccess; - // For security reasons, it is preferred to check the digital signature before loading the DLL. - // Such code is not provided here to reduce code complexity and library size, and in favor of - // any internal libraries built for this purpose. -#ifdef _DEBUG - gfnSdkModule = LoadLibraryW(L".\\GfnRuntimeSdk.dll"); -#else - gfnSdkModule = gfnSecureLoadClientLibraryW(L".\\GfnRuntimeSdk.dll", 0); -#endif + + gfnSdkModule = LoadSdkLibrary(); if (gfnSdkModule == NULL) { - printf("Not able to load client library. LastError=0x%08X\n", GetLastError()); ret = gfnDllNotPresent; } else { - gfnInitializeRuntimeSdkSig initFn = (gfnInitializeRuntimeSdkSig)GetProcAddress(gfnSdkModule, "gfnInitializeRuntimeSdk"); + gfnInitializeRuntimeSdkSig initFn = (gfnInitializeRuntimeSdkSig)GetSymbol(gfnSdkModule, "gfnInitializeRuntimeSdk"); if (initFn == NULL) { ret = gfnAPINotFound; @@ -186,21 +198,150 @@ static void ShutdownRuntimeSdk() { if (!!gfnSdkModule) { - ((gfnShutdownRuntimeSdkSig)GetProcAddress(gfnSdkModule, "gfnShutdownRuntimeSdk"))(); + ((gfnShutdownRuntimeSdkSig)GetSymbol(gfnSdkModule, "gfnShutdownRuntimeSdk"))(); } } static void IsRunningInCloud(bool* bIsCloudEnvironment) { - *bIsCloudEnvironment = ((gfnIsRunningInCloudSig)GetProcAddress(gfnSdkModule, "gfnIsRunningInCloud"))(); + *bIsCloudEnvironment = ((gfnIsRunningInCloudSig)GetSymbol(gfnSdkModule, "gfnIsRunningInCloud"))(); } static GfnRuntimeError RegisterClientInfoCallback(ClientInfoCallbackSig cbFn) { - return ((gfnRegisterClientInfoCallbackSig)GetProcAddress(gfnSdkModule, "gfnRegisterClientInfoCallback"))(cbFn, NULL); + return ((gfnRegisterClientInfoCallbackSig)GetSymbol(gfnSdkModule, "gfnRegisterClientInfoCallback"))(cbFn, NULL); } static GfnRuntimeError GetClientInfo(GfnClientInfo* info) { - return ((gfnGetClientInfoSig)GetProcAddress(gfnSdkModule, "gfnGetClientInfo"))(info); + return ((gfnGetClientInfoSig)GetSymbol(gfnSdkModule, "gfnGetClientInfo"))(info); +} + +static void GetSharedLibraryPath(CHAR_TYPE* path) +{ +#ifdef _WIN32 + _tcscat(&path[0], _T(".\\GfnRuntimeSdk.dll")); +#elif defined(__linux__) + char buffer[PLATFORM_MAX_PATH]; + ssize_t len; + + // Get the absolute path of the executable + len = readlink("/proc/self/exe", buffer, sizeof(buffer) - 1); + + // Check for errors + if (len == -1) { + return; + } + + // Null-terminate the string + buffer[len] = '\0'; + + // Get the directory path, excluding the executable name + char* directory = dirname(buffer); + strncpy(path, directory, PLATFORM_MAX_PATH); + + // Append "GfnRuntimeSdk.so" to the directory path + if (strlen(path) + strlen("/GfnRuntimeSdk.so") + 1 > PLATFORM_MAX_PATH) { + printf("ERROR: Could not get default client library path name: Path too long"); + return; + } + + strcat(path, "/GfnRuntimeSdk.so"); +#endif +} + +static HANDLE_TYPE LoadSdkLibrary() +{ + HANDLE_TYPE handle = NULL; + CHAR_TYPE libpath[PLATFORM_MAX_PATH]; + memset(libpath, 0, sizeof(libpath) / sizeof(CHAR_TYPE)); + GetSharedLibraryPath(libpath); + + // For security reasons, it is preferred to check the digital signature before loading the DLL. + // Such code is not provided here to reduce code complexity and library size, and in favor of + // any internal libraries built for this purpose. +#ifdef _WIN32 +# ifdef _DEBUG + handle = LoadLibrary(libpath); +# else + handle = gfnSecureLoadClientLibraryW(libpath, 0); +# endif +#elif __linux__ + handle = dlopen(libpath, RTLD_LAZY); +#endif + + if (!handle) + { +#ifdef _WIN32 + printf("Not able to load client library. LastError=0x%08X\n", GetLastError()); +#elif __linux__ + printf("Not able to load client library. dlerror=%s\n", dlerror()); +#endif + } + + return handle; +} + +static void* GetSymbol(HANDLE_TYPE library, char* name) +{ +#ifdef _WIN32 + return (void*)GetProcAddress(library, name); +#elif defined(__linux__) + return dlsym(library, name); +#endif +} + +static void ApplicationMainLoop() +{ + printf("\n\nApplication: In main application loop; Press space bar to exit...\n\n"); +#ifdef _WIN32 + GetAsyncKeyState(' '); // Clear space bar change bit + while (!g_MainDone) + { + // Do application stuff here.. + if (GetAsyncKeyState(' ') != 0) + { + g_MainDone = true; + } + } +#elif defined(__linux__) + char ch; + + struct termios orig_termios; + struct termios new_termios; + + // make sure to flush the input to prevent any old input from being read + tcflush(0, TCIFLUSH); + + // Get the current settings (which we will restore) + tcgetattr(0, &orig_termios); + + // Copy the settings to new_termios and modify them + new_termios = orig_termios; + new_termios.c_lflag &= ~ICANON; // Disable canonical mode + new_termios.c_lflag &= ~ECHO; // Disable echo + new_termios.c_cc[VMIN] = 1; // Set minimum read characters to 1 + new_termios.c_cc[VTIME] = 0; // Set timeout to 0 deciseconds + + // Set the new attributes + tcsetattr(0, TCSANOW, &new_termios); + + while (!g_MainDone) + { + // Do application stuff here.. + if (read(0, &ch, 1) < 0) + { + // No key read + usleep(100000); // Sleep for 100ms + continue; + } + + if (ch == ' ') + { + g_MainDone = true; + } + } + + tcsetattr(0, TCSANOW, &orig_termios); +#endif } diff --git a/samples/SampleLauncher/CMakeLists.txt b/samples/SampleLauncher/CMakeLists.txt index 546568c..4a198ca 100644 --- a/samples/SampleLauncher/CMakeLists.txt +++ b/samples/SampleLauncher/CMakeLists.txt @@ -108,7 +108,7 @@ else () elseif (APPLE) message( FATAL_ERROR "MacOS builds are not supported at this time." ) elseif (LINUX) - message( FATAL_ERROR "Linux builds are not supported at this time." ) + set(OS_STRING linux) endif () if (SAMPLES_ARCH STREQUAL "32") @@ -147,7 +147,16 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake") find_package(CEF REQUIRED) # CEF isn't careful about Release vs RelWithDebInfo/MinSizeRel +# Handle different generators here string(REPLACE "$" "$<$:Debug>$<$>:Release>" CEF_BINARY_DIR ${CEF_BINARY_DIR}) +string(REPLACE "RelWithDebInfo" "Release" CEF_BINARY_DIR ${CEF_BINARY_DIR}) + +if (OS_LINUX) + list(APPEND CEF_CXX_COMPILER_FLAGS "-Wno-error=attributes") +endif () +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + list(APPEND CEF_CXX_COMPILER_FLAGS "-Wno-undefined-var-template") +endif () # # Define CEF-based targets. @@ -157,7 +166,7 @@ string(REPLACE "$" "$<$:Debug>$<$/CMakeLists.txt file in the current directory. diff --git a/samples/SampleLauncher/src/CMakeLists.txt b/samples/SampleLauncher/src/CMakeLists.txt index fc74b9b..3880ded 100644 --- a/samples/SampleLauncher/src/CMakeLists.txt +++ b/samples/SampleLauncher/src/CMakeLists.txt @@ -9,8 +9,6 @@ if(OS_MACOSX) message(FATAL_ERROR "MacOS builds are not supported at this time.") -elseif(OS_LINUX) - message(FATAL_ERROR "Linux builds are not supported at this time.") elseif(OS_WINDOWS) # Shared Windows resources (version information, icons). set(SHARED_RESOURCES_SRCS @@ -50,7 +48,7 @@ if(OS_MACOSX OR OS_WINDOWS) endif() # Set the configuration-specific binary output directory. -set(EXAMPLE_TARGET_OUT_DIR "${CMAKE_BINARY_DIR}/$") +set(EXAMPLE_TARGET_OUT_DIR "${CMAKE_BINARY_DIR}/SampleLauncher") # Set properties common to all example targets. macro(SET_EXAMPLE_PROPERTIES target) @@ -62,7 +60,7 @@ macro(SET_EXAMPLE_PROPERTIES target) if(OS_MACOSX OR OS_WINDOWS) # Place the target in the "examples" folder in Visual Studio and Xcode. - set_property(TARGET ${target} PROPERTY FOLDER "Samples") + set_property(TARGET ${target} PROPERTY FOLDER "Dist/Samples") endif() endmacro() @@ -86,15 +84,11 @@ macro(SET_EXAMPLE_EXECUTABLE_TARGET_PROPERTIES target) add_custom_command( TARGET ${target} POST_BUILD - COMMAND "mt.exe" -nologo + COMMAND ${CMAKE_MT} -nologo -manifest \"${CMAKE_CURRENT_SOURCE_DIR}/${SHARED_EXE_MANIFEST}\" \"${CMAKE_CURRENT_SOURCE_DIR}/${SHARED_COMPATIBILITY_MANIFEST}\" -outputresource:"${EXAMPLE_TARGET_OUT_DIR}/${target}.exe"\;\#1 - COMMENT "Adding manifest..." - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${GFN_SDK_LIB_DIR}/GfnRuntimeSdk.dll" - "${EXAMPLE_TARGET_OUT_DIR}" - COMMENT "Updating manifests and copying SDK DLL to build..." + COMMENT "Updating manifests..." ) endif() endmacro() diff --git a/samples/SampleLauncher/src/gfn_sdk_demo/CMakeLists.txt b/samples/SampleLauncher/src/gfn_sdk_demo/CMakeLists.txt index 8692608..79f1c55 100644 --- a/samples/SampleLauncher/src/gfn_sdk_demo/CMakeLists.txt +++ b/samples/SampleLauncher/src/gfn_sdk_demo/CMakeLists.txt @@ -2,9 +2,7 @@ # reserved. Use of this source code is governed by a BSD-style license that # can be found in the LICENSE file. -if(OS_LINUX) - message(FATAL_ERROR "Linux builds are not supported at this time.") -elseif(OS_MACOSX) +if(OS_MACOSX) message(FATAL_ERROR "MacOS builds are not supported at this time.") endif() @@ -14,15 +12,18 @@ endif() # Main executable sources. set(EXAMPLE_SRCS - ${GFN_SDK_RUNTIME_SOURCES} ../minimal/main_minimal.cc - app_browser_impl.cc client_impl.cc client_impl.h gfn_sdk_helper.cc gfn_sdk_helper.h ) set(EXAMPLE_SRCS_WINDOWS + app_browser_win_impl.cc + resource_util_win_impl.cc + ) +set(EXAMPLE_SRCS_LINUX + app_browser_impl.cc resource_util_win_impl.cc ) APPEND_PLATFORM_SOURCES(EXAMPLE_SRCS) @@ -84,7 +85,18 @@ if(OS_LINUX) add_executable(${EXAMPLE_TARGET} ${EXAMPLE_SRCS}) SET_EXAMPLE_EXECUTABLE_TARGET_PROPERTIES(${EXAMPLE_TARGET}) add_dependencies(${EXAMPLE_TARGET} shared) - target_link_libraries(${EXAMPLE_TARGET} shared) + target_link_libraries(${EXAMPLE_TARGET} shared GfnSdkWrapper) + + target_include_directories(${EXAMPLE_TARGET} PRIVATE ${GFN_SDK_DIST_DIR}/samples/Common) + + # Copy SDK .so to output directory to bring the sample up to date + set(_gfn_runtime_so "${CMAKE_BINARY_DIR}/SampleLauncher/GfnRuntimeSdk.so") + add_custom_command( + OUTPUT "${_gfn_runtime_so}" + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${_gfn_runtime_so} + ) + target_sources(${EXAMPLE_TARGET} PRIVATE "${_gfn_runtime_so}") # Copy resource files to the target output directory. COPY_FILES("${EXAMPLE_TARGET}" "${EXAMPLE_RESOURCES_SRCS}" "${CMAKE_CURRENT_SOURCE_DIR}" "${EXAMPLE_TARGET_OUT_DIR}/${EXAMPLE_TARGET}_files") @@ -173,8 +185,8 @@ if(OS_WINDOWS) add_executable(${EXAMPLE_TARGET} WIN32 ${EXAMPLE_SRCS}) SET_EXAMPLE_EXECUTABLE_TARGET_PROPERTIES(${EXAMPLE_TARGET}) add_dependencies(${EXAMPLE_TARGET} shared) - target_link_libraries(${EXAMPLE_TARGET} shared) - + target_link_libraries(${EXAMPLE_TARGET} shared GfnSdkWrapper) + target_link_libraries(${EXAMPLE_TARGET} crypt32.lib Wldap32.lib @@ -183,67 +195,63 @@ if(OS_WINDOWS) PRIVATE ${GFN_SDK_DIST_DIR}/include ${CMAKE_BINARY_DIR}/../include + ${GFN_SDK_DIST_DIR}/samples/Common ) target_compile_features(${EXAMPLE_TARGET} PRIVATE cxx_std_17) set_source_files_properties(${EXAMPLE_TARGET} PROPERTIES COMPILE_FLAGS "/wd4996") target_compile_definitions(${EXAMPLE_TARGET} PRIVATE GFN_SDK_WRAPPER_LOG=1 FEATURECONFIG_HEADER) + # Copy SDK dll to output directory to bring the sample up to date + set(_gfn_runtime_dll "${CMAKE_BINARY_DIR}/SampleLauncher/GfnRuntimeSdk.dll") + add_custom_command( + OUTPUT "${_gfn_runtime_dll}" + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${_gfn_runtime_dll} + ) + target_sources(${EXAMPLE_TARGET} PRIVATE "${_gfn_runtime_dll}") endif() -if (SAMPLES_INSTALL_ROOT) - set(EXAMPLE_INSTALL_FILES - ${libcef_download_SOURCE_DIR}/Resources/cef.pak - ${libcef_download_SOURCE_DIR}/Resources/icudtl.dat - ) - - set(EXAMPLE_INSTALL_FILES_DEBUG - ${libcef_download_SOURCE_DIR}/Debug/chrome_elf.dll - ${libcef_download_SOURCE_DIR}/Debug/libcef.dll - ${libcef_download_SOURCE_DIR}/Debug/natives_blob.bin - ${libcef_download_SOURCE_DIR}/Debug/snapshot_blob.bin - ${libcef_download_SOURCE_DIR}/Debug/v8_context_snapshot.bin - ) - - set(EXAMPLE_INSTALL_FILES_RELEASE - ${libcef_download_SOURCE_DIR}/Release/chrome_elf.dll - ${libcef_download_SOURCE_DIR}/Release/libcef.dll - ${libcef_download_SOURCE_DIR}/Release/natives_blob.bin - ${libcef_download_SOURCE_DIR}/Release/snapshot_blob.bin - ${libcef_download_SOURCE_DIR}/Release/v8_context_snapshot.bin - ) +set(EXAMPLE_INSTALL_FILES + ${libcef_download_SOURCE_DIR}/Resources/cef.pak + ${libcef_download_SOURCE_DIR}/Resources/icudtl.dat +) + +if (WIN32) + set(EXAMPLE_INSTALL_FILES_DEBUG + ${libcef_download_SOURCE_DIR}/Debug/chrome_elf.dll + ${libcef_download_SOURCE_DIR}/Debug/libcef.dll + ${libcef_download_SOURCE_DIR}/Debug/natives_blob.bin + ${libcef_download_SOURCE_DIR}/Debug/snapshot_blob.bin + ${libcef_download_SOURCE_DIR}/Debug/v8_context_snapshot.bin + ) - install(TARGETS ${EXAMPLE_TARGET} - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT} - COMPONENT sample_bins - ) - install(FILES $ - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT}/symbols - COMPONENT sample_bins - ) - install(FILES ${EXAMPLE_INSTALL_FILES} - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT} - COMPONENT sample_bins - ) - install(FILES ${EXAMPLE_INSTALL_FILES_DEBUG} - CONFIGURATIONS Debug - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT} - COMPONENT sample_bins - ) - install(FILES ${EXAMPLE_INSTALL_FILES_RELEASE} - CONFIGURATIONS Release MinSizeRel RelWithDebInfo - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT} - COMPONENT sample_bins - ) - - install(FILES - ${CMAKE_BINARY_DIR}/$/GfnRuntimeSdk.dll - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT} - COMPONENT sample_bins - ) + set(EXAMPLE_INSTALL_FILES_RELEASE + ${libcef_download_SOURCE_DIR}/Release/chrome_elf.dll + ${libcef_download_SOURCE_DIR}/Release/libcef.dll + ${libcef_download_SOURCE_DIR}/Release/natives_blob.bin + ${libcef_download_SOURCE_DIR}/Release/snapshot_blob.bin + ${libcef_download_SOURCE_DIR}/Release/v8_context_snapshot.bin + ) +elseif (LINUX) + set(EXAMPLE_INSTALL_FILES_DEBUG + ${libcef_download_SOURCE_DIR}/Debug/libcef.so + ${libcef_download_SOURCE_DIR}/Debug/libEGL.so + ${libcef_download_SOURCE_DIR}/Debug/libGLESv2.so + ${libcef_download_SOURCE_DIR}/Debug/natives_blob.bin + ${libcef_download_SOURCE_DIR}/Debug/snapshot_blob.bin + ${libcef_download_SOURCE_DIR}/Debug/v8_context_snapshot.bin + ) - install(FILES - ${CMAKE_BINARY_DIR}/$/GfnRuntimeSdk.pdb - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT}/symbols - COMPONENT sample_bins - ) + set(EXAMPLE_INSTALL_FILES_RELEASE + ${libcef_download_SOURCE_DIR}/Release/libcef.so + ${libcef_download_SOURCE_DIR}/Release/libEGL.so + ${libcef_download_SOURCE_DIR}/Release/libGLESv2.so + ${libcef_download_SOURCE_DIR}/Release/natives_blob.bin + ${libcef_download_SOURCE_DIR}/Release/snapshot_blob.bin + ${libcef_download_SOURCE_DIR}/Release/v8_context_snapshot.bin + ) endif () + +set(SAMPLE_LAUNCHER_INSTALL_FILES "${EXAMPLE_INSTALL_FILES}" CACHE INTERNAL "Example Install Files") +set(SAMPLE_LAUNCHER_INSTALL_FILES_DEBUG "${EXAMPLE_INSTALL_FILES_DEBUG}" CACHE INTERNAL "Example Install Files Debug") +set(SAMPLE_LAUNCHER_INSTALL_FILES_RELEASE "${EXAMPLE_INSTALL_FILES_RELEASE}" CACHE INTERNAL "Example Install Files Release") diff --git a/samples/SampleLauncher/src/gfn_sdk_demo/app_browser_impl.cc b/samples/SampleLauncher/src/gfn_sdk_demo/app_browser_impl.cc index c05b2a7..f375a3b 100644 --- a/samples/SampleLauncher/src/gfn_sdk_demo/app_browser_impl.cc +++ b/samples/SampleLauncher/src/gfn_sdk_demo/app_browser_impl.cc @@ -2,180 +2,108 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include -#include -#include - #include "gfn_sdk_demo/client_impl.h" #include "shared/app_factory.h" #include "shared/browser_util.h" #include "shared/resource_util.h" -#include "include/base/cef_logging.h" -#include "shared/client_util.h" #include "shared/defines.h" #include "shared/main.h" -namespace message_router { - - namespace { - // Iterates through GfnSdk's shared::kTCPPorts to attempt to find a free one - bool GetFreePort(std::string & port) - { - port.clear(); - char* hostname = nullptr; - - int sockfd = 0; - struct sockaddr_in serv_addr; - struct hostent* server; - - sockfd = socket(AF_INET, SOCK_STREAM, 0); - if (sockfd < 0) { - return false; - } - - server = gethostbyname(hostname); - - if (!server) { - closesocket(sockfd); - return false; - } - - memset((char*)&serv_addr, 0, sizeof(serv_addr)); - serv_addr.sin_family = AF_INET; - memcpy((char*)server->h_addr, - (char*)&serv_addr.sin_addr.s_addr, - server->h_length); - - for (int i = 0; ; i++) { - const char* testPort = shared::kTCPPorts[i]; - if (!testPort) { - closesocket(sockfd); - return false; - } - - serv_addr.sin_port = htons(std::stoi(testPort)); - if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { - // Port is available to use, only the first one is needed - closesocket(sockfd); - port = testPort; - return true; - } - - } - closesocket(sockfd); - } - - std::string GetEmbeddedStartupURL() { - if (!GetFreePort(shared::g_activePort)) { - return std::string(); - } - return shared::kTestOrigin + std::string(":") + shared::g_activePort + std::string("/") + shared::kResourceHTML; - } - - std::string GetStartupURL() { - CefRefPtr command_line = CefCommandLine::GetGlobalCommandLine(); - if (command_line->HasSwitch("startup-uri")) - { - std::string startupParam = command_line->GetSwitchValue("startup-uri").ToString(); - if (startupParam.length() > INTERNET_MAX_URL_LENGTH) - { - LOG(ERROR) << "Startup URI parameter too long, falling back to embedded resource!"; - return GetEmbeddedStartupURL(); - } - // Check if the path is a relative or absolute path - if (startupParam.find(':') == std::string::npos) - { - const CefString& programPath = command_line->GetProgram(); - const std::string& currentPath = programPath.ToString().substr(0, programPath.ToString().find_last_of("/\\") + 1); - startupParam = currentPath + startupParam; - } - PCSTR pszUnicode = startupParam.c_str(); - CHAR output[INTERNET_MAX_URL_LENGTH]; - DWORD dwDisp = INTERNET_MAX_URL_LENGTH; - // Convert to a proper file:/// uri value so it matches the CefFrame url after loading - HRESULT res = UrlCreateFromPathA(pszUnicode, output, &dwDisp, NULL); - if (res != S_OK && res != S_FALSE) - { - LOG(ERROR) << "Unable to convert startup URI parameter to a valid URL, falling back to embedded resource!"; - return GetEmbeddedStartupURL(); - } - std::string startupUri(output); - return startupUri; - } - else - { - return GetEmbeddedStartupURL(); - } - } +#include +#include +#include +#include +#include - } // namespace - - void CALLBACK GameProcessClosedBrowserCallback(PVOID lpParameter, BOOLEAN TimerOrWaitFired); +namespace message_router { - // Implementation of CefApp for the browser process. - class BrowserApp : public CefApp, public CefBrowserProcessHandler { - public: - BrowserApp() {} +namespace { - // CefApp methods: - CefRefPtr GetBrowserProcessHandler() OVERRIDE { - return this; - } + // Function to find a free port from a list of given ports + bool GetFreePort(std::string & freePort) + { + int sockfd; + struct sockaddr_in serv_addr; - // CefBrowserProcessHandler methods: - void OnContextInitialized() OVERRIDE { - // Create the browser window. - const CefString& startup_url = GetStartupURL(); - shared::CreateBrowser(new Client(startup_url), startup_url, - CefBrowserSettings()); - - // Event registration for notification when the child game process is closed) - HANDLE g_gameClosedEvent = CreateEvent(NULL, TRUE, FALSE, L"Global\\GFNRuntimeSampleLauncherGameClosed"); - HANDLE newWaitHandle = NULL; - RegisterWaitForSingleObject(&newWaitHandle, g_gameClosedEvent, reinterpret_cast(&GameProcessClosedBrowserCallback), this, INFINITE, WT_EXECUTEONLYONCE); + // Initialize socket + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if (sockfd < 0) { + return false; } - void OnBeforeCommandLineProcessing( - const CefString& process_type, - CefRefPtr command_line) { - - command_line->AppendSwitch("disable-gpu"); - command_line->AppendSwitch("disable-gpu-compositing"); - command_line->AppendSwitch("disable-accelerated-compositing"); - command_line->AppendSwitch("disable-webgl"); - } + memset(&serv_addr, 0, sizeof(serv_addr)); + serv_addr.sin_family = AF_INET; + serv_addr.sin_addr.s_addr = INADDR_ANY; - void BrowserApp::CloseAllAppBrowsers(void) + for (size_t i = 0; i < sizeof(shared::kTCPPorts) / sizeof(shared::kTCPPorts[0]); i++) { - if (!!shared::g_browserHost) { - shared::g_browserHost->CloseBrowser(true); - } - else { - LOG(ERROR) << "Skipping browser window closure due to invalid host pointer"; + serv_addr.sin_port = htons(std::stoi(shared::kTCPPorts[i])); + + // Try to bind the port + if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == 0) { + // Successfully bound, this port is free + close(sockfd); // Important to release the port + freePort = shared::kTCPPorts[i]; + return true; } } - private: - IMPLEMENT_REFCOUNTING(BrowserApp); - DISALLOW_COPY_AND_ASSIGN(BrowserApp); - }; + close(sockfd); + return false; + } - void CALLBACK GameProcessClosedBrowserCallback(PVOID lpParameter, BOOLEAN TimerOrWaitFired) - { - BrowserApp * browserApp = reinterpret_cast(lpParameter); - if (!browserApp) - { - LOG(ERROR) << "Invalid callback data, unable to request application exit"; + std::string GetEmbeddedStartupURL() { + if (!GetFreePort(shared::g_activePort)) { + return std::string(); } - CefPostTask(TID_UI, base::Bind(&BrowserApp::CloseAllAppBrowsers, browserApp)); + return shared::kTestOrigin + std::string(":") + shared::g_activePort + std::string("/") + shared::kResourceHTML; } + std::string GetStartupURL() { + return GetEmbeddedStartupURL(); + } + +} // namespace + +// Implementation of CefApp for the browser process. +class BrowserApp : public CefApp, public CefBrowserProcessHandler { + public: + BrowserApp() {} + + // CefApp methods: + CefRefPtr GetBrowserProcessHandler() OVERRIDE { + return this; + } + + // CefBrowserProcessHandler methods: + void OnContextInitialized() OVERRIDE { + // Create the browser window. + const CefString& startup_url = GetStartupURL(); + shared::CreateBrowser(new Client(startup_url), startup_url, + CefBrowserSettings()); + } + + void OnBeforeCommandLineProcessing( + const CefString& process_type, + CefRefPtr command_line) OVERRIDE { + + command_line->AppendSwitch("disable-gpu"); + command_line->AppendSwitch("disable-gpu-compositing"); + command_line->AppendSwitch("disable-accelerated-compositing"); + command_line->AppendSwitch("disable-webgl"); + } + + private: + IMPLEMENT_REFCOUNTING(BrowserApp); + DISALLOW_COPY_AND_ASSIGN(BrowserApp); +}; + } // namespace message_router namespace shared { - CefRefPtr CreateBrowserProcessApp() { - return new message_router::BrowserApp(); - } +CefRefPtr CreateBrowserProcessApp() { + return new message_router::BrowserApp(); +} } // namespace shared diff --git a/samples/SampleLauncher/src/gfn_sdk_demo/app_browser_win_impl.cc b/samples/SampleLauncher/src/gfn_sdk_demo/app_browser_win_impl.cc new file mode 100644 index 0000000..c05b2a7 --- /dev/null +++ b/samples/SampleLauncher/src/gfn_sdk_demo/app_browser_win_impl.cc @@ -0,0 +1,181 @@ +// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights +// reserved. Use of this source code is governed by a BSD-style license that +// can be found in the LICENSE file. + +#include +#include +#include + +#include "gfn_sdk_demo/client_impl.h" +#include "shared/app_factory.h" +#include "shared/browser_util.h" +#include "shared/resource_util.h" +#include "include/base/cef_logging.h" +#include "shared/client_util.h" +#include "shared/defines.h" +#include "shared/main.h" + +namespace message_router { + + namespace { + // Iterates through GfnSdk's shared::kTCPPorts to attempt to find a free one + bool GetFreePort(std::string & port) + { + port.clear(); + char* hostname = nullptr; + + int sockfd = 0; + struct sockaddr_in serv_addr; + struct hostent* server; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if (sockfd < 0) { + return false; + } + + server = gethostbyname(hostname); + + if (!server) { + closesocket(sockfd); + return false; + } + + memset((char*)&serv_addr, 0, sizeof(serv_addr)); + serv_addr.sin_family = AF_INET; + memcpy((char*)server->h_addr, + (char*)&serv_addr.sin_addr.s_addr, + server->h_length); + + for (int i = 0; ; i++) { + const char* testPort = shared::kTCPPorts[i]; + if (!testPort) { + closesocket(sockfd); + return false; + } + + serv_addr.sin_port = htons(std::stoi(testPort)); + if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { + // Port is available to use, only the first one is needed + closesocket(sockfd); + port = testPort; + return true; + } + + } + closesocket(sockfd); + } + + std::string GetEmbeddedStartupURL() { + if (!GetFreePort(shared::g_activePort)) { + return std::string(); + } + return shared::kTestOrigin + std::string(":") + shared::g_activePort + std::string("/") + shared::kResourceHTML; + } + + std::string GetStartupURL() { + CefRefPtr command_line = CefCommandLine::GetGlobalCommandLine(); + if (command_line->HasSwitch("startup-uri")) + { + std::string startupParam = command_line->GetSwitchValue("startup-uri").ToString(); + if (startupParam.length() > INTERNET_MAX_URL_LENGTH) + { + LOG(ERROR) << "Startup URI parameter too long, falling back to embedded resource!"; + return GetEmbeddedStartupURL(); + } + // Check if the path is a relative or absolute path + if (startupParam.find(':') == std::string::npos) + { + const CefString& programPath = command_line->GetProgram(); + const std::string& currentPath = programPath.ToString().substr(0, programPath.ToString().find_last_of("/\\") + 1); + startupParam = currentPath + startupParam; + } + PCSTR pszUnicode = startupParam.c_str(); + CHAR output[INTERNET_MAX_URL_LENGTH]; + DWORD dwDisp = INTERNET_MAX_URL_LENGTH; + // Convert to a proper file:/// uri value so it matches the CefFrame url after loading + HRESULT res = UrlCreateFromPathA(pszUnicode, output, &dwDisp, NULL); + if (res != S_OK && res != S_FALSE) + { + LOG(ERROR) << "Unable to convert startup URI parameter to a valid URL, falling back to embedded resource!"; + return GetEmbeddedStartupURL(); + } + std::string startupUri(output); + return startupUri; + } + else + { + return GetEmbeddedStartupURL(); + } + } + + } // namespace + + void CALLBACK GameProcessClosedBrowserCallback(PVOID lpParameter, BOOLEAN TimerOrWaitFired); + + // Implementation of CefApp for the browser process. + class BrowserApp : public CefApp, public CefBrowserProcessHandler { + public: + BrowserApp() {} + + // CefApp methods: + CefRefPtr GetBrowserProcessHandler() OVERRIDE { + return this; + } + + // CefBrowserProcessHandler methods: + void OnContextInitialized() OVERRIDE { + // Create the browser window. + const CefString& startup_url = GetStartupURL(); + shared::CreateBrowser(new Client(startup_url), startup_url, + CefBrowserSettings()); + + // Event registration for notification when the child game process is closed) + HANDLE g_gameClosedEvent = CreateEvent(NULL, TRUE, FALSE, L"Global\\GFNRuntimeSampleLauncherGameClosed"); + HANDLE newWaitHandle = NULL; + RegisterWaitForSingleObject(&newWaitHandle, g_gameClosedEvent, reinterpret_cast(&GameProcessClosedBrowserCallback), this, INFINITE, WT_EXECUTEONLYONCE); + } + + void OnBeforeCommandLineProcessing( + const CefString& process_type, + CefRefPtr command_line) { + + command_line->AppendSwitch("disable-gpu"); + command_line->AppendSwitch("disable-gpu-compositing"); + command_line->AppendSwitch("disable-accelerated-compositing"); + command_line->AppendSwitch("disable-webgl"); + } + + void BrowserApp::CloseAllAppBrowsers(void) + { + if (!!shared::g_browserHost) { + shared::g_browserHost->CloseBrowser(true); + } + else { + LOG(ERROR) << "Skipping browser window closure due to invalid host pointer"; + } + } + + private: + IMPLEMENT_REFCOUNTING(BrowserApp); + DISALLOW_COPY_AND_ASSIGN(BrowserApp); + }; + + void CALLBACK GameProcessClosedBrowserCallback(PVOID lpParameter, BOOLEAN TimerOrWaitFired) + { + BrowserApp * browserApp = reinterpret_cast(lpParameter); + if (!browserApp) + { + LOG(ERROR) << "Invalid callback data, unable to request application exit"; + } + CefPostTask(TID_UI, base::Bind(&BrowserApp::CloseAllAppBrowsers, browserApp)); + } + +} // namespace message_router + +namespace shared { + + CefRefPtr CreateBrowserProcessApp() { + return new message_router::BrowserApp(); + } + +} // namespace shared diff --git a/samples/SampleLauncher/src/gfn_sdk_demo/client_impl.cc b/samples/SampleLauncher/src/gfn_sdk_demo/client_impl.cc index d5b9942..a9bd2b9 100644 --- a/samples/SampleLauncher/src/gfn_sdk_demo/client_impl.cc +++ b/samples/SampleLauncher/src/gfn_sdk_demo/client_impl.cc @@ -9,11 +9,11 @@ #include "shared/client_util.h" #include "shared/resource_util.h" -#include "shared/resources/win/resource.h" #include "GfnRuntimeSdk_Wrapper.h" #ifdef WIN32 +#include "shared/resources/win/resource.h" #include #endif @@ -21,8 +21,6 @@ namespace message_router { namespace { -const char kTestMessageName[] = "MessageRouterTest"; - typedef enum { DEV_TOOLS_HEIGHT = 600, DEV_TOOLS_WIDTH = 900 @@ -115,10 +113,13 @@ void Client::OnAfterCreated(CefRefPtr browser) { browser_ct_++; +#ifdef WIN32 HWND windowHandle = static_cast(browser->GetHost()->GetWindowHandle()); HICON iconHandle = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_GFNICON)); SendMessage(windowHandle, WM_SETICON, ICON_SMALL, (LPARAM)iconHandle); SendMessage(windowHandle, WM_SETICON, ICON_BIG, (LPARAM)iconHandle); +#endif // WIN32 + shared::g_browserHost = browser->GetHost(); // Call the default shared implementation. diff --git a/samples/SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc b/samples/SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc index 47fa953..76f4f8a 100644 --- a/samples/SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc +++ b/samples/SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc @@ -28,13 +28,20 @@ #include "gfn_sdk_demo/gfn_sdk_helper.h" #include "include/cef_parser.h" +#include "include/cef_command_line.h" #include "shared/client_util.h" #include "shared/defines.h" #include "shared/main.h" #include "GfnRuntimeSdk_Wrapper.h" //Helper functions that wrap Library-based APIs -#include "shellapi.h" #include +#ifdef _WIN32 +# define HELPER_CALLBACK __stdcall +#else +# define HELPER_CALLBACK +#endif + + CefString GFN_SDK_INIT = "GFN_SDK_INIT"; CefString GFN_SDK_SHUTDOWN = "GFN_SDK_SHUTDOWN"; CefString GFN_SDK_STREAM_ACTION = "GFN_SDK_STREAM_ACTION"; @@ -56,6 +63,7 @@ CefString GFN_SDK_GET_PARTNER_DATA = "GFN_SDK_GET_PARTNER_DATA"; CefString GET_SESSION_INFO = "GFN_SDK_GET_SESSION_INFO"; CefString GFN_SDK_SEND_MESSAGE = "GFN_SDK_SEND_MESSAGE"; CefString GFN_SDK_REGISTER_MESSAGE_CALLBACK = "GFN_SDK_REGISTER_MESSAGE_CALLBACK"; +CefString GFN_SDK_GET_ADDITIONAL_SUPPORTED_TITLES = "GFN_SDK_GET_ADDITIONAL_SUPPORTED_TITLES"; static CefString DictToJson(CefRefPtr dict) { @@ -99,16 +107,21 @@ static CefString GfnErrorToString(GfnError err) case GfnError::gfnClientLibraryNotFound: return "GFN SDK API client library not found"; case GfnError::gfnCloudLibraryNotFound: return "GFN SDK API cloud library not found"; case GfnError::gfnNoData: return "Requested data is empty or does not exist"; + case GfnError::gfnNotAuthorized: return "API Call failed because it was called from unauthorized process"; + case GfnError::gfnBackendError: return "Failed to communicate with the GFN backend service"; default: return "Unknown Error"; } } static void logGfnSdkData() { +#ifdef _WIN32 std::wstring appDataPath; shared::TryGetSpecialFolderPath(shared::SD_COMMONAPPDATA, appDataPath); std::wstring dataFilePath = appDataPath + L"\\NVIDIA Corporation\\GfnRuntimeSdk\\GFNSDK_Data.json"; - +#else + std::string dataFilePath = "/var/opt/nvidia/GfnRuntimeSdk/GFNSDK_Data.json"; +#endif std::ifstream ifs(dataFilePath); if (!ifs) { @@ -131,14 +144,14 @@ static void logGfnSdkData() } // Callback function for handling stream status callbacks -static void __stdcall handleStreamStatusCallback(GfnStreamStatus status, void* context); -static void __stdcall handleNetworkStatusCallback(GfnNetworkStatusUpdateData* pNetworkStatus, void* context); -static void __stdcall handleClientInfoCallback(GfnClientInfoUpdateData* pClientUpdate, void* context); +static void HELPER_CALLBACK handleStreamStatusCallback(GfnStreamStatus status, void* context); +static void HELPER_CALLBACK handleNetworkStatusCallback(GfnNetworkStatusUpdateData* pNetworkStatus, void* context); +static void HELPER_CALLBACK handleClientInfoCallback(GfnClientInfoUpdateData* pClientUpdate, void* context); static CefMessageRouterBrowserSide::Callback* s_registerStreamStatusCallback = nullptr; static CefMessageRouterBrowserSide::Callback* s_registerNetworkStatusCallback = nullptr; static CefMessageRouterBrowserSide::Callback* s_registerClientInfoCallback = nullptr; -static void __stdcall handleMessageCallback(GfnString* pStrData, void* context); +static void HELPER_CALLBACK handleMessageCallback(GfnString* pStrData, void* context); static CefMessageRouterBrowserSide::Callback* s_registerMessageCallback = nullptr; static GfnError initGFN() @@ -214,13 +227,13 @@ bool GfnSdkHelper(CefRefPtr browser, if (err != GfnError::gfnSuccess) { LOG(ERROR) << "Failed to get if running in cloud. Error: " << err; - return true; } - LOG(INFO) << "is enabled: " << enabled; + LOG(INFO) << "Cloud environment : " << enabled; CefRefPtr response_dict = CefDictionaryValue::Create(); response_dict->SetBool("enabled", enabled); + response_dict->SetString("errorMessage", GfnErrorToString(err)); CefString response(DictToJson(response_dict)); callback->Success(response); @@ -236,20 +249,18 @@ bool GfnSdkHelper(CefRefPtr browser, else if (command == GFN_SDK_IS_RUNNING_IN_CLOUD_SECURE) { GfnIsRunningInCloudAssurance assurance = GfnIsRunningInCloudAssurance::gfnNotCloud; - CefString errorMessage; GfnError err = GfnIsRunningInCloudSecure(&assurance); if (err != GfnError::gfnSuccess) { - LOG(ERROR) << "Failed to get if running in cloud. Error: " << err; - return true; + LOG(ERROR) << "Failed to get if running in cloud. Error: " << GfnErrorToString(err); } LOG(INFO) << "Cloud environment assurance value: " << assurance; CefRefPtr response_dict = CefDictionaryValue::Create(); response_dict->SetInt("assurance", assurance); - response_dict->SetString("errorMessage", errorMessage); + response_dict->SetString("errorMessage", GfnErrorToString(err)); CefString response(DictToJson(response_dict)); callback->Success(response); @@ -317,9 +328,9 @@ bool GfnSdkHelper(CefRefPtr browser, } /** * Calls into GFN SDK to initiate a new GeForce NOW streaming session and launch the specified - * game application. - * If the user is logged in to Geforce NOW streaming client, this call will begin streaming - * immediately. + * game application. + * If the user is logged in to Geforce NOW streaming client, this call will begin streaming + * immediately. * If the user is not logged in, the Geforce NOW streaming client will display a login * window prompting the user to authenticate first. */ @@ -520,7 +531,6 @@ bool GfnSdkHelper(CefRefPtr browser, } return true; } - /** * Registers for callback notifications during a streaming session. */ @@ -658,19 +668,12 @@ bool GfnSdkHelper(CefRefPtr browser, } else if (command == GET_OVERRIDE_URI) { - int argc = 0; - LPWSTR* cmdLine = CommandLineToArgvW(GetCommandLineW(), &argc); - LPWSTR override_uri = L""; - for (int i = 0; i < argc; i++) + CefString override_uri = ""; + CefRefPtr command_line = CefCommandLine::GetGlobalCommandLine(); + + if (command_line->HasSwitch("override_uri")) { - if (wcscmp(cmdLine[i], L"--override_uri") == 0) - { - if (i + 1 < argc) - { - override_uri = cmdLine[i + 1]; - } - break; - } + override_uri = command_line->GetSwitchValue("override_uri"); } CefRefPtr response_dict = CefDictionaryValue::Create(); @@ -707,12 +710,26 @@ bool GfnSdkHelper(CefRefPtr browser, callback->Success(response); return true; } + else if (command == GFN_SDK_GET_ADDITIONAL_SUPPORTED_TITLES) + { + CefRefPtr titles_list = CefListValue::Create(); + + // Custom title CMS ids could be added here to titles_list + + CefRefPtr response_dict = CefDictionaryValue::Create(); + response_dict->SetList("titles", titles_list); + + CefString response(DictToJson(response_dict)); + callback->Success(response); + + return true; + } LOG(ERROR) << "Unknown command value: " << command; return false; } -void __stdcall handleStreamStatusCallback(GfnStreamStatus status, void* context) +void HELPER_CALLBACK handleStreamStatusCallback(GfnStreamStatus status, void* context) { if (s_registerStreamStatusCallback) { @@ -724,7 +741,7 @@ void __stdcall handleStreamStatusCallback(GfnStreamStatus status, void* context) } } -void __stdcall handleNetworkStatusCallback(GfnNetworkStatusUpdateData* pNetworkStatus, void* context) +void HELPER_CALLBACK handleNetworkStatusCallback(GfnNetworkStatusUpdateData* pNetworkStatus, void* context) { if (!pNetworkStatus) { @@ -739,7 +756,7 @@ void __stdcall handleNetworkStatusCallback(GfnNetworkStatusUpdateData* pNetworkS s_registerNetworkStatusCallback->Success(response); } } -void __stdcall handleClientInfoCallback(GfnClientInfoUpdateData* pClientUpdate, void* context) +void HELPER_CALLBACK handleClientInfoCallback(GfnClientInfoUpdateData* pClientUpdate, void* context) { if (!pClientUpdate) { @@ -776,7 +793,7 @@ void __stdcall handleClientInfoCallback(GfnClientInfoUpdateData* pClientUpdate, } } -void __stdcall handleMessageCallback(GfnString* pStrData, void* context) +void HELPER_CALLBACK handleMessageCallback(GfnString* pStrData, void* context) { if (s_registerMessageCallback) { diff --git a/samples/SampleLauncher/src/gfn_sdk_demo/resources/gfn_sdk.html b/samples/SampleLauncher/src/gfn_sdk_demo/resources/gfn_sdk.html index 79ef40e..2eee0f7 100644 --- a/samples/SampleLauncher/src/gfn_sdk_demo/resources/gfn_sdk.html +++ b/samples/SampleLauncher/src/gfn_sdk_demo/resources/gfn_sdk.html @@ -5,8 +5,8 @@ body { left: 0; top: 0; - width: 496px; - height: 330px; + width: 512px; + height: 800px; background: #191919; margin: 0 !important; overflow: hidden; @@ -17,11 +17,27 @@ padding: 8px; } - .coverart { + .coverart-container { + display: flex; width: 480px; height: 270px; } + .coverart { + display: inline; + flex: 1; + width: 100%; + height: 100%; + } + + .coverart-backup { + display: none; + flex: 1; + color: white; + text-align: center; + font-size: 16px; + } + .nv-button { background-color: #76b900; border: none; @@ -76,6 +92,7 @@ } .nv-container { + width: 480px; margin-top: 8px; display: flex; flex-direction: row; @@ -86,18 +103,23 @@ } .nv-nested-container { - display: inline-flex; + width: 480px; + margin-top: 8px; + display: flex; + flex-direction: row; margin-left: 8px; + align-items: center; } .input { height: 20px; margin: 0px 8px 0px 8px; + width: 100%; } .input-label { white-space: normal; - width: 70px; + width: 100px; margin-left: 12px; vertical-align: middle; } @@ -110,12 +132,8 @@ color: #FFFFFFB3; background: #292929; border-color: #FFFFFFB3; - flex: auto; - height: 316px; - } - - #login-panel { - vertical-align: middle; + height: 350px; + width: 100%; } .flyout-container { @@ -152,7 +170,7 @@ .flyout-button { border: 2px solid black; - width: 170px; + width: 200px; height: 44px; } @@ -165,7 +183,10 @@
- +
+ +
+
- - + + - - - - - - - - - + + + + + + + + +
- Launcher
Token:
- + Launcher Token: +
@@ -203,18 +224,9 @@