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