예제 #1
0
            /// <summary>This is basically `xrGetInstanceProcAddr` from OpenXR,
            /// you can use this to get and call functions from an extension
            /// you've loaded. This uses `Marshal.GetDelegateForFunctionPointer`
            /// to turn the result into a delegate that you can call.</summary>
            /// <param name="functionName"></param>
            /// <returns>A delegate, or null on failure.</returns>
            public static TDelegate GetFunction <TDelegate>(string functionName)
            {
                IntPtr fn = NativeAPI.backend_openxr_get_function(functionName);

                if (fn == null)
                {
                    return(default);
예제 #2
0
 /// <summary>This is basically `xrGetInstanceProcAddr` from OpenXR,
 /// you can use this to get and call functions from an extension
 /// you've loaded. You can use `Marshal.GetDelegateForFunctionPointer`
 /// to turn the result into a delegate that you can call.</summary>
 /// <param name="functionName"></param>
 /// <returns>A function pointer, or null on failure. You can use
 /// `Marshal.GetDelegateForFunctionPointer` to turn this into a
 /// delegate that you can call.</returns>
 public static IntPtr GetFunctionPtr(string functionName) => NativeAPI.backend_openxr_get_function(functionName);