Esempio n. 1
0
        public Result Initialize(MgApplicationInfo appInfo, MgInstanceExtensionOptions options)
        {
            string[] extensions = null;
            if (options == MgInstanceExtensionOptions.ALL)
            {
                MgExtensionProperties[] extensionProperties;
                var err = mEntrypoint.EnumerateInstanceExtensionProperties(null, out extensionProperties);

                Debug.Assert(err == Result.SUCCESS, err + " != Result.SUCCESS");

                var enabledExtensions = new List <string>();
                if (extensionProperties != null)
                {
                    foreach (var ext in extensionProperties)
                    {
                        enabledExtensions.Add(ext.ExtensionName);
                    }
                }
                extensions = enabledExtensions.ToArray();
            }
            else if (options == MgInstanceExtensionOptions.SWAPCHAIN_ONLY)
            {
                extensions = new string[] { "VK_KHR_swapchain" };
            }


            return(Initialize(appInfo, null, extensions));
        }
Esempio n. 2
0
        public void Initialize(MgApplicationInfo appInfo, MgEnableExtensionsOption options)
        {
            string[] extensions = null;
            if (options == MgEnableExtensionsOption.ALL)
            {
                MgExtensionProperties[] extensionProperties;
                var err = mEntrypoint.EnumerateInstanceExtensionProperties(null, out extensionProperties);

                Debug.Assert(err == Result.SUCCESS, err + " != Result.SUCCESS");

                var enabledExtensions = new List <string>();
                if (extensionProperties != null)
                {
                    foreach (var ext in extensionProperties)
                    {
                        enabledExtensions.Add(ext.ExtensionName);
                    }
                }
                extensions = enabledExtensions.ToArray();
            }

            Initialize(appInfo, null, extensions);
        }