1 module directx.win32;
2 
3 public import core.sys.windows.windows;
4 public import core.sys.windows.com;
5 
6 pure nothrow @safe @nogc
7 HRESULT MAKE_HRESULT(bool s, uint f, uint c) {
8 	return (s << 31) | (f << 16) | c;
9 }
10 
11 union LARGE_INTEGER {
12 	struct {
13 		uint LowPart;
14 		int  HighPart;
15 	}
16 	long QuadPart;
17 }
18 
19 alias LARGE_INTEGER LUID;
20 alias size_t SIZE_T;
21 
22 alias UINT8 = ubyte;
23 alias UINT16 = ushort;
24 alias UINT32 = uint;
25 alias UINT64 = ulong;
26 
27 alias INT8 = byte;
28 alias INT16 = short;
29 alias INT32 = int;
30 alias INT64 = long;
31 
32 alias HANDLE HMONITOR;
33 alias const(void)* LPCVOID;
34 
35 struct tagSIZE
36 {
37 	LONG        cx;
38 	LONG        cy;
39 } 
40 alias SIZE = tagSIZE;
41 alias PSIZE = tagSIZE*;
42 alias LPSIZE = tagSIZE*;
43 alias SIZEL = SIZE;
44 alias PSIZEL = SIZE*;
45 alias LPSIZEL = SIZE*;
46 
47 // ======= XAudio2 stuff
48 version (HAS_WIN32)
49 {
50 }
51 else
52 {
53 // some predefinitions
54 align(1)
55 struct WAVEFORMATEX
56 {
57 	align(1):
58 	WORD        wFormatTag;         /* format type */
59 	WORD        nChannels;          /* number of channels (i.e. mono, stereo...) */
60 	DWORD       nSamplesPerSec;     /* sample rate */
61 	DWORD       nAvgBytesPerSec;    /* for buffer estimation */
62 	WORD        nBlockAlign;        /* block size of data */
63 	WORD        wBitsPerSample;     /* number of bits per sample of mono data */
64 	WORD        cbSize;             /* the count in bytes of the size of */
65 	/* extra information (after cbSize) */
66 }
67 //WAVEFORMATEX, *PWAVEFORMATEX, NEAR *NPWAVEFORMATEX, FAR *LPWAVEFORMATEX;
68 
69 struct WAVEFORMATEXTENSIBLE
70 {
71 	WAVEFORMATEX Format;          // Base WAVEFORMATEX data
72 	union Samples
73 	{
74 		WORD wValidBitsPerSample; // Valid bits in each sample container
75 		WORD wSamplesPerBlock;    // Samples per block of audio data; valid
76                                   // if wBitsPerSample=0 (but rarely used).
77 		WORD wReserved;           // Zero if neither case above applies.
78 	}
79 	DWORD dwChannelMask;          // Positions of the audio channels
80 	GUID SubFormat;               // Format identifier GUID
81 }
82 
83 } // !version (HAS_WIN32)