@@ -16,86 +16,12 @@ pub const xaudio2 = @import("bindings/xaudio2.zig");
1616pub const xaudio2fx = @import ("bindings/xaudio2fx.zig" );
1717pub const xapo = @import ("bindings/xapo.zig" );
1818pub const xinput = @import ("bindings/xinput.zig" );
19- pub const dds_loader = @import ("bindings/dds_loader.zig" );
2019pub const d3dcompiler = @import ("bindings/d3dcompiler.zig" );
2120
2221const std = @import ("std" );
2322const panic = std .debug .panic ;
2423const assert = std .debug .assert ;
2524
26- const WINAPI = std .os .windows .WINAPI ;
27- const S_OK = std .os .windows .S_OK ;
28- const S_FALSE = std .os .windows .S_FALSE ;
29- const E_NOTIMPL = std .os .windows .E_NOTIMPL ;
30- const E_NOINTERFACE = std .os .windows .E_NOINTERFACE ;
31- const E_POINTER = std .os .windows .E_POINTER ;
32- const E_ABORT = std .os .windows .E_ABORT ;
33- const E_FAIL = std .os .windows .E_FAIL ;
34- const E_UNEXPECTED = std .os .windows .E_UNEXPECTED ;
35- const E_ACCESSDENIED = std .os .windows .E_ACCESSDENIED ;
36- const E_HANDLE = std .os .windows .E_HANDLE ;
37- const E_OUTOFMEMORY = std .os .windows .E_OUTOFMEMORY ;
38- const E_INVALIDARG = std .os .windows .E_INVALIDARG ;
39- const GENERIC_READ = std .os .windows .GENERIC_READ ;
40- const GENERIC_WRITE = std .os .windows .GENERIC_WRITE ;
41- const GENERIC_EXECUTE = std .os .windows .GENERIC_EXECUTE ;
42- const GENERIC_ALL = std .os .windows .GENERIC_ALL ;
43- const EVENT_ALL_ACCESS = std .os .windows .EVENT_ALL_ACCESS ;
44- const TRUE = std .os .windows .TRUE ;
45- const FALSE = std .os .windows .FALSE ;
46- const BOOL = std .os .windows .BOOL ;
47- const BOOLEAN = std .os .windows .BOOLEAN ;
48- const BYTE = std .os .windows .BYTE ;
49- const CHAR = std .os .windows .CHAR ;
50- const UCHAR = std .os .windows .UCHAR ;
51- const WCHAR = std .os .windows .WCHAR ;
52- const FLOAT = std .os .windows .FLOAT ;
53- const HCRYPTPROV = std .os .windows .HCRYPTPROV ;
54- const ATOM = std .os .windows .ATOM ;
55- const WPARAM = std .os .windows .WPARAM ;
56- const LPARAM = std .os .windows .LPARAM ;
57- const LRESULT = std .os .windows .LRESULT ;
58- const HRESULT = std .os .windows .HRESULT ;
59- const HBRUSH = std .os .windows .HBRUSH ;
60- const HCURSOR = std .os .windows .HCURSOR ;
61- const HICON = std .os .windows .HICON ;
62- const HINSTANCE = std .os .windows .HINSTANCE ;
63- const HMENU = std .os .windows .HMENU ;
64- const HMODULE = std .os .windows .HMODULE ;
65- const HWND = std .os .windows .HWND ;
66- const HDC = std .os .windows .HDC ;
67- const HGLRC = std .os .windows .HGLRC ;
68- const FARPROC = std .os .windows .FARPROC ;
69- const INT = std .os .windows .INT ;
70- const SIZE_T = std .os .windows .SIZE_T ;
71- const UINT = std .os .windows .UINT ;
72- const USHORT = std .os .windows .USHORT ;
73- const SHORT = std .os .windows .SHORT ;
74- const ULONG = std .os .windows .ULONG ;
75- const LONG = std .os .windows .LONG ;
76- const WORD = std .os .windows .WORD ;
77- const DWORD = std .os .windows .DWORD ;
78- const ULONGLONG = std .os .windows .ULONGLONG ;
79- const LONGLONG = std .os .windows .LONGLONG ;
80- const LARGE_INTEGER = std .os .windows .LARGE_INTEGER ;
81- const ULARGE_INTEGER = std .os .windows .ULARGE_INTEGER ;
82- const LPCSTR = std .os .windows .LPCSTR ;
83- const LPCVOID = std .os .windows .LPCVOID ;
84- const LPSTR = std .os .windows .LPSTR ;
85- const LPVOID = std .os .windows .LPVOID ;
86- const LPWSTR = std .os .windows .LPWSTR ;
87- const LPCWSTR = std .os .windows .LPCSWTR ;
88- const PVOID = std .os .windows .PVOID ;
89- const PWSTR = std .os .windows .PWSTR ;
90- const PCWSTR = std .os .windows .PCWSTR ;
91- const HANDLE = std .os .windows .HANDLE ;
92- const GUID = std .os .windows .GUID ;
93- const NTSTATUS = std .os .windows .NTSTATUS ;
94- const CRITICAL_SECTION = std .os .windows .CRITICAL_SECTION ;
95- const SECURITY_ATTRIBUTES = std .os .windows .SECURITY_ATTRIBUTES ;
96- const RECT = std .os .windows .RECT ;
97- const POINT = std .os .windows .POINT ;
98-
9925/// https://docs.microsoft.com/en-us/windows/win32/com/com-error-codes-10
10026///
10127/// [DEPRECATED]: Use proc specific errors as in std.os.windows
@@ -110,22 +36,22 @@ pub fn hrPanic(err: HResultError) noreturn {
11036 );
11137}
11238
113- pub inline fn hrPanicOnFail (hr : HRESULT ) void {
114- if (hr != S_OK ) {
39+ pub inline fn hrPanicOnFail (hr : windows. HRESULT ) void {
40+ if (hr != windows . S_OK ) {
11541 hrPanic (hrToError (hr ));
11642 }
11743}
11844
11945/// [DEPRECATED]: Use proc specific errors as in std.os.windows
120- pub inline fn hrErrorOnFail (hr : HRESULT ) HResultError ! void {
121- if (hr != S_OK ) {
46+ pub inline fn hrErrorOnFail (hr : windows. HRESULT ) HResultError ! void {
47+ if (hr != windows . S_OK ) {
12248 return hrToError (hr );
12349 }
12450}
12551
12652/// [DEPRECATED]: Use proc specific errors as in std.os.windows
127- pub fn hrToError (hr : HRESULT ) HResultError {
128- assert (hr != S_OK );
53+ pub fn hrToError (hr : windows. HRESULT ) HResultError {
54+ assert (hr != windows . S_OK );
12955 return switch (hr ) {
13056 //
13157 windows .E_UNEXPECTED = > windows .Error .UNEXPECTED ,
@@ -214,17 +140,17 @@ pub fn hrToError(hr: HRESULT) HResultError {
214140 };
215141}
216142
217- pub fn errorToHRESULT (err : HResultError ) HRESULT {
143+ pub fn errorToHRESULT (err : HResultError ) windows. HRESULT {
218144 return switch (err ) {
219- windows .Error .UNEXPECTED = > E_UNEXPECTED ,
220- windows .Error .NOTIMPL = > E_NOTIMPL ,
221- windows .Error .OUTOFMEMORY = > E_OUTOFMEMORY ,
222- windows .Error .INVALIDARG = > E_INVALIDARG ,
223- windows .Error .POINTER = > E_POINTER ,
224- windows .Error .HANDLE = > E_HANDLE ,
225- windows .Error .ABORT = > E_ABORT ,
226- windows .Error .FAIL = > E_FAIL ,
227- windows .Error .ACCESSDENIED = > E_ACCESSDENIED ,
145+ windows .Error .UNEXPECTED = > windows . E_UNEXPECTED ,
146+ windows .Error .NOTIMPL = > windows . E_NOTIMPL ,
147+ windows .Error .OUTOFMEMORY = > windows . E_OUTOFMEMORY ,
148+ windows .Error .INVALIDARG = > windows . E_INVALIDARG ,
149+ windows .Error .POINTER = > windows . E_POINTER ,
150+ windows .Error .HANDLE = > windows . E_HANDLE ,
151+ windows .Error .ABORT = > windows . E_ABORT ,
152+ windows .Error .FAIL = > windows . E_FAIL ,
153+ windows .Error .ACCESSDENIED = > windows . E_ACCESSDENIED ,
228154 //
229155 dxgi .Error .ACCESS_DENIED = > dxgi .ERROR_ACCESS_DENIED ,
230156 dxgi .Error .ACCESS_LOST = > dxgi .ERROR_ACCESS_LOST ,
0 commit comments