/// <summary>
        /// Destroy the singleton instance.
        /// </summary>
        public static void ShutdownRemoteRendering()
        {
            if (!IsInitialized)
            {
                return;
            }

            OnShutdown?.Invoke();

            // Destroy all memory associated with the system backend
            NativeLibraryExtensions.RemoteRendering_Shutdown();
            IsInitialized = false;
        }
        /// <summary>
        /// Create the singleton instance. Calling this function multiple times will clear any current data/connection from the system.
        /// </summary>
        public static void StartupRemoteRendering(RemoteRenderingInitialization managerInit)
        {
            if (IsInitialized)
            {
                throw new Exception("Remote Rendering Manager already created. Call RenderingConnection.ShutdownManager first.");
            }

            var r = NativeLibraryExtensions.RemoteRendering_Startup(ref managerInit);

            if (r != Result.Success)
            {
                throw new RRException(r, "Could not initialize remote rendering.");
            }

            IsInitialized = true;
        }
Beispiel #3
0
 /// <summary>
 /// Converts this FOV to a perspective projection matrix.
 /// </summary>
 /// <param name="nearPlane">The z-distance of the nearPlane</param>
 /// <param name="farPlane">The z-distance of the farPlane</param>
 /// <param name="depthConvention">The local z convention to use for this projection matrix.</param>
 /// <param name="projection">The resulting projection matrix.</param>
 /// <remarks>
 /// If the FOV is currently invalid or one of the plane parameters is 0,
 /// the function will return a <see cref="Result.InvalidParam"/> error.
 /// </remarks>
 public Result ToProjectionMatrix(float nearPlane, float farPlane, DepthConvention depthConvention, out Matrix4x4 projection)
 {
     return(NativeLibraryExtensions.RemoteRendering_fov_to_projection_matrix(ref this, nearPlane, farPlane, depthConvention, out projection));
 }
Beispiel #4
0
 /// <summary>
 /// Converts the part of the given projection matrix which governs the field of view to
 /// the generic field of view representation used here.
 /// </summary>
 /// <param name="projection">The 4x4 perspective projection matrix to convert.</param>
 /// <remarks>
 /// If the projection matrix is not a valid perspective projection, the function will
 /// return a <see cref="Result.InvalidParam"/> error.
 /// </remarks>
 public Result FromProjectionMatrix(Matrix4x4 projection)
 {
     return(NativeLibraryExtensions.RemoteRendering_fov_from_projection_matrix(ref projection, out this));
 }