コード例 #1
0
        static partial void LoadPlatformEntryPoints()
        {
            BindAPI = (BindAPIDelegate)Marshal.GetDelegateForFunctionPointer(EntryPointHelper.GetAddress("eglBindAPI"), typeof(BindAPIDelegate));
            var supportsFullGL = BindAPI(RenderApi.GL);

            if (!supportsFullGL)
            {
                BindAPI(RenderApi.ES);
                BoundApi = RenderApi.ES;
            }
        }
コード例 #2
0
 internal static System.Delegate LoadEntryPoint <T>(string proc, bool throwIfNotFound = false)
 {
     try
     {
         var addr = EntryPointHelper.GetAddress(proc);
         if (addr == IntPtr.Zero)
         {
             return(null);
         }
         return(Marshal.GetDelegateForFunctionPointer(addr, typeof(T)));
     }
     catch (EntryPointNotFoundException)
     {
         if (throwIfNotFound)
         {
             throw;
         }
         return(null);
     }
 }