1 module directx.d3dx11core;
2 ///////////////////////////////////////////////////////////////////////////
3 //
4 //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
5 //
6 //  File:       d3dx11core.h
7 //  Content:    D3DX11 core types and functions
8 //
9 ///////////////////////////////////////////////////////////////////////////
10 
11 import directx.win32;
12 import directx.com;
13 import directx.d3d11;
14 
15 // TODO: better handling to dll version name
16 
17 // Current name of the DLL shipped in the same SDK as this header.
18 
19 enum D3DX11_DLL_W = "d3dx11_43.dll"w;
20 enum D3DX11_DLL_A = "d3dx11_43.dll";
21 
22 alias D3DX11_DLL_W D3DX11_DLL;
23 
24 ///////////////////////////////////////////////////////////////////////////
25 // D3DX11_SDK_VERSION:
26 // -----------------
27 // This identifier is passed to D3DX11CheckVersion in order to ensure that an
28 // application was built against the correct header files and lib files. 
29 // This number is incremented whenever a header (or other) change would 
30 // require applications to be rebuilt. If the version doesn't match, 
31 // D3DX11CreateVersion will return FALSE. (The number itself has no meaning.)
32 ///////////////////////////////////////////////////////////////////////////
33 
34 
35 enum D3DX11_SDK_VERSION = 43;
36 
37 
38 version(D3D_DIAG_DLL)
39 extern(Windows) BOOL D3DX11DebugMute(BOOL Mute);  
40 
41 extern(Windows) HRESULT D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion);
42 
43 
44 //////////////////////////////////////////////////////////////////////////////
45 // ID3DX11ThreadPump:
46 //////////////////////////////////////////////////////////////////////////////
47 
48 interface ID3DX11DataLoader
49 {
50 	extern(Windows):
51 	HRESULT Load();
52 	HRESULT Decompress(void** ppData, SIZE_T* pcBytes);
53 	HRESULT Destroy();
54 }
55 
56 interface ID3DX11DataProcessor
57 {
58 	extern(Windows):
59 	HRESULT Process(void* pData, SIZE_T cBytes);
60 	HRESULT CreateDeviceObject(void** ppDataObject);
61 	HRESULT Destroy();
62 }
63 
64 mixin( uuid!(ID3DX11ThreadPump, "C93FECFA-6967-478a-ABBC-402D90621FCB") );
65 interface ID3DX11ThreadPump : IUnknown
66 {
67 	extern(Windows):
68     HRESULT AddWorkItem(ID3DX11DataLoader pDataLoader, ID3DX11DataProcessor pDataProcessor, HRESULT* pHResult, void** ppDeviceObject);
69     UINT GetWorkItemCount();
70 
71     HRESULT WaitForAllItems();
72     HRESULT ProcessDeviceWorkItems(UINT iWorkItemCount);
73 
74     HRESULT PurgeAllItems();
75     HRESULT GetQueueStatus(UINT* pIoQueue, UINT* pProcessQueue, UINT* pDeviceQueue);
76 }
77 
78 
79 extern(Windows) HRESULT D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump* ppThreadPump);
80 
81 extern(Windows) HRESULT D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext pContext);
82 
83 
84 
85 ///////////////////////////////////////////////////////////////////////////
86 
87 enum _FACD3D  = 0x876;
88 
89 HRESULT MAKE_D3DHRESULT(T)(T code) {
90 	return MAKE_HRESULT(1, _FACD3D, code);
91 }
92 
93 HRESULT MAKE_D3DSTATUS(T)(T code) {
94 	return MAKE_HRESULT(0, _FACD3D, code);
95 }
96 
97 enum D3DERR_INVALIDCALL                  = MAKE_D3DHRESULT(2156);
98 enum D3DERR_WASSTILLDRAWING              = MAKE_D3DHRESULT(540);