From 0b3e42ce3124b0dd84fd16ae0cb5c85eaee41cc8 Mon Sep 17 00:00:00 2001 From: Dmitry Duka Date: Wed, 13 Sep 2017 21:36:04 +0300 Subject: Updating Ansel SDK to the latest revision --- include/AnselSDK.h | 70 ++++---- include/ansel/Camera.h | 126 +++++++-------- include/ansel/Configuration.h | 366 +++++++++++++++++++++--------------------- include/ansel/Defines.h | 78 ++++----- include/ansel/Hints.h | 158 +++++++++--------- include/ansel/Session.h | 218 ++++++++++++------------- include/ansel/UserControls.h | 198 +++++++++++------------ include/ansel/Version.h | 104 ++++++------ include/nv/Quat.h | 20 +-- include/nv/Vec3.h | 22 +-- 10 files changed, 680 insertions(+), 680 deletions(-) (limited to 'include') diff --git a/include/AnselSDK.h b/include/AnselSDK.h index e705862..a158f5c 100644 --- a/include/AnselSDK.h +++ b/include/AnselSDK.h @@ -1,35 +1,35 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and related documentation and -// any modifications thereto. Any use, reproduction, disclosure, or -// distribution of this software and related documentation without an express -// license agreement from NVIDIA Corporation is strictly prohibited. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright 2016 NVIDIA Corporation. All rights reserved. - -#pragma once - -#include -#include -#include -#include -#include - +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright 2016 NVIDIA Corporation. All rights reserved. + +#pragma once + +#include +#include +#include +#include +#include + diff --git a/include/ansel/Camera.h b/include/ansel/Camera.h index 435b53f..5741af2 100644 --- a/include/ansel/Camera.h +++ b/include/ansel/Camera.h @@ -1,63 +1,63 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and related documentation and -// any modifications thereto. Any use, reproduction, disclosure, or -// distribution of this software and related documentation without an express -// license agreement from NVIDIA Corporation is strictly prohibited. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright 2016 NVIDIA Corporation. All rights reserved. - -#pragma once -#include -#include -#include - -namespace ansel -{ - struct Camera - { - // Position of camera, in the game's coordinate space - nv::Vec3 position; - // Rotation of the camera, in the game's coordinate space. I.e. if you apply this - // rotation to the default orientation of the game's camera you will get the current - // orientation of the camera (again, in game's coordinate space) - nv::Quat rotation; - // Field of view in degrees. This value is either vertical or horizontal field of - // view based on the 'fovType' setting passed in with setConfiguration. - float fov; - // The amount that the projection matrix needs to be offset by. These values are - // applied directly as translations to the projection matrix. These values are only - // non-zero during Highres capture. - float projectionOffsetX, projectionOffsetY; - }; - - // Must be called on every frame an Ansel session is active. The 'camera' must contain - // the current display camera settings when called. After calling 'camera' will contain the - // new requested camera from Ansel. - ANSEL_SDK_API void updateCamera(Camera& camera); - - // Converts quaternion to rotation matrix vectors. - ANSEL_SDK_API void quaternionToRotationMatrixVectors(const nv::Quat& q, nv::Vec3& right, nv::Vec3& up, nv::Vec3& forward); - - // Converts rotation matrix vectors to quaternion. - ANSEL_SDK_API void rotationMatrixVectorsToQuaternion(const nv::Vec3& right, const nv::Vec3& up, const nv::Vec3& forward, nv::Quat& q); -} - +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright 2016 NVIDIA Corporation. All rights reserved. + +#pragma once +#include +#include +#include + +namespace ansel +{ + struct Camera + { + // Position of camera, in the game's coordinate space + nv::Vec3 position; + // Rotation of the camera, in the game's coordinate space. I.e. if you apply this + // rotation to the default orientation of the game's camera you will get the current + // orientation of the camera (again, in game's coordinate space) + nv::Quat rotation; + // Field of view in degrees. This value is either vertical or horizontal field of + // view based on the 'fovType' setting passed in with setConfiguration. + float fov; + // The amount that the projection matrix needs to be offset by. These values are + // applied directly as translations to the projection matrix. These values are only + // non-zero during Highres capture. + float projectionOffsetX, projectionOffsetY; + }; + + // Must be called on every frame an Ansel session is active. The 'camera' must contain + // the current display camera settings when called. After calling 'camera' will contain the + // new requested camera from Ansel. + ANSEL_SDK_API void updateCamera(Camera& camera); + + // Converts quaternion to rotation matrix vectors. + ANSEL_SDK_API void quaternionToRotationMatrixVectors(const nv::Quat& q, nv::Vec3& right, nv::Vec3& up, nv::Vec3& forward); + + // Converts rotation matrix vectors to quaternion. + ANSEL_SDK_API void rotationMatrixVectorsToQuaternion(const nv::Vec3& right, const nv::Vec3& up, const nv::Vec3& forward, nv::Quat& q); +} + diff --git a/include/ansel/Configuration.h b/include/ansel/Configuration.h index 742ba10..96169e4 100644 --- a/include/ansel/Configuration.h +++ b/include/ansel/Configuration.h @@ -1,183 +1,183 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and related documentation and -// any modifications thereto. Any use, reproduction, disclosure, or -// distribution of this software and related documentation without an express -// license agreement from NVIDIA Corporation is strictly prohibited. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright 2016 NVIDIA Corporation. All rights reserved. - -#pragma once -#include -#include -#include -#include -#include - -namespace ansel -{ - enum SetConfigurationStatus - { - // successfully initialized the Ansel SDK - kSetConfigurationSuccess, - // the version provided in the Configuration structure is not the same as the one stored inside the SDK binary (header/binary mismatch) - kSetConfigurationIncompatibleVersion, - // the Configuration structure supplied for the setConfiguration call is not consistent - kSetConfigurationIncorrectConfiguration, - // the Ansel SDK is delay loaded and setConfiguration is called before the SDK is actually loaded - kSetConfigurationSdkNotLoaded - }; - - enum FovType - { - kHorizontalFov, - kVerticalFov - }; - - struct Configuration - { - // Basis vectors used by the game. They specify the handedness and orientation of - // the game's coordinate system. Think of them as the default orientation of the game - // camera. - nv::Vec3 right, up, forward; - // The speed at which camera moves in the world - float translationalSpeedInWorldUnitsPerSecond; - // The speed at which camera rotates - float rotationalSpeedInDegreesPerSecond; - // How many frames it takes for camera update to be reflected in a rendered frame - uint32_t captureLatency; - // How many frames we must wait for a new frame to settle - i.e. temporal AA and similar - // effects to stabilize after the camera has been adjusted - uint32_t captureSettleLatency; - // Game scale, the size of a world unit measured in meters - float metersInWorldUnit; - // Integration will support Camera::projectionOffsetX/projectionOffsetY - bool isCameraOffcenteredProjectionSupported; - // Integration will support Camera::position - bool isCameraTranslationSupported; - // Integration will support Camera::rotation - bool isCameraRotationSupported; - // Integration will support Camera::horizontalFov - bool isCameraFovSupported; - // Game name, in utf8 encoding, used to name the resulting image files from capturing. - // It is not mandatory to set this field. The name chosen is based on the following - // selection order: - // 1. If GeForce profile exists for the game that name will be used - // 2. If 'titleNameUtf8' is set that will be used - // 3. The executable name is used as a last resort - const char* titleNameUtf8; - // Camera structure will contain vertical FOV if this is set to kVerticalFov - // but horizontal FOV if this is set to kHorizontalFov. To simplify integration set - // this to the same orientation as the game is using. - FovType fovType; - - // These callbacks will be called on the same thread Present()/glSwapBuffers is called - // The thread calling to updateCamera() might be a different thread - - // User defined pointer which is then passed to all the callbacks (nullptr by default) - void* userPointer; - - // The window handle for the game/application where input messages are processed - void* gameWindowHandle; - - // Called when user activates Ansel. Return kDisallowed if the game cannot comply with the - // request. If the function returns kAllowed the following must be done: - // 1. Change the SessionConfigruation settings, but only where you need to (the object - // is already populated with default settings). - // 2. On the next update loop the game will be in an Ansel session. During an Ansel session - // the game : - // a) Must stop drawing UI and HUD elements on the screen, including mouse cursor - // b) Must call ansel::updateCamera on every frame - // c) Should pause rendering time (i.e. no movement should be visible in the world) - // d) Should not act on any input from mouse and keyboard and must not act on any input - // from gamepads - // 3. Step 2 is repeated on every iteration of update loop until Session is stopped. - StartSessionCallback startSessionCallback; - - // Called when Ansel is deactivated. This call will only be made if the previous call - // to the startSessionCallback returned kAllowed. - // Normally games will use this callback to restore their camera to the settings it had - // when the Ansel session was started. - StopSessionCallback stopSessionCallback; - - // Called when the capture of a multipart shot (highres, 360, etc) has started. - // Handy to disable those fullscreen effects that aren't uniform (like vignette) - // This callback is optional (leave nullptr if not needed) - StartCaptureCallback startCaptureCallback; - // Called when the capture of a multipart shot (highres, 360, etc) has stopped. - // Handy to enable those fullscreen effects that were disabled by startCaptureCallback. - // This callback is optional (leave nullptr if not needed) - StopCaptureCallback stopCaptureCallback; - // The 'isFilterOutsideSessionAllowed' setting has been phased out in version 1.3 of the - // SDK. This feature was only temporarily supported and no games took advantage of it. - bool unused2; - // The 'isExrSupported' setting has been phased out in version 1.1 of the SDK. Use - // 'isRawAllowed' setting in SessionConfiguration to enable/disable captures into EXR - // format. - bool unused1; - // Holds the sdk version, doesn't require modifications - uint64_t sdkVersion; - - Configuration() - { - right.x = 0.0f; - right.y = 1.0f; - right.z = 0.0f; - up.x = 0.0f; - up.y = 0.0f; - up.z = 1.0f; - forward.x = 1.0f; - forward.y = 0.0f; - forward.z = 0.0f; - translationalSpeedInWorldUnitsPerSecond = 1.0f; - rotationalSpeedInDegreesPerSecond = 45.0f; - captureLatency = 1; - captureSettleLatency = 0; - metersInWorldUnit = 1.0f; - isCameraOffcenteredProjectionSupported = true; - isCameraTranslationSupported = true; - isCameraRotationSupported = true; - isCameraFovSupported = true; - titleNameUtf8 = nullptr; - fovType = kHorizontalFov; - userPointer = nullptr; - gameWindowHandle = 0; - startSessionCallback = nullptr; - stopSessionCallback = nullptr; - startCaptureCallback = nullptr; - stopCaptureCallback = nullptr; - unused2 = true; - unused1 = false; - sdkVersion = ANSEL_SDK_VERSION; - } - }; - - // Called during startup by the game. See 'Configuration' for further documentation. - ANSEL_SDK_API SetConfigurationStatus setConfiguration(const Configuration& cfg); - - // Can be called *after* D3D device has been created to see if Ansel is available. - // If called prior to D3D device creation it will always return false. - // Can be called *before* calling setConfiguration in which case it'll return true if Ansel is potentially available, otherwise false. - // If setConfiguration fails for any reason this function will return false (even if Ansel would be available otherwise) - // until a successfull call to setConfiguration has been made. - ANSEL_SDK_API bool isAnselAvailable(); -} - +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright 2016 NVIDIA Corporation. All rights reserved. + +#pragma once +#include +#include +#include +#include +#include + +namespace ansel +{ + enum SetConfigurationStatus + { + // successfully initialized the Ansel SDK + kSetConfigurationSuccess, + // the version provided in the Configuration structure is not the same as the one stored inside the SDK binary (header/binary mismatch) + kSetConfigurationIncompatibleVersion, + // the Configuration structure supplied for the setConfiguration call is not consistent + kSetConfigurationIncorrectConfiguration, + // the Ansel SDK is delay loaded and setConfiguration is called before the SDK is actually loaded + kSetConfigurationSdkNotLoaded + }; + + enum FovType + { + kHorizontalFov, + kVerticalFov + }; + + struct Configuration + { + // Basis vectors used by the game. They specify the handedness and orientation of + // the game's coordinate system. Think of them as the default orientation of the game + // camera. + nv::Vec3 right, up, forward; + // The speed at which camera moves in the world + float translationalSpeedInWorldUnitsPerSecond; + // The speed at which camera rotates + float rotationalSpeedInDegreesPerSecond; + // How many frames it takes for camera update to be reflected in a rendered frame + uint32_t captureLatency; + // How many frames we must wait for a new frame to settle - i.e. temporal AA and similar + // effects to stabilize after the camera has been adjusted + uint32_t captureSettleLatency; + // Game scale, the size of a world unit measured in meters + float metersInWorldUnit; + // Integration will support Camera::projectionOffsetX/projectionOffsetY + bool isCameraOffcenteredProjectionSupported; + // Integration will support Camera::position + bool isCameraTranslationSupported; + // Integration will support Camera::rotation + bool isCameraRotationSupported; + // Integration will support Camera::horizontalFov + bool isCameraFovSupported; + // Game name, in utf8 encoding, used to name the resulting image files from capturing. + // It is not mandatory to set this field. The name chosen is based on the following + // selection order: + // 1. If GeForce profile exists for the game that name will be used + // 2. If 'titleNameUtf8' is set that will be used + // 3. The executable name is used as a last resort + const char* titleNameUtf8; + // Camera structure will contain vertical FOV if this is set to kVerticalFov + // but horizontal FOV if this is set to kHorizontalFov. To simplify integration set + // this to the same orientation as the game is using. + FovType fovType; + + // These callbacks will be called on the same thread Present()/glSwapBuffers is called + // The thread calling to updateCamera() might be a different thread + + // User defined pointer which is then passed to all the callbacks (nullptr by default) + void* userPointer; + + // The window handle for the game/application where input messages are processed + void* gameWindowHandle; + + // Called when user activates Ansel. Return kDisallowed if the game cannot comply with the + // request. If the function returns kAllowed the following must be done: + // 1. Change the SessionConfigruation settings, but only where you need to (the object + // is already populated with default settings). + // 2. On the next update loop the game will be in an Ansel session. During an Ansel session + // the game : + // a) Must stop drawing UI and HUD elements on the screen, including mouse cursor + // b) Must call ansel::updateCamera on every frame + // c) Should pause rendering time (i.e. no movement should be visible in the world) + // d) Should not act on any input from mouse and keyboard and must not act on any input + // from gamepads + // 3. Step 2 is repeated on every iteration of update loop until Session is stopped. + StartSessionCallback startSessionCallback; + + // Called when Ansel is deactivated. This call will only be made if the previous call + // to the startSessionCallback returned kAllowed. + // Normally games will use this callback to restore their camera to the settings it had + // when the Ansel session was started. + StopSessionCallback stopSessionCallback; + + // Called when the capture of a multipart shot (highres, 360, etc) has started. + // Handy to disable those fullscreen effects that aren't uniform (like vignette) + // This callback is optional (leave nullptr if not needed) + StartCaptureCallback startCaptureCallback; + // Called when the capture of a multipart shot (highres, 360, etc) has stopped. + // Handy to enable those fullscreen effects that were disabled by startCaptureCallback. + // This callback is optional (leave nullptr if not needed) + StopCaptureCallback stopCaptureCallback; + // The 'isFilterOutsideSessionAllowed' setting has been phased out in version 1.3 of the + // SDK. This feature was only temporarily supported and no games took advantage of it. + bool unused2; + // The 'isExrSupported' setting has been phased out in version 1.1 of the SDK. Use + // 'isRawAllowed' setting in SessionConfiguration to enable/disable captures into EXR + // format. + bool unused1; + // Holds the sdk version, doesn't require modifications + uint64_t sdkVersion; + + Configuration() + { + right.x = 0.0f; + right.y = 1.0f; + right.z = 0.0f; + up.x = 0.0f; + up.y = 0.0f; + up.z = 1.0f; + forward.x = 1.0f; + forward.y = 0.0f; + forward.z = 0.0f; + translationalSpeedInWorldUnitsPerSecond = 1.0f; + rotationalSpeedInDegreesPerSecond = 45.0f; + captureLatency = 1; + captureSettleLatency = 0; + metersInWorldUnit = 1.0f; + isCameraOffcenteredProjectionSupported = true; + isCameraTranslationSupported = true; + isCameraRotationSupported = true; + isCameraFovSupported = true; + titleNameUtf8 = nullptr; + fovType = kHorizontalFov; + userPointer = nullptr; + gameWindowHandle = 0; + startSessionCallback = nullptr; + stopSessionCallback = nullptr; + startCaptureCallback = nullptr; + stopCaptureCallback = nullptr; + unused2 = true; + unused1 = false; + sdkVersion = ANSEL_SDK_VERSION; + } + }; + + // Called during startup by the game. See 'Configuration' for further documentation. + ANSEL_SDK_API SetConfigurationStatus setConfiguration(const Configuration& cfg); + + // Can be called *after* D3D device has been created to see if Ansel is available. + // If called prior to D3D device creation it will always return false. + // Can be called *before* calling setConfiguration in which case it'll return true if Ansel is potentially available, otherwise false. + // If setConfiguration fails for any reason this function will return false (even if Ansel would be available otherwise) + // until a successfull call to setConfiguration has been made. + ANSEL_SDK_API bool isAnselAvailable(); +} + diff --git a/include/ansel/Defines.h b/include/ansel/Defines.h index 1526c76..a591287 100644 --- a/include/ansel/Defines.h +++ b/include/ansel/Defines.h @@ -1,39 +1,39 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and related documentation and -// any modifications thereto. Any use, reproduction, disclosure, or -// distribution of this software and related documentation without an express -// license agreement from NVIDIA Corporation is strictly prohibited. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright 2016 NVIDIA Corporation. All rights reserved. - -#pragma once - -#ifdef ANSEL_SDK_EXPORTS - #define ANSEL_SDK_API extern "C" __declspec(dllexport) - #define ANSEL_SDK_CLASS_API __declspec(dllexport) -#elif !defined(ANSEL_SDK_DELAYLOAD) - #define ANSEL_SDK_API extern "C" __declspec(dllimport) - #define ANSEL_SDK_CLASS_API __declspec(dllimport) -#else - #define ANSEL_SDK_API - #define ANSEL_SDK_CLASS_API -#endif +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright 2016 NVIDIA Corporation. All rights reserved. + +#pragma once + +#ifdef ANSEL_SDK_EXPORTS + #define ANSEL_SDK_API extern "C" __declspec(dllexport) + #define ANSEL_SDK_CLASS_API __declspec(dllexport) +#elif !defined(ANSEL_SDK_DELAYLOAD) + #define ANSEL_SDK_API extern "C" __declspec(dllimport) + #define ANSEL_SDK_CLASS_API __declspec(dllimport) +#else + #define ANSEL_SDK_API + #define ANSEL_SDK_CLASS_API +#endif diff --git a/include/ansel/Hints.h b/include/ansel/Hints.h index 915c255..961cb11 100644 --- a/include/ansel/Hints.h +++ b/include/ansel/Hints.h @@ -1,79 +1,79 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and related documentation and -// any modifications thereto. Any use, reproduction, disclosure, or -// distribution of this software and related documentation without an express -// license agreement from NVIDIA Corporation is strictly prohibited. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright 2016 NVIDIA Corporation. All rights reserved. - -#pragma once -#include -#include - -namespace ansel -{ - enum BufferType - { - kBufferTypeHDR = 0, - kBufferTypeDepth, - kBufferTypeHUDless, - kBufferTypeCount - }; - - enum HintType - { - kHintTypePreBind, - kHintTypePostBind - }; - - enum HintThreadingBehaviour - { - kThreadingBehaviourMatchAutomatic = 0, - kThreadingBehaviourNoMatching = 0xFFFFFFFFFFFFFFFFull - }; - - // Call this right before setting HDR render target active - // bufferType is an optional argument specifying what type of buffer is this - - // an HDR color buffer, a depth buffer or HUDless buffer. The default option is HDR color buffer. - // hintType is an optional argument specifying what type of hint is this - - // it could be called after or before the bind of a buffer that this hint marks. - // The default option is kHintTypePreBind, which means the hint should be called before - // the render target is bound. - // threadId is an optional argument allowing Ansel to match the thread which calls - // SetRenderTarget (or analogous function, since this is graphics API dependent) - // to the thread which called the hint. The default value of kNoMatching - // means that no such matching is going to happen. The special value of 0 means that - // Ansel SDK is going to match thread ids automatically. Any other value means a specific thread id - // known at integration side. - ANSEL_SDK_API void markBufferBind(BufferType bufferType = kBufferTypeHDR, HintType hintType = kHintTypePreBind, uint64_t threadId = kThreadingBehaviourNoMatching); - // Call this right after the last draw call into the HDR render target - // bufferType is an optional argument specifying what type of buffer is this - - // an HDR color buffer, a depth buffer or HUDless buffer. The default option is HDR color buffer. - // threadId is an optional argument allowing Ansel to match the thread which calls - // SetRenderTarget (or analogous function, since this is graphics API dependent) - // to the thread which called the hint. The default value of kNoMatching - // means that no such matching is going to happen. The special value of 0 means that - // Ansel SDK is going to match thread ids automatically. Any other value means a specific thread id - // known at integration side. - ANSEL_SDK_API void markBufferFinished(BufferType bufferType = kBufferTypeHDR, uint64_t threadId = kThreadingBehaviourNoMatching); -} - +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright 2016 NVIDIA Corporation. All rights reserved. + +#pragma once +#include +#include + +namespace ansel +{ + enum BufferType + { + kBufferTypeHDR = 0, + kBufferTypeDepth, + kBufferTypeHUDless, + kBufferTypeCount + }; + + enum HintType + { + kHintTypePreBind, + kHintTypePostBind + }; + + enum HintThreadingBehaviour + { + kThreadingBehaviourMatchAutomatic = 0, + kThreadingBehaviourNoMatching = 0xFFFFFFFFFFFFFFFFull + }; + + // Call this right before setting HDR render target active + // bufferType is an optional argument specifying what type of buffer is this - + // an HDR color buffer, a depth buffer or HUDless buffer. The default option is HDR color buffer. + // hintType is an optional argument specifying what type of hint is this - + // it could be called after or before the bind of a buffer that this hint marks. + // The default option is kHintTypePreBind, which means the hint should be called before + // the render target is bound. + // threadId is an optional argument allowing Ansel to match the thread which calls + // SetRenderTarget (or analogous function, since this is graphics API dependent) + // to the thread which called the hint. The default value of kNoMatching + // means that no such matching is going to happen. The special value of 0 means that + // Ansel SDK is going to match thread ids automatically. Any other value means a specific thread id + // known at integration side. + ANSEL_SDK_API void markBufferBind(BufferType bufferType = kBufferTypeHDR, HintType hintType = kHintTypePreBind, uint64_t threadId = kThreadingBehaviourNoMatching); + // Call this right after the last draw call into the HDR render target + // bufferType is an optional argument specifying what type of buffer is this - + // an HDR color buffer, a depth buffer or HUDless buffer. The default option is HDR color buffer. + // threadId is an optional argument allowing Ansel to match the thread which calls + // SetRenderTarget (or analogous function, since this is graphics API dependent) + // to the thread which called the hint. The default value of kNoMatching + // means that no such matching is going to happen. The special value of 0 means that + // Ansel SDK is going to match thread ids automatically. Any other value means a specific thread id + // known at integration side. + ANSEL_SDK_API void markBufferFinished(BufferType bufferType = kBufferTypeHDR, uint64_t threadId = kThreadingBehaviourNoMatching); +} + diff --git a/include/ansel/Session.h b/include/ansel/Session.h index e9dd9c7..60647b7 100644 --- a/include/ansel/Session.h +++ b/include/ansel/Session.h @@ -1,109 +1,109 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and related documentation and -// any modifications thereto. Any use, reproduction, disclosure, or -// distribution of this software and related documentation without an express -// license agreement from NVIDIA Corporation is strictly prohibited. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright 2016 NVIDIA Corporation. All rights reserved. - -#pragma once -#include - -namespace ansel -{ - struct SessionConfiguration - { - // User can move the camera during session - bool isTranslationAllowed; - // Camera can be rotated during session - bool isRotationAllowed; - // FoV can be modified during session - bool isFovChangeAllowed; - // Game is paused during session - bool isPauseAllowed; - // Game allows highres capture during session - bool isHighresAllowed; - // Game allows 360 capture during session - bool is360MonoAllowed; - // Game allows 360 stereo capture during session - bool is360StereoAllowed; - // Game allows capturing pre-tonemapping raw HDR buffer - bool isRawAllowed; - // The speed at which camera moves in the world, initialized with a value given in Configuration - float translationalSpeedInWorldUnitsPerSecond; - // The speed at which camera rotates, initialized with a value given in Configuration - float rotationalSpeedInDegreesPerSecond; - // The maximum FoV value in degrees displayed in the Ansel UI. - // Any value in the range [140, 179] can be specified and values outside will be clamped to this range. - float maximumFovInDegrees; - - SessionConfiguration() - { - isTranslationAllowed = true; - isRotationAllowed = true; - isFovChangeAllowed = true; - isPauseAllowed = true; - isHighresAllowed = true; - is360MonoAllowed = true; - is360StereoAllowed = true; - isRawAllowed = true; - maximumFovInDegrees = 140.0f; - } - }; - - enum StartSessionStatus - { - kDisallowed = 0, - kAllowed - }; - - enum CaptureType - { - kCaptureType360Mono = 0, - kCaptureType360Stereo, - kCaptureTypeSuperResolution, - kCaptureTypeStereo - }; - - struct CaptureConfiguration - { - CaptureType captureType; - }; - - typedef StartSessionStatus(*StartSessionCallback)(SessionConfiguration& settings, void* userPointer); - typedef void(*StopSessionCallback)(void* userPointer); - typedef void(*StartCaptureCallback)(const CaptureConfiguration&, void* userPointer); - typedef void(*StopCaptureCallback)(void* userPointer); - - // Starts a session if there is not one already active. This function can be used to trigger - // Ansel via any method that the game chooses (key combination, controller input, etc) - ANSEL_SDK_API void startSession(); - - // Stops current session if there is one active. This function needs to be used if the - // startSession function was used to implement custom activation method. The same custom - // activation method needs to used to deactivate Ansel. If for instance left-stick pressed - // was used for startSession then the same should be used for stopping the Ansel session. - // This function can also be used if Ansel session needs to be interrupted - // (for instance an online game where connection loss is experienced and needs to be - // reported). - ANSEL_SDK_API void stopSession(); -} \ No newline at end of file +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright 2016 NVIDIA Corporation. All rights reserved. + +#pragma once +#include + +namespace ansel +{ + struct SessionConfiguration + { + // User can move the camera during session + bool isTranslationAllowed; + // Camera can be rotated during session + bool isRotationAllowed; + // FoV can be modified during session + bool isFovChangeAllowed; + // Game is paused during capture + bool isPauseAllowed; + // Game allows highres capture during session + bool isHighresAllowed; + // Game allows 360 capture during session + bool is360MonoAllowed; + // Game allows 360 stereo capture during session + bool is360StereoAllowed; + // Game allows capturing pre-tonemapping raw HDR buffer + bool isRawAllowed; + // The speed at which camera moves in the world, initialized with a value given in Configuration + float translationalSpeedInWorldUnitsPerSecond; + // The speed at which camera rotates, initialized with a value given in Configuration + float rotationalSpeedInDegreesPerSecond; + // The maximum FoV value in degrees displayed in the Ansel UI. + // Any value in the range [140, 179] can be specified and values outside will be clamped to this range. + float maximumFovInDegrees; + + SessionConfiguration() + { + isTranslationAllowed = true; + isRotationAllowed = true; + isFovChangeAllowed = true; + isPauseAllowed = true; + isHighresAllowed = true; + is360MonoAllowed = true; + is360StereoAllowed = true; + isRawAllowed = true; + maximumFovInDegrees = 140.0f; + } + }; + + enum StartSessionStatus + { + kDisallowed = 0, + kAllowed + }; + + enum CaptureType + { + kCaptureType360Mono = 0, + kCaptureType360Stereo, + kCaptureTypeSuperResolution, + kCaptureTypeStereo + }; + + struct CaptureConfiguration + { + CaptureType captureType; + }; + + typedef StartSessionStatus(__cdecl *StartSessionCallback)(SessionConfiguration& settings, void* userPointer); + typedef void(__cdecl *StopSessionCallback)(void* userPointer); + typedef void(__cdecl *StartCaptureCallback)(const CaptureConfiguration&, void* userPointer); + typedef void(__cdecl *StopCaptureCallback)(void* userPointer); + + // Starts a session if there is not one already active. This function can be used to trigger + // Ansel via any method that the game chooses (key combination, controller input, etc) + ANSEL_SDK_API void startSession(); + + // Stops current session if there is one active. This function needs to be used if the + // startSession function was used to implement custom activation method. The same custom + // activation method needs to used to deactivate Ansel. If for instance left-stick pressed + // was used for startSession then the same should be used for stopping the Ansel session. + // This function can also be used if Ansel session needs to be interrupted + // (for instance an online game where connection loss is experienced and needs to be + // reported). + ANSEL_SDK_API void stopSession(); +} diff --git a/include/ansel/UserControls.h b/include/ansel/UserControls.h index 1abe8bd..a19f0d5 100644 --- a/include/ansel/UserControls.h +++ b/include/ansel/UserControls.h @@ -1,99 +1,99 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and related documentation and -// any modifications thereto. Any use, reproduction, disclosure, or -// distribution of this software and related documentation without an express -// license agreement from NVIDIA Corporation is strictly prohibited. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright 2017 NVIDIA Corporation. All rights reserved. -#pragma once -#include -#include - -namespace ansel -{ - enum UserControlStatus - { - kUserControlOk = 0, - kUserControlIdAlreadyExists, - kUserControlInvalidId, - kUserControlInvalidType, - kUserControlInvalidLabel, - kUserControlNameTooLong, - kUserControlInvalidValue, - kUserControlInvalidLocale, - kUserControlInvalidCallback - }; - - enum UserControlType - { - kUserControlSlider = 0, - kUserControlBoolean - }; - - // This is a structure that is being passed into the UserControlCallback and used to specify - // a control about to be created. - // It contains id of control that was changed in the Ansel UI or about to be created, it's type and - // associated value - // Valid user id is not used by any other control and is an integer starting from 0. - // - // The lifetime of value pointer is only limited to the UserControlCallback callback or addUserControl execution - // - // In case the type is kUserControlSlider: - // value should be a pointer to a floating point value in [0.0, 1.0] inclusive range - // In case the type is kUserControlBoolean: - // value should be a pointer to a boolean value, which is true in case the control is in checked/selected state, otherwise false - // - struct UserControlInfo - { - uint32_t userControlId; - UserControlType userControlType; - const void* value; - }; - - typedef void(*UserControlCallback)(const UserControlInfo& info); - - // This structure describes a control to be added. - // This function requires a valid UserControlCallback callback, a UserControlInfo - // (id, control type and default value) and a label (non nullptr and non - // empty string without '\n', '\r' and '\t') encoded in utf8. The length of the label should - // not exceed 20 characters not counting the trailing zero. - struct UserControlDesc - { - const char* labelUtf8; - UserControlCallback callback; - UserControlInfo info; - }; - - // This function adds a user control defined with the UserControlDesc object - ANSEL_SDK_API UserControlStatus addUserControl(const UserControlDesc& desc); - // This function specifies a translation for a control label. - // This function requires a valid lang (a-la "en-US", "es-ES", etc) and a label (non nullptr and non - // empty string without '\n', '\r' and '\t') encoded in utf8. The length of the label should - // not exceed 20 characters not counting the trailing zero - ANSEL_SDK_API UserControlStatus setUserControlLabelLocalization(uint32_t userControlId, const char* lang, const char* labelUtf8); - // This function removes a control that was added previously - ANSEL_SDK_API UserControlStatus removeUserControl(uint32_t userControlId); - // This function returns the current control value - ANSEL_SDK_API UserControlStatus getUserControlValue(uint32_t userControlId, void* value); - // This function sets the current control value - ANSEL_SDK_API UserControlStatus setUserControlValue(uint32_t userControlId, const void* value); -} +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright 2017 NVIDIA Corporation. All rights reserved. +#pragma once +#include +#include + +namespace ansel +{ + enum UserControlStatus + { + kUserControlOk = 0, + kUserControlIdAlreadyExists, + kUserControlInvalidId, + kUserControlInvalidType, + kUserControlInvalidLabel, + kUserControlNameTooLong, + kUserControlInvalidValue, + kUserControlInvalidLocale, + kUserControlInvalidCallback + }; + + enum UserControlType + { + kUserControlSlider = 0, + kUserControlBoolean + }; + + // This is a structure that is being passed into the UserControlCallback and used to specify + // a control about to be created. + // It contains id of control that was changed in the Ansel UI or about to be created, it's type and + // associated value + // Valid user id is not used by any other control and is an integer starting from 0. + // + // The lifetime of value pointer is only limited to the UserControlCallback callback or addUserControl execution + // + // In case the type is kUserControlSlider: + // value should be a pointer to a floating point value in [0.0, 1.0] inclusive range + // In case the type is kUserControlBoolean: + // value should be a pointer to a boolean value, which is true in case the control is in checked/selected state, otherwise false + // + struct UserControlInfo + { + uint32_t userControlId; + UserControlType userControlType; + const void* value; + }; + + typedef void(*UserControlCallback)(const UserControlInfo& info); + + // This structure describes a control to be added. + // This function requires a valid UserControlCallback callback, a UserControlInfo + // (id, control type and default value) and a label (non nullptr and non + // empty string without '\n', '\r' and '\t') encoded in utf8. The length of the label should + // not exceed 20 characters not counting the trailing zero. + struct UserControlDesc + { + const char* labelUtf8; + UserControlCallback callback; + UserControlInfo info; + }; + + // This function adds a user control defined with the UserControlDesc object + ANSEL_SDK_API UserControlStatus addUserControl(const UserControlDesc& desc); + // This function specifies a translation for a control label. + // This function requires a valid lang (a-la "en-US", "es-ES", etc) and a label (non nullptr and non + // empty string without '\n', '\r' and '\t') encoded in utf8. The length of the label should + // not exceed 20 characters not counting the trailing zero + ANSEL_SDK_API UserControlStatus setUserControlLabelLocalization(uint32_t userControlId, const char* lang, const char* labelUtf8); + // This function removes a control that was added previously + ANSEL_SDK_API UserControlStatus removeUserControl(uint32_t userControlId); + // This function returns the current control value + ANSEL_SDK_API UserControlStatus getUserControlValue(uint32_t userControlId, void* value); + // This function sets the current control value + ANSEL_SDK_API UserControlStatus setUserControlValue(uint32_t userControlId, const void* value); +} diff --git a/include/ansel/Version.h b/include/ansel/Version.h index 1134c58..ea3b9a5 100644 --- a/include/ansel/Version.h +++ b/include/ansel/Version.h @@ -1,52 +1,52 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and related documentation and -// any modifications thereto. Any use, reproduction, disclosure, or -// distribution of this software and related documentation without an express -// license agreement from NVIDIA Corporation is strictly prohibited. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright 2016 NVIDIA Corporation. All rights reserved. - -#pragma once - -// These are the version numbers used to version the API between Ansel SDK and the driver. -// The driver provides backwards compatibility to all MINOR versions that are equal or lower -// but requires matching MAJOR version. This effectively means that MAJOR version number will *not* -// change because this would mean that a newer driver would stop supporting older Ansel SDKs. -// The driver does however not provide forwards compatibility, i.e. when a new interface or change -// in behavior is introduced between Ansel SDK and the driver the MINOR version is incremented. This -// means that new driver supporting this new MINOR version is required. To track this relationship -// we use the MINIMUM_DRIVER_VERSION define. When you increment MINOR version you need to adjust the -// MINIMUM_DRIVER_VERSION as well. While a public driver hasn't been finalized use our internal -// release tags to identify it (like 378.GA2). -#define ANSEL_SDK_PRODUCT_VERSION_MAJOR 1 -#define ANSEL_SDK_PRODUCT_VERSION_MINOR 4 -#define ANSEL_SDK_MINIMUM_DRIVER_VERSION "384.76" - -// The lines below are automatically updated by build agents. Please don't touch. -// The BUILD_NUMBER and COMMIT_HASH are useful in uniquely identifying a build of the Ansel SDK. -// Changes to the customer facing API can be tracked with these since they are automatically -// updated every time a change is made. -#define ANSEL_SDK_BUILD_NUMBER 295 -#define ANSEL_SDK_COMMIT_HASH 0xb92d0fac - -#define ANSEL_SDK_VERSION ( uint64_t(ANSEL_SDK_PRODUCT_VERSION_MAJOR) << 48 | uint64_t(ANSEL_SDK_PRODUCT_VERSION_MINOR) << 32 \ - | ANSEL_SDK_COMMIT_HASH ) +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright 2016 NVIDIA Corporation. All rights reserved. + +#pragma once + +// These are the version numbers used to version the API between Ansel SDK and the driver. +// The driver provides backwards compatibility to all MINOR versions that are equal or lower +// but requires matching MAJOR version. This effectively means that MAJOR version number will *not* +// change because this would mean that a newer driver would stop supporting older Ansel SDKs. +// The driver does however not provide forwards compatibility, i.e. when a new interface or change +// in behavior is introduced between Ansel SDK and the driver the MINOR version is incremented. This +// means that new driver supporting this new MINOR version is required. To track this relationship +// we use the MINIMUM_DRIVER_VERSION define. When you increment MINOR version you need to adjust the +// MINIMUM_DRIVER_VERSION as well. While a public driver hasn't been finalized use our internal +// release tags to identify it (like 378.GA2). +#define ANSEL_SDK_PRODUCT_VERSION_MAJOR 1 +#define ANSEL_SDK_PRODUCT_VERSION_MINOR 4 +#define ANSEL_SDK_MINIMUM_DRIVER_VERSION "384.76" + +// The lines below are automatically updated by build agents. Please don't touch. +// The BUILD_NUMBER and COMMIT_HASH are useful in uniquely identifying a build of the Ansel SDK. +// Changes to the customer facing API can be tracked with these since they are automatically +// updated every time a change is made. +#define ANSEL_SDK_BUILD_NUMBER 339 +#define ANSEL_SDK_COMMIT_HASH 0x212e90ca + +#define ANSEL_SDK_VERSION ( uint64_t(ANSEL_SDK_PRODUCT_VERSION_MAJOR) << 48 | uint64_t(ANSEL_SDK_PRODUCT_VERSION_MINOR) << 32 \ + | ANSEL_SDK_COMMIT_HASH ) diff --git a/include/nv/Quat.h b/include/nv/Quat.h index 94a4b44..c861d49 100644 --- a/include/nv/Quat.h +++ b/include/nv/Quat.h @@ -1,10 +1,10 @@ -#pragma once - -namespace nv -{ - struct Quat - { - float x, y, z, w; - }; -} - +#pragma once + +namespace nv +{ + struct Quat + { + float x, y, z, w; + }; +} + diff --git a/include/nv/Vec3.h b/include/nv/Vec3.h index e7e7d86..757b908 100644 --- a/include/nv/Vec3.h +++ b/include/nv/Vec3.h @@ -1,12 +1,12 @@ -#pragma once - -namespace nv -{ - -struct Vec3 -{ - float x, y, z; -}; - - +#pragma once + +namespace nv +{ + +struct Vec3 +{ + float x, y, z; +}; + + } // end of nv namspace \ No newline at end of file -- cgit v1.2.3