private static IntPtr dlsym(IntPtr handle, string symbol)
 {
     try
     {
         return(LibDlSo2.dlsym(handle, symbol));
     }
     catch (DllNotFoundException)
     {
         return(LibDl.dlsym(handle, symbol));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets a function pointer for the specificed Vulkan command.
 /// </summary>
 /// <param name="name">
 /// The name of the command.
 /// </param>
 /// <returns>
 /// A function pointer to the native procedure call.
 /// </returns>
 public IntPtr GetProcedureAddress(string name)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         return(Kernel32.GetProcAddress(this.library, name));
     }
     else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
     {
         return(LibDl.dlsym(this.library, name));
     }
     else
     {
         throw new NotSupportedException($"{RuntimeInformation.OSDescription} is not a supported platform for SharpVK.");
     }
 }