예제 #1
0
        public static void Main()
        {
            // https://gist.github.com/graphitemaster/e162a24e57379af840d4
            var applicationInfo = new ApplicationInfo
            {
                ApplicationName = "Tutorial 1",
                EngineName      = "",
                EngineVersion   = 1,
                ApiVersion      = Version.Make(1, 0, 0)
            };
            var instanceInfo = new InstanceCreateInfo
            {
                ApplicationInfo       = applicationInfo,
                Flags                 = 0,
                EnabledLayerCount     = 0,
                EnabledLayerNames     = null,
                EnabledExtensionCount = 2,
                EnabledExtensionNames = new [] {
                    Extension.KhrSurface,
                    Extension.KhrWin32Surface
                }
            };
            var instance = new Instance(instanceInfo);
            var devices  = instance.EnumeratePhysicalDevices();

            foreach (var dev in devices)
            {
                PrintDeviceInformation(dev);
            }

            var physicalDevice = devices.First();
            var device         = CreateAbstractDevice(physicalDevice);

            var window = new Window();

            window.Show();

            var swapChain = new SwapChain(instance, physicalDevice, device);

            swapChain.Initialize(window);
            swapChain.Create(null);

            instance.Destroy();

            Console.ReadLine();
        }
예제 #2
0
 private static Instance GetInstance()
 {
     return(new Instance(new InstanceCreateInfo
     {
         ApplicationInfo = new ApplicationInfo
         {
             ApiVersion = Version.Make(1, 0, 0),
             ApplicationName = "Vulkan Demo",
             ApplicationVersion = 1,
             EngineName = "Vulkan Demo",
             EngineVersion = 1
         },
         EnabledLayerNames = new[] {
             Layer.LunarGStandardValidation
         },
         EnabledExtensionNames = new[] {
             Extension.KhrSurface,
             Extension.KhrWin32Surface
         }
     }));
 }
예제 #3
0
 public MyInstance(string applicationName)
 {
     _instance = new Instance(new InstanceCreateInfo
     {
         ApplicationInfo = new ApplicationInfo
         {
             ApplicationName    = applicationName,
             ApplicationVersion = 1,
             EngineName         = "Illustrate Demo",
             EngineVersion      = 1,
             ApiVersion         = Version.Make(1, 0, 0)
         },
         EnabledExtensionNames = new[] {
             Extension.KhrSurface,
             Extension.KhrWin32Surface
         },
         EnabledLayerNames = new[] {
             Layer.LunarGCoreValidation
         }
     });
 }