aboutsummaryrefslogtreecommitdiffstatsci
path: root/vulkan/ExternalTypes.cs
blob: dfde870185f69687d2c515161d3aaaa1d08e598d (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright (c) 2017 Eric Mellino
// Copyright (c) 2019  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;

namespace Vulkan
{
    // Windows

    namespace Win32
    {
        public struct HINSTANCE
        {
            public IntPtr Handle;
            public static implicit operator IntPtr(HINSTANCE hinst) => hinst.Handle;
            public static implicit operator HINSTANCE(IntPtr handle) => new HINSTANCE() { Handle = handle };
        }

        public struct HWND
        {
            public IntPtr Handle;
            public static implicit operator IntPtr(HWND hwnd) => hwnd.Handle;
            public static implicit operator HWND(IntPtr handle) => new HWND() { Handle = handle };
        }

        public struct HANDLE
        {
            public IntPtr Handle;
            public static implicit operator IntPtr(HANDLE handle) => handle.Handle;
            public static implicit operator HANDLE(IntPtr handle) => new HANDLE() { Handle = handle };
        }

        public struct SECURITY_ATTRIBUTES
        {
            public uint nLength;
            public IntPtr lpSecurityDescriptor;
            public uint bInheritHandle;
        }
    }

    // Android
    namespace Android
    {
        public struct ANativeWindow { }
    }

    // Linux
    namespace Mir
    {
        public struct MirConnection { }
        public struct MirSurface { }
    }

    namespace Wayland
    {
        public struct wl_display { }
        public struct wl_surface { }
    }

    namespace Xlib
    {
        public struct Display { }
        public struct Window
        {
            public IntPtr Value;
        }
        public struct VisualID
        {
            public ulong ID;
            public static implicit operator VisualID(ulong value) => new VisualID() { ID = value };
            public static implicit operator ulong(VisualID id) => id.ID;
        }
    }

    namespace Xcb
    {
        public struct xcb_connection_t { }
        public struct xcb_window_t { }
        public struct xcb_visualid_t
        {
            public uint ID;
            public static implicit operator xcb_visualid_t(uint value) => new xcb_visualid_t() { ID = value };
            public static implicit operator uint(xcb_visualid_t id) => id.ID;
        }
    }
}