aboutsummaryrefslogtreecommitdiffstatsci
path: root/tests/Program.cs
blob: 5900aeb8bfbbc1ed8d48aa76c1f68b5d18164dde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using Vulkan;
using static Vulkan.Vk;
using Version = Vulkan.Version;

namespace tests
{
	class Program
	{

		static void Main(string[] args)
		{
			VkInstance instance;

			VkInstanceCreateInfo ci = VkInstanceCreateInfo.New();
			VkApplicationInfo ai = VkApplicationInfo.New();
			ai.apiVersion = new Version (1,0,0);
			ai.applicationVersion = new Version (1,0,0);
			ai.pApplicationName = "new application name";
			ai.pEngineName = "new engine name";


			VkClearColorValue clear = new VkClearColorValue(255,0,0);
			clear.floats[2] = 210;

			using (PinnedObjects pi = new PinnedObjects()) {
				ci.pApplicationInfo = ai;

				VkResult res = vkCreateInstance (ref ci, IntPtr.Zero, out instance);
				if (res != VkResult.Success) {
					Console.WriteLine ($"Error: {res}");
					return;
				}else
					Console.WriteLine ($"Success: {res}");

			}

			vkDestroyInstance (instance, IntPtr.Zero);
		}
	}
}