1 /*==========================================================================;
2  *
3  *  Copyright (C) Microsoft Corporation.  All Rights Reserved.
4  *
5  *  File:   d3d9.h
6  *  Content:    Direct3D include file
7  *
8  ****************************************************************************/
9 module win32.directx.d3d9;
10 
11 import win32.windows;
12 public import win32.directx.d3d9types;
13 public import win32.directx.d3d9caps;
14 
15 const DIRECT3D_VERSION = 0x0900;
16 
17 /**This identifier is passed to Direct3DCreate9 in order to ensure that an
18  * application was built against the correct header files. This number is
19  * incremented whenever a header (or other) change would require applications
20  * to be rebuilt. If the version doesn't match, Direct3DCreate9 will fail.
21  * (The number itself has no meaning.)*/
22 
23 debug {
24     const D3D_SDK_VERSION = (32 | 0x80000000);
25     const D3D9b_SDK_VERSION = (31 | 0x80000000);
26 }
27 else {
28     const D3D_SDK_VERSION = 32;
29     const D3D9b_SDK_VERSION = 31;
30 }
31 
32 /* IID_IDirect3D9 */
33 /* {81BDCBCA-64D4-426d-AE8D-AD0147F4275C} */
34 extern (C) const GUID IID_IDirect3D9 = { 0x81bdcbca, 0x64d4, 0x426d, [0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c] };
35 
36 /* IID_IDirect3DDevice9 */
37 // {D0223B96-BF7A-43fd-92BD-A43B0D82B9EB} */
38 extern (C) const GUID IID_IDirect3DDevice9 = { 0xd0223b96, 0xbf7a, 0x43fd, [0x92, 0xbd, 0xa4, 0x3b, 0xd, 0x82, 0xb9, 0xeb] };
39 
40 /* IID_IDirect3DResource9 */
41 // {05EEC05D-8F7D-4362-B999-D1BAF357C704}
42 extern (C) const GUID IID_IDirect3DResource9 = { 0x05eec05d, 0x8f7d, 0x4362, [0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x04] };
43 
44 /* IID_IDirect3DBaseTexture9 */
45 /* {580CA87E-1D3C-4d54-991D-B7D3E3C298CE} */
46 extern (C) const GUID IID_IDirect3DBaseTexture9 = { 0x580ca87e, 0x1d3c, 0x4d54, [0x99, 0x1d, 0xb7, 0xd3, 0xe3, 0xc2, 0x98, 0xce] };
47 
48 /* IID_IDirect3DTexture9 */
49 /* {85C31227-3DE5-4f00-9B3A-F11AC38C18B5} */
50 extern (C) const GUID IID_IDirect3DTexture9 = { 0x85c31227, 0x3de5, 0x4f00, [0x9b, 0x3a, 0xf1, 0x1a, 0xc3, 0x8c, 0x18, 0xb5] };
51 
52 /* IID_IDirect3DCubeTexture9 */
53 /* {FFF32F81-D953-473a-9223-93D652ABA93F} */
54 extern (C) const GUID IID_IDirect3DCubeTexture9 = { 0xfff32f81, 0xd953, 0x473a, [0x92, 0x23, 0x93, 0xd6, 0x52, 0xab, 0xa9, 0x3f] };
55 
56 /* IID_IDirect3DVolumeTexture9 */
57 /* {2518526C-E789-4111-A7B9-47EF328D13E6} */
58 extern (C) const GUID IID_IDirect3DVolumeTexture9 = { 0x2518526c, 0xe789, 0x4111, [0xa7, 0xb9, 0x47, 0xef, 0x32, 0x8d, 0x13, 0xe6] };
59 
60 /* IID_IDirect3DVertexBuffer9 */
61 /* {B64BB1B5-FD70-4df6-BF91-19D0A12455E3} */
62 extern (C) const GUID IID_IDirect3DVertexBuffer9 = { 0xb64bb1b5, 0xfd70, 0x4df6, [0xbf, 0x91, 0x19, 0xd0, 0xa1, 0x24, 0x55, 0xe3] };
63 
64 /* IID_IDirect3DIndexBuffer9 */
65 /* {7C9DD65E-D3F7-4529-ACEE-785830ACDE35} */
66 extern (C) const GUID IID_IDirect3DIndexBuffer9 = { 0x7c9dd65e, 0xd3f7, 0x4529, [0xac, 0xee, 0x78, 0x58, 0x30, 0xac, 0xde, 0x35] };
67 
68 /* IID_IDirect3DSurface9 */
69 /* {0CFBAF3A-9FF6-429a-99B3-A2796AF8B89B} */
70 extern (C) const GUID IID_IDirect3DSurface9 = { 0xcfbaf3a, 0x9ff6, 0x429a, [0x99, 0xb3, 0xa2, 0x79, 0x6a, 0xf8, 0xb8, 0x9b] };
71 
72 /* IID_IDirect3DVolume9 */
73 /* {24F416E6-1F67-4aa7-B88E-D33F6F3128A1} */
74 extern (C) const GUID IID_IDirect3DVolume9 = { 0x24f416e6, 0x1f67, 0x4aa7, [0xb8, 0x8e, 0xd3, 0x3f, 0x6f, 0x31, 0x28, 0xa1] };
75 
76 /* IID_IDirect3DSwapChain9 */
77 /* {794950F2-ADFC-458a-905E-10A10B0B503B} */
78 extern (C) const GUID IID_IDirect3DSwapChain9 = { 0x794950f2, 0xadfc, 0x458a, [0x90, 0x5e, 0x10, 0xa1, 0xb, 0xb, 0x50, 0x3b] };
79 
80 /* IID_IDirect3DVertexDeclaration9 */
81 /* {DD13C59C-36FA-4098-A8FB-C7ED39DC8546} */
82 extern (C) const GUID IID_IDirect3DVertexDeclaration9 = { 0xdd13c59c, 0x36fa, 0x4098, [0xa8, 0xfb, 0xc7, 0xed, 0x39, 0xdc, 0x85, 0x46] };
83 
84 /* IID_IDirect3DVertexShader9 */
85 /* {EFC5557E-6265-4613-8A94-43857889EB36} */
86 extern (C) const GUID IID_IDirect3DVertexShader9 = { 0xefc5557e, 0x6265, 0x4613, [0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36] };
87 
88 /* IID_IDirect3DPixelShader9 */
89 /* {6D3BDBDC-5B02-4415-B852-CE5E8BCCB289} */
90 extern (C) const GUID IID_IDirect3DPixelShader9 = { 0x6d3bdbdc, 0x5b02, 0x4415, [0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89] };
91 
92 /* IID_IDirect3DStateBlock9 */
93 /* {B07C4FE5-310D-4ba8-A23C-4F0F206F218B} */
94 extern (C) const GUID IID_IDirect3DStateBlock9 = { 0xb07c4fe5, 0x310d, 0x4ba8, [0xa2, 0x3c, 0x4f, 0xf, 0x20, 0x6f, 0x21, 0x8b] };
95 
96 /* IID_IDirect3DQuery9 */
97 /* {d9771460-a695-4f26-bbd3-27b840b541cc} */
98 extern (C) const GUID IID_IDirect3DQuery9 = { 0xd9771460, 0xa695, 0x4f26, [0xbb, 0xd3, 0x27, 0xb8, 0x40, 0xb5, 0x41, 0xcc] };
99 
100 
101 /* IID_HelperName */
102 /* {E4A36723-FDFE-4b22-B146-3C04C07F4CC8} */
103 extern (C) const GUID IID_HelperName = { 0xe4a36723, 0xfdfe, 0x4b22, [0xb1, 0x46, 0x3c, 0x4, 0xc0, 0x7f, 0x4c, 0xc8] };
104 
105 /* IID_IDirect3D9Ex */
106 /* {02177241-69FC-400C-8FF1-93A44DF6861D} */
107 extern (C) const GUID IID_IDirect3D9Ex = { 0x02177241, 0x69FC, 0x400C, [0x8F, 0xF1, 0x93, 0xA4, 0x4D, 0xF6, 0x86, 0x1D] };
108 
109 /* IID_IDirect3DDevice9Ex */
110 // {B18B10CE-2649-405a-870F-95F777D4313A}
111 extern (C) const GUID IID_IDirect3DDevice9Ex = { 0xb18b10ce, 0x2649, 0x405a, [0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a] };
112 
113 /* IID_IDirect3DSwapChain9Ex */
114 /* {91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303} */
115 extern (C) const GUID IID_IDirect3DSwapChain9Ex = { 0x91886caf, 0x1c3d, 0x4d2e, [0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x03] };
116 
117 
118 
119 extern (C):
120 /**
121  * DLL Function for creating a Direct3D9 object. This object supports
122  * enumeration and allows the creation of Direct3DDevice9 objects.
123  * Pass the value of the constant D3D_SDK_VERSION to this function, so
124  * that the run-time can validate that your application was compiled
125  * against the right headers.
126  */
127 
128 extern (Windows) LPDIRECT3D9 Direct3DCreate9(UINT SDKVersion);
129 
130 /**
131  * Stubs for graphics profiling.
132  */
133 extern (Windows) int D3DPERF_BeginEvent( D3DCOLOR col, LPCWSTR wszName );
134 extern (Windows) int D3DPERF_EndEvent();
135 extern (Windows) void D3DPERF_SetMarker( D3DCOLOR col, LPCWSTR wszName );
136 extern (Windows) void D3DPERF_SetRegion( D3DCOLOR col, LPCWSTR wszName );
137 extern (Windows) BOOL D3DPERF_QueryRepeatFrame();
138 
139 extern (Windows) void D3DPERF_SetOptions( DWORD dwOptions );
140 extern (Windows) DWORD D3DPERF_GetStatus();
141 
142 
143 interface LPDIRECT3D9 : IUnknown
144 {
145     HRESULT RegisterSoftwareDevice(void* pInitializeFunction);
146     UINT GetAdapterCount();
147     HRESULT GetAdapterIdentifier( UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier);
148     UINT GetAdapterModeCount(UINT Adapter,D3DFORMAT Format);
149     HRESULT EnumAdapterModes( UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode);
150     HRESULT GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode);
151     HRESULT CheckDeviceType( UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed);
152     HRESULT CheckDeviceFormat( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat);
153     HRESULT CheckDeviceMultiSampleType( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels);
154     HRESULT CheckDepthStencilMatch( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat);
155     HRESULT CheckDeviceFormatConversion( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat);
156     HRESULT GetDeviceCaps( UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps);
157     HMONITOR GetAdapterMonitor(UINT Adapter);
158     HRESULT CreateDevice( UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,LPDIRECT3DDEVICE9* ppReturnedDeviceInterface);
159 /*
160     debug {
161         LPCWSTR Version;
162     }
163 */
164 }
165 alias LPDIRECT3D9 IDirect3D9;
166 
167 interface LPDIRECT3DDEVICE9 : IUnknown
168 {
169     HRESULT TestCooperativeLevel();
170     UINT GetAvailableTextureMem();
171     HRESULT EvictManagedResources();
172     HRESULT GetDirect3D( LPDIRECT3D9* ppD3D9);
173     HRESULT GetDeviceCaps( D3DCAPS9* pCaps);
174     HRESULT GetDisplayMode( UINT iSwapChain,D3DDISPLAYMODE* pMode);
175     HRESULT GetCreationParameters( D3DDEVICE_CREATION_PARAMETERS *pParameters);
176     HRESULT SetCursorProperties( UINT XHotSpot,UINT YHotSpot,LPDIRECT3DSURFACE9 pCursorBitmap);
177     void SetCursorPosition(int X,int Y,DWORD Flags);
178     BOOL ShowCursor(BOOL bShow);
179     HRESULT CreateAdditionalSwapChain( D3DPRESENT_PARAMETERS* pPresentationParameters,LPDIRECT3DSWAPCHAIN9* pSwapChain);
180     HRESULT GetSwapChain( UINT iSwapChain,LPDIRECT3DSWAPCHAIN9* pSwapChain);
181     UINT GetNumberOfSwapChains();
182     HRESULT Reset( D3DPRESENT_PARAMETERS* pPresentationParameters);
183     HRESULT Present(RECT* pSourceRect,RECT* pDestRect,HWND hDestWindowOverride, RGNDATA* pDirtyRegion);
184     HRESULT GetBackBuffer( UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,LPDIRECT3DSURFACE9* ppBackBuffer);
185     HRESULT GetRasterStatus( UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus);
186     HRESULT SetDialogBoxMode( BOOL bEnableDialogs);
187     void SetGammaRamp(UINT iSwapChain,DWORD Flags, D3DGAMMARAMP* pRamp);
188     void GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp);
189     HRESULT CreateTexture( UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,LPDIRECT3DTEXTURE9* ppTexture,HANDLE* pSharedHandle);
190     HRESULT CreateVolumeTexture( UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture,HANDLE* pSharedHandle);
191     HRESULT CreateCubeTexture( UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,LPDIRECT3DCUBETEXTURE9* ppCubeTexture,HANDLE* pSharedHandle);
192     HRESULT CreateVertexBuffer( UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,LPDIRECT3DVERTEXBUFFER9* ppVertexBuffer,HANDLE* pSharedHandle);
193     HRESULT CreateIndexBuffer( UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,LPDIRECT3DINDEXBUFFER9* ppIndexBuffer,HANDLE* pSharedHandle);
194     HRESULT CreateRenderTarget( UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,LPDIRECT3DSURFACE9* ppSurface,HANDLE* pSharedHandle);
195     HRESULT CreateDepthStencilSurface( UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,LPDIRECT3DSURFACE9* ppSurface,HANDLE* pSharedHandle);
196     HRESULT UpdateSurface( LPDIRECT3DSURFACE9 pSourceSurface, RECT* pSourceRect,LPDIRECT3DSURFACE9 pDestinationSurface, POINT* pDestPoint);
197     HRESULT UpdateTexture( LPDIRECT3DBASETEXTURE9 pSourceTexture,LPDIRECT3DBASETEXTURE9 pDestinationTexture);
198     HRESULT GetRenderTargetData( LPDIRECT3DSURFACE9 pRenderTarget,LPDIRECT3DSURFACE9 pDestSurface);
199     HRESULT GetFrontBufferData( UINT iSwapChain,LPDIRECT3DSURFACE9 pDestSurface);
200     HRESULT StretchRect( LPDIRECT3DSURFACE9 pSourceSurface, RECT* pSourceRect,LPDIRECT3DSURFACE9 pDestSurface, RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter);
201     HRESULT ColorFill( LPDIRECT3DSURFACE9 pSurface, RECT* pRect,D3DCOLOR color);
202     HRESULT CreateOffscreenPlainSurface( UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,LPDIRECT3DSURFACE9* ppSurface,HANDLE* pSharedHandle);
203     HRESULT SetRenderTarget( DWORD RenderTargetIndex,LPDIRECT3DSURFACE9 pRenderTarget);
204     HRESULT GetRenderTarget( DWORD RenderTargetIndex,LPDIRECT3DSURFACE9* ppRenderTarget);
205     HRESULT SetDepthStencilSurface( LPDIRECT3DSURFACE9 pNewZStencil);
206     HRESULT GetDepthStencilSurface( LPDIRECT3DSURFACE9* ppZStencilSurface);
207     HRESULT BeginScene();
208     HRESULT EndScene();
209     HRESULT Clear( DWORD Count, D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil);
210     HRESULT SetTransform( D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
211     HRESULT GetTransform( D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix);
212     HRESULT MultiplyTransform( D3DTRANSFORMSTATETYPE, D3DMATRIX*);
213     HRESULT SetViewport( D3DVIEWPORT9* pViewport);
214     HRESULT GetViewport( D3DVIEWPORT9* pViewport);
215     HRESULT SetMaterial( D3DMATERIAL9* pMaterial);
216     HRESULT GetMaterial( D3DMATERIAL9* pMaterial);
217     HRESULT SetLight( DWORD Index, D3DLIGHT9*);
218     HRESULT GetLight( DWORD Index,D3DLIGHT9*);
219     HRESULT LightEnable( DWORD Index,BOOL Enable);
220     HRESULT GetLightEnable( DWORD Index,BOOL* pEnable);
221     HRESULT SetClipPlane( DWORD Index, float* pPlane);
222     HRESULT GetClipPlane( DWORD Index,float* pPlane);
223     HRESULT SetRenderState( D3DRENDERSTATETYPE State,DWORD Value);
224     HRESULT GetRenderState( D3DRENDERSTATETYPE State,DWORD* pValue);
225     HRESULT CreateStateBlock( D3DSTATEBLOCKTYPE Type,LPDIRECT3DSTATEBLOCK9* ppSB);
226     HRESULT BeginStateBlock();
227     HRESULT EndStateBlock( LPDIRECT3DSTATEBLOCK9* ppSB);
228     HRESULT SetClipStatus( D3DCLIPSTATUS9* pClipStatus);
229     HRESULT GetClipStatus( D3DCLIPSTATUS9* pClipStatus);
230     HRESULT GetTexture( DWORD Stage,LPDIRECT3DBASETEXTURE9* ppTexture);
231     HRESULT SetTexture( DWORD Stage,LPDIRECT3DBASETEXTURE9 pTexture);
232     HRESULT GetTextureStageState( DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue);
233     HRESULT SetTextureStageState( DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value);
234     HRESULT GetSamplerState( DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue);
235     HRESULT SetSamplerState( DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value);
236     HRESULT ValidateDevice( DWORD* pNumPasses);
237     HRESULT SetPaletteEntries( UINT PaletteNumber, PALETTEENTRY* pEntries);
238     HRESULT GetPaletteEntries( UINT PaletteNumber,PALETTEENTRY* pEntries);
239     HRESULT SetCurrentTexturePalette( UINT PaletteNumber);
240     HRESULT GetCurrentTexturePalette( UINT *PaletteNumber);
241     HRESULT SetScissorRect( RECT* pRect);
242     HRESULT GetScissorRect( RECT* pRect);
243     HRESULT SetSoftwareVertexProcessing( BOOL bSoftware);
244     BOOL GetSoftwareVertexProcessing();
245     HRESULT SetNPatchMode( float nSegments);
246     float GetNPatchMode();
247     HRESULT DrawPrimitive( D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount);
248     HRESULT DrawIndexedPrimitive( D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
249     HRESULT DrawPrimitiveUP( D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount, void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
250     HRESULT DrawIndexedPrimitiveUP( D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount, void* pIndexData,D3DFORMAT IndexDataFormat, void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
251     HRESULT ProcessVertices( UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,LPDIRECT3DVERTEXBUFFER9 pDestBuffer,LPDIRECT3DVERTEXDECLARATION9 pVertexDecl,DWORD Flags);
252     HRESULT CreateVertexDeclaration( D3DVERTEXELEMENT9* pVertexElements,LPDIRECT3DVERTEXDECLARATION9* ppDecl);
253     HRESULT SetVertexDeclaration(LPDIRECT3DVERTEXDECLARATION9 pDecl);
254     HRESULT GetVertexDeclaration(LPDIRECT3DVERTEXDECLARATION9* ppDecl);
255     HRESULT SetFVF( DWORD FVF);
256     HRESULT GetFVF( DWORD* pFVF);
257     HRESULT CreateVertexShader( DWORD* pFunction,LPDIRECT3DVERTEXSHADER9* ppShader);
258     HRESULT SetVertexShader( LPDIRECT3DVERTEXSHADER9 pShader);
259     HRESULT GetVertexShader( LPDIRECT3DVERTEXSHADER9* ppShader);
260     HRESULT SetVertexShaderConstantF( UINT StartRegister, float* pConstantData,UINT Vector4fCount);
261     HRESULT GetVertexShaderConstantF( UINT StartRegister,float* pConstantData,UINT Vector4fCount);
262     HRESULT SetVertexShaderConstantI( UINT StartRegister, int* pConstantData,UINT Vector4iCount);
263     HRESULT GetVertexShaderConstantI( UINT StartRegister,int* pConstantData,UINT Vector4iCount);
264     HRESULT SetVertexShaderConstantB( UINT StartRegister, BOOL* pConstantData,UINT  BoolCount);
265     HRESULT GetVertexShaderConstantB( UINT StartRegister,BOOL* pConstantData,UINT BoolCount);
266     HRESULT SetStreamSource( UINT StreamNumber,LPDIRECT3DVERTEXBUFFER9 pStreamData,UINT OffsetInBytes,UINT Stride);
267     HRESULT GetStreamSource( UINT StreamNumber,LPDIRECT3DVERTEXBUFFER9* ppStreamData,UINT* pOffsetInBytes,UINT* pStride);
268     HRESULT SetStreamSourceFreq( UINT StreamNumber,UINT Setting);
269     HRESULT GetStreamSourceFreq( UINT StreamNumber,UINT* pSetting);
270     HRESULT SetIndices( LPDIRECT3DINDEXBUFFER9 pIndexData);
271     HRESULT GetIndices( LPDIRECT3DINDEXBUFFER9* ppIndexData);
272     HRESULT CreatePixelShader( DWORD* pFunction,LPDIRECT3DPIXELSHADER9* ppShader);
273     HRESULT SetPixelShader(LPDIRECT3DPIXELSHADER9 pShader);
274     HRESULT GetPixelShader(LPDIRECT3DPIXELSHADER9* ppShader);
275     HRESULT SetPixelShaderConstantF( UINT StartRegister, float* pConstantData,UINT Vector4fCount);
276     HRESULT GetPixelShaderConstantF( UINT StartRegister,float* pConstantData,UINT Vector4fCount);
277     HRESULT SetPixelShaderConstantI( UINT StartRegister, int* pConstantData,UINT Vector4iCount);
278     HRESULT GetPixelShaderConstantI( UINT StartRegister,int* pConstantData,UINT Vector4iCount);
279     HRESULT SetPixelShaderConstantB( UINT StartRegister, BOOL* pConstantData,UINT  BoolCount);
280     HRESULT GetPixelShaderConstantB( UINT StartRegister,BOOL* pConstantData,UINT BoolCount);
281     HRESULT DrawRectPatch( UINT Handle, float* pNumSegs, D3DRECTPATCH_INFO* pRectPatchInfo);
282     HRESULT DrawTriPatch( UINT Handle, float* pNumSegs, D3DTRIPATCH_INFO* pTriPatchInfo);
283     HRESULT DeletePatch( UINT Handle);
284     HRESULT CreateQuery( D3DQUERYTYPE Type,LPDIRECT3DQUERY9* ppQuery);
285 /*
286     debug {
287         D3DDEVICE_CREATION_PARAMETERS CreationParameters;
288         D3DPRESENT_PARAMETERS PresentParameters;
289         D3DDISPLAYMODE DisplayMode;
290         D3DCAPS9 Caps;
291 
292         UINT AvailableTextureMem;
293         UINT SwapChains;
294         UINT Textures;
295         UINT VertexBuffers;
296         UINT IndexBuffers;
297         UINT VertexShaders;
298         UINT PixelShaders;
299 
300         D3DVIEWPORT9 Viewport;
301         D3DMATRIX ProjectionMatrix;
302         D3DMATRIX ViewMatrix;
303         D3DMATRIX WorldMatrix;
304         D3DMATRIX TextureMatrices[8];
305 
306         DWORD FVF;
307         UINT VertexSize;
308         DWORD VertexShaderVersion;
309         DWORD PixelShaderVersion;
310         BOOL SoftwareVertexProcessing;
311 
312         D3DMATERIAL9 Material;
313         D3DLIGHT9 Lights[16];
314         BOOL LightsEnabled[16];
315 
316         D3DGAMMARAMP GammaRamp;
317         RECT ScissorRect;
318         BOOL DialogBoxMode;
319     }
320 */
321 }
322 
323 alias LPDIRECT3DDEVICE9 IDirect3DDevice9;
324 
325 
326 interface LPDIRECT3DSTATEBLOCK9 : IUnknown
327 {
328     HRESULT GetDevice(LPDIRECT3DDEVICE9* ppDevice);
329     HRESULT Capture();
330     HRESULT Apply();
331 /*
332     debug {
333         LPCWSTR CreationCallStack;
334     }
335 */
336 }
337 
338 alias LPDIRECT3DSTATEBLOCK9 IDirect3DStateBlock9;
339 
340 interface LPDIRECT3DSWAPCHAIN9 : IUnknown
341 {
342     HRESULT Present( RECT* pSourceRect, RECT* pDestRect,HWND hDestWindowOverride, RGNDATA* pDirtyRegion,DWORD dwFlags);
343     HRESULT GetFrontBufferData( LPDIRECT3DSURFACE9 pDestSurface);
344     HRESULT GetBackBuffer( UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,LPDIRECT3DSURFACE9* ppBackBuffer);
345     HRESULT GetRasterStatus( D3DRASTER_STATUS* pRasterStatus);
346     HRESULT GetDisplayMode( D3DDISPLAYMODE* pMode);
347     HRESULT GetDevice( LPDIRECT3DDEVICE9 * ppDevice);
348     HRESULT GetPresentParameters( D3DPRESENT_PARAMETERS* pPresentationParameters);
349 /*
350     debug {
351         D3DPRESENT_PARAMETERS PresentParameters;
352         D3DDISPLAYMODE DisplayMode;
353         LPCWSTR CreationCallStack;
354     }
355 */
356 }
357 
358 alias LPDIRECT3DSWAPCHAIN9 IDirect3DSwapChain9;
359 
360 interface LPDIRECT3DRESOURCE9 : IUnknown
361 {
362     HRESULT GetDevice( LPDIRECT3DDEVICE9* ppDevice);
363     HRESULT SetPrivateData( REFGUID refguid, void* pData,DWORD SizeOfData,DWORD Flags);
364     HRESULT GetPrivateData( REFGUID refguid,void* pData,DWORD* pSizeOfData);
365     HRESULT FreePrivateData( REFGUID refguid);
366     DWORD SetPriority(DWORD PriorityNew);
367     DWORD GetPriority();
368     void PreLoad();
369     D3DRESOURCETYPE GetType();
370 }
371 
372 alias LPDIRECT3DRESOURCE9 IDirect3DResource9;
373 
374 interface LPDIRECT3DVERTEXDECLARATION9 : IUnknown
375 {
376     HRESULT GetDevice( LPDIRECT3DDEVICE9* ppDevice);
377     HRESULT GetDeclaration( D3DVERTEXELEMENT9* pElement,UINT* pNumElements);
378 /*
379     debug {
380         LPCWSTR CreationCallStack;
381     }
382 */
383 }
384 
385 alias LPDIRECT3DVERTEXDECLARATION9 IDirect3DVertexDeclaration9;
386 
387 interface LPDIRECT3DVERTEXSHADER9 : IUnknown
388 {
389     HRESULT GetDevice( LPDIRECT3DDEVICE9 * ppDevice);
390     HRESULT GetFunction( void*,UINT* pSizeOfData);
391 /*
392     debug {
393         DWORD Version;
394         LPCWSTR CreationCallStack;
395     }
396 */
397 }
398 
399 alias LPDIRECT3DVERTEXSHADER9 IDirect3DVertexShader9;
400 
401 interface LPDIRECT3DPIXELSHADER9 : IUnknown
402 {
403     HRESULT GetDevice( LPDIRECT3DDEVICE9 * ppDevice);
404     HRESULT GetFunction( void*,UINT* pSizeOfData);
405 /*
406     debug {
407         DWORD Version;
408         LPCWSTR CreationCallStack;
409     }
410 */
411 }
412 
413 alias LPDIRECT3DPIXELSHADER9 IDirect3DPixelShader9;
414 
415 interface LPDIRECT3DBASETEXTURE9 : LPDIRECT3DRESOURCE9
416 {
417     DWORD SetLOD(DWORD LODNew);
418     DWORD GetLOD();
419     DWORD GetLevelCount();
420     HRESULT SetAutoGenFilterType( D3DTEXTUREFILTERTYPE FilterType);
421     D3DTEXTUREFILTERTYPE GetAutoGenFilterType();
422     void GenerateMipSubLevels();
423 }
424 
425 alias LPDIRECT3DBASETEXTURE9 IDirect3DBaseTexture9;
426 
427 interface LPDIRECT3DTEXTURE9 : LPDIRECT3DBASETEXTURE9
428 {
429     HRESULT GetLevelDesc( UINT Level,D3DSURFACE_DESC *pDesc);
430     HRESULT GetSurfaceLevel( UINT Level,LPDIRECT3DSURFACE9* ppSurfaceLevel);
431     HRESULT LockRect( UINT Level,D3DLOCKED_RECT* pLockedRect,RECT* pRect,DWORD Flags);
432     HRESULT UnlockRect( UINT Level);
433     HRESULT AddDirtyRect(RECT* pDirtyRect);
434 /*
435     debug {
436         LPCWSTR Name;
437         UINT Width;
438         UINT Height;
439         UINT Levels;
440         DWORD Usage;
441         D3DFORMAT Format;
442         D3DPOOL Pool;
443         DWORD Priority;
444         DWORD LOD;
445         D3DTEXTUREFILTERTYPE FilterType;
446         UINT LockCount;
447         LPCWSTR CreationCallStack;
448     }
449 */
450 }
451 
452 alias LPDIRECT3DTEXTURE9 IDirect3DTexture9;
453 
454 interface LPDIRECT3DVOLUMETEXTURE9 : LPDIRECT3DBASETEXTURE9
455 {
456     HRESULT GetLevelDesc( UINT Level,D3DVOLUME_DESC *pDesc);
457     HRESULT GetVolumeLevel( UINT Level,LPDIRECT3DVOLUME9* ppVolumeLevel);
458     HRESULT LockBox( UINT Level,D3DLOCKED_BOX* pLockedVolume, D3DBOX* pBox,DWORD Flags);
459     HRESULT UnlockBox( UINT Level);
460     HRESULT AddDirtyBox( D3DBOX* pDirtyBox);
461 /*
462     debug {
463         LPCWSTR Name;
464         UINT Width;
465         UINT Height;
466         UINT Depth;
467         UINT Levels;
468         DWORD Usage;
469         D3DFORMAT Format;
470         D3DPOOL Pool;
471         DWORD Priority;
472         DWORD LOD;
473         D3DTEXTUREFILTERTYPE FilterType;
474         UINT LockCount;
475         LPCWSTR CreationCallStack;
476     }
477 */
478 }
479 
480 alias LPDIRECT3DVOLUMETEXTURE9 IDirect3DVolumeTexture9;
481 
482 interface LPDIRECT3DCUBETEXTURE9 : LPDIRECT3DBASETEXTURE9
483 {
484     HRESULT GetLevelDesc( UINT Level,D3DSURFACE_DESC *pDesc);
485     HRESULT GetCubeMapSurface( D3DCUBEMAP_FACES FaceType,UINT Level,LPDIRECT3DSURFACE9* ppCubeMapSurface);
486     HRESULT LockRect( D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect, RECT* pRect,DWORD Flags);
487     HRESULT UnlockRect( D3DCUBEMAP_FACES FaceType,UINT Level);
488     HRESULT AddDirtyRect( D3DCUBEMAP_FACES FaceType, RECT* pDirtyRect);
489 /*
490     debug {
491         LPCWSTR Name;
492         UINT Width;
493         UINT Height;
494         UINT Levels;
495         DWORD Usage;
496         D3DFORMAT Format;
497         D3DPOOL Pool;
498         DWORD Priority;
499         DWORD LOD;
500         D3DTEXTUREFILTERTYPE FilterType;
501         UINT LockCount;
502         LPCWSTR CreationCallStack;
503     }
504 */
505 }
506 
507 alias LPDIRECT3DCUBETEXTURE9 IDirect3DCubeTexture9;
508 
509 interface LPDIRECT3DVERTEXBUFFER9 : LPDIRECT3DRESOURCE9
510 {
511     HRESULT Lock( UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags);
512     HRESULT Unlock();
513     HRESULT GetDesc( D3DVERTEXBUFFER_DESC *pDesc);
514 /*
515     debug {
516         LPCWSTR Name;
517         UINT Length;
518         DWORD Usage;
519         DWORD FVF;
520         D3DPOOL Pool;
521         DWORD Priority;
522         UINT LockCount;
523         LPCWSTR CreationCallStack;
524     }
525 */
526 }
527 
528 alias LPDIRECT3DVERTEXBUFFER9 IDirect3DVertexBuffer9;
529 
530 interface LPDIRECT3DINDEXBUFFER9 : LPDIRECT3DRESOURCE9
531 {
532     HRESULT Lock( UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags);
533     HRESULT Unlock();
534     HRESULT GetDesc( D3DINDEXBUFFER_DESC *pDesc);
535 /*
536     debug {
537         LPCWSTR Name;
538         UINT Length;
539         DWORD Usage;
540         D3DFORMAT Format;
541         D3DPOOL Pool;
542         DWORD Priority;
543         UINT LockCount;
544         LPCWSTR CreationCallStack;
545     }
546 */
547 }
548 
549 alias LPDIRECT3DINDEXBUFFER9 IDirect3DIndexBuffer9;
550 
551 interface LPDIRECT3DSURFACE9 : LPDIRECT3DRESOURCE9
552 {
553     HRESULT GetContainer( REFIID riid,void** ppContainer);
554     HRESULT GetDesc( D3DSURFACE_DESC *pDesc);
555     HRESULT LockRect( D3DLOCKED_RECT* pLockedRect, RECT* pRect,DWORD Flags);
556     HRESULT UnlockRect();
557     HRESULT GetDC( HDC *phdc);
558     HRESULT ReleaseDC( HDC hdc);
559 /*
560     debug {
561         LPCWSTR Name;
562         UINT Width;
563         UINT Height;
564         DWORD Usage;
565         D3DFORMAT Format;
566         D3DPOOL Pool;
567         D3DMULTISAMPLE_TYPE MultiSampleType;
568         DWORD MultiSampleQuality;
569         DWORD Priority;
570         UINT LockCount;
571         UINT DCCount;
572         LPCWSTR CreationCallStack;
573     }
574 */
575 }
576 
577 alias LPDIRECT3DSURFACE9 IDirect3DSurface9;
578 
579 interface LPDIRECT3DVOLUME9 : IUnknown
580 {
581     HRESULT GetDevice( LPDIRECT3DDEVICE9 * ppDevice);
582     HRESULT SetPrivateData( REFGUID refguid, void* pData,DWORD SizeOfData,DWORD Flags);
583     HRESULT GetPrivateData( REFGUID refguid,void* pData,DWORD* pSizeOfData);
584     HRESULT FreePrivateData( REFGUID refguid);
585     HRESULT GetContainer( REFIID riid,void** ppContainer);
586     HRESULT GetDesc( D3DVOLUME_DESC *pDesc);
587     HRESULT LockBox( D3DLOCKED_BOX * pLockedVolume, D3DBOX* pBox,DWORD Flags);
588     HRESULT UnlockBox();
589 /*
590     debug {
591         LPCWSTR Name;
592         UINT Width;
593         UINT Height;
594         UINT Depth;
595         DWORD Usage;
596         D3DFORMAT Format;
597         D3DPOOL Pool;
598         UINT LockCount;
599         LPCWSTR CreationCallStack;
600     }
601 */
602 }
603 
604 alias LPDIRECT3DVOLUME9 IDirect3DVolume9;
605 
606 interface LPDIRECT3DQUERY9 : IUnknown
607 {
608     HRESULT GetDevice( LPDIRECT3DDEVICE9* ppDevice);
609     D3DQUERYTYPE GetType();
610     DWORD GetDataSize();
611     HRESULT Issue( DWORD dwIssueFlags);
612     HRESULT GetData( void* pData,DWORD dwSize,DWORD dwGetDataFlags);
613 /*
614     debug {
615         D3DQUERYTYPE Type;
616         DWORD DataSize;
617         LPCWSTR CreationCallStack;
618     }
619 */
620 }
621 
622 alias LPDIRECT3DQUERY9 IDirect3DQuery9;
623 
624 /****************************************************************************
625  * Flags for SetPrivateData method on all D3D9 interfaces
626  *
627  * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData
628  * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this
629  * pointer and Release when the private data is destroyed. The data will be
630  * destroyed when another SetPrivateData with the same GUID is set, when
631  * FreePrivateData is called, or when the D3D9 object is freed.
632  ****************************************************************************/
633 const D3DSPD_IUNKNOWN = 0x00000001L;
634 
635 /****************************************************************************
636  *
637  * Flags for IDirect3D9::CreateDevice's BehaviorFlags
638  *
639  ****************************************************************************/
640 
641 const D3DCREATE_FPU_PRESERVE = 0x00000002L;
642 const D3DCREATE_MULTITHREADED = 0x00000004L;
643 
644 const D3DCREATE_PUREDEVICE = 0x00000010L;
645 const D3DCREATE_SOFTWARE_VERTEXPROCESSING = 0x00000020L;
646 const D3DCREATE_HARDWARE_VERTEXPROCESSING = 0x00000040L;
647 const D3DCREATE_MIXED_VERTEXPROCESSING = 0x00000080L;
648 
649 const D3DCREATE_DISABLE_DRIVER_MANAGEMENT = 0x00000100L;
650 const D3DCREATE_ADAPTERGROUP_DEVICE = 0x00000200L;
651 const D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX = 0x00000400L;
652 
653 // This flag causes the D3D runtime not to alter the focus
654 // window in any way. Use with caution- the burden of supporting
655 // focus management events (alt-tab, etc.) falls on the
656 // application, and appropriate responses (switching display
657 // mode, etc.) should be coded.
658 const D3DCREATE_NOWINDOWCHANGES = 0x00000800L;
659 
660 // Disable multithreading for software vertex processing
661 const D3DCREATE_DISABLE_PSGP_THREADING = 0x00002000L;
662 // This flag enables present statistics on device.
663 const D3DCREATE_ENABLE_PRESENTSTATS = 0x00004000L;
664 // This flag disables printscreen support in the runtime for this device
665 const D3DCREATE_DISABLE_PRINTSCREEN = 0x00008000L;
666 
667 const D3DCREATE_SCREENSAVER = 0x10000000L;
668 
669 
670 /****************************************************************************
671  *
672  * Parameter for IDirect3D9::CreateDevice's Adapter argument
673  *
674  ****************************************************************************/
675 
676 const D3DADAPTER_DEFAULT = 0;
677 
678 /****************************************************************************
679  *
680  * Flags for IDirect3D9::EnumAdapters
681  *
682  ****************************************************************************/
683 
684 /*
685  * The D3DENUM_WHQL_LEVEL value has been retired for 9Ex and future versions,
686  * but it needs to be defined here for compatibility with DX9 and earlier versions.
687  * See the DirectX SDK for sample code on discovering driver signatures.
688  */
689 const D3DENUM_WHQL_LEVEL = 0x00000002L;
690 
691 /* NO_DRIVERVERSION will not fill out the DriverVersion field, nor will the
692    DriverVersion be incorporated into the DeviceIdentifier GUID. WINNT only */
693 const D3DENUM_NO_DRIVERVERSION = 0x00000004L;
694 
695 
696 /****************************************************************************
697  *
698  * Maximum number of back-buffers supported in DX9
699  *
700  ****************************************************************************/
701 
702 const D3DPRESENT_BACK_BUFFERS_MAX = 3L;
703 
704 /****************************************************************************
705  *
706  * Maximum number of back-buffers supported when apps use CreateDeviceEx
707  *
708  ****************************************************************************/
709 const D3DPRESENT_BACK_BUFFERS_MAX_EX = 30L;
710 
711 /****************************************************************************
712  *
713  * Flags for IDirect3DDevice9::SetGammaRamp
714  *
715  ****************************************************************************/
716 
717 const D3DSGR_NO_CALIBRATION = 0x00000000L;
718 const D3DSGR_CALIBRATE = 0x00000001L;
719 
720 /****************************************************************************
721  *
722  * Flags for IDirect3DDevice9::SetCursorPosition
723  *
724  ****************************************************************************/
725 
726 const D3DCURSOR_IMMEDIATE_UPDATE = 0x00000001L;
727 
728 /****************************************************************************
729  *
730  * Flags for IDirect3DSwapChain9::Present
731  *
732  ****************************************************************************/
733 
734 const D3DPRESENT_DONOTWAIT = 0x00000001L;
735 const D3DPRESENT_LINEAR_CONTENT = 0x00000002L;
736 const D3DPRESENT_DONOTFLIP = 0x00000004L;
737 const D3DPRESENT_FLIPRESTART = 0x00000008L;
738 const D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR = 0x00000010L;
739 
740 /****************************************************************************
741  *
742  * Flags for DrawPrimitive/DrawIndexedPrimitive
743  *   Also valid for Begin/BeginIndexed
744  *   Also valid for VertexBuffer::CreateVertexBuffer
745  ****************************************************************************/
746 
747 
748 /*
749  *  DirectDraw error codes
750  */
751 const _FACD3D = 0x876;
752 HRESULT MAKE_D3DHRESULT(T)(T code) { return MAKE_HRESULT( 1, _FACD3D, code ); }
753 HRESULT MAKE_D3DSTATUS(T)(T code) { return MAKE_HRESULT( 0, _FACD3D, code ); }
754 
755 /*
756  * Direct3D Errors
757  */
758 const HRESULT D3D_OK = S_OK;
759 
760 const HRESULT D3DERR_WRONGTEXTUREFORMAT = MAKE_D3DHRESULT(2072);
761 const HRESULT D3DERR_UNSUPPORTEDCOLOROPERATION = MAKE_D3DHRESULT(2073);
762 const HRESULT D3DERR_UNSUPPORTEDCOLORARG = MAKE_D3DHRESULT(2074);
763 const HRESULT D3DERR_UNSUPPORTEDALPHAOPERATION = MAKE_D3DHRESULT(2075);
764 const HRESULT D3DERR_UNSUPPORTEDALPHAARG = MAKE_D3DHRESULT(2076);
765 const HRESULT D3DERR_TOOMANYOPERATIONS = MAKE_D3DHRESULT(2077);
766 const HRESULT D3DERR_CONFLICTINGTEXTUREFILTER = MAKE_D3DHRESULT(2078);
767 const HRESULT D3DERR_UNSUPPORTEDFACTORVALUE = MAKE_D3DHRESULT(2079);
768 const HRESULT D3DERR_CONFLICTINGRENDERSTATE = MAKE_D3DHRESULT(2081);
769 const HRESULT D3DERR_UNSUPPORTEDTEXTUREFILTER = MAKE_D3DHRESULT(2082);
770 const HRESULT D3DERR_CONFLICTINGTEXTUREPALETTE = MAKE_D3DHRESULT(2086);
771 const HRESULT D3DERR_DRIVERINTERNALERROR = MAKE_D3DHRESULT(2087);
772 
773 const HRESULT D3DERR_NOTFOUND = MAKE_D3DHRESULT(2150);
774 const HRESULT D3DERR_MOREDATA = MAKE_D3DHRESULT(2151);
775 const HRESULT D3DERR_DEVICELOST = MAKE_D3DHRESULT(2152);
776 const HRESULT D3DERR_DEVICENOTRESET = MAKE_D3DHRESULT(2153);
777 const HRESULT D3DERR_NOTAVAILABLE = MAKE_D3DHRESULT(2154);
778 const HRESULT D3DERR_OUTOFVIDEOMEMORY = MAKE_D3DHRESULT(380);
779 const HRESULT D3DERR_INVALIDDEVICE = MAKE_D3DHRESULT(2155);
780 const HRESULT D3DERR_INVALIDCALL = MAKE_D3DHRESULT(2156);
781 const HRESULT D3DERR_DRIVERINVALIDCALL = MAKE_D3DHRESULT(2157);
782 const HRESULT D3DERR_WASSTILLDRAWING = MAKE_D3DHRESULT(540);
783 const HRESULT D3DOK_NOAUTOGEN = MAKE_D3DSTATUS(2159);
784 const HRESULT D3DERR_DEVICEREMOVED = MAKE_D3DHRESULT(2160);
785 const HRESULT S_NOT_RESIDENT = MAKE_D3DSTATUS(2165);
786 const HRESULT S_RESIDENT_IN_SHARED_MEMORY = MAKE_D3DSTATUS(2166);
787 const HRESULT S_PRESENT_MODE_CHANGED = MAKE_D3DSTATUS(2167);
788 const HRESULT S_PRESENT_OCCLUDED = MAKE_D3DSTATUS(2168);
789 const HRESULT D3DERR_DEVICEHUNG = MAKE_D3DHRESULT(2164);
790 
791 
792 /*********************
793 /* D3D9Ex interfaces
794 /*********************/
795 
796 extern (Windows) HRESULT Direct3DCreate9Ex(UINT SDKVersion, LPDIRECT3D9EX*);
797 
798 interface LPDIRECT3D9EX : LPDIRECT3D9
799 {
800     UINT GetAdapterModeCountEx(UINT Adapter, D3DDISPLAYMODEFILTER* pFilter );
801     HRESULT EnumAdapterModesEx( UINT Adapter, D3DDISPLAYMODEFILTER* pFilter,UINT Mode,D3DDISPLAYMODEEX* pMode);
802     HRESULT GetAdapterDisplayModeEx( UINT Adapter,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation);
803     HRESULT CreateDeviceEx( UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX* pFullscreenDisplayMode,LPDIRECT3DDEVICE9EX* ppReturnedDeviceInterface);
804     HRESULT GetAdapterLUID( UINT Adapter,LUID * pLUID);
805 }
806 
807 alias LPDIRECT3D9EX IDirect3D9Ex;
808 
809 interface LPDIRECT3DDEVICE9EX : LPDIRECT3DDEVICE9
810 {
811     HRESULT SetConvolutionMonoKernel( UINT width,UINT height,float* rows,float* columns);
812     HRESULT ComposeRects( LPDIRECT3DSURFACE9 pSrc,LPDIRECT3DSURFACE9 pDst,LPDIRECT3DVERTEXBUFFER9 pSrcRectDescs,UINT NumRects,LPDIRECT3DVERTEXBUFFER9 pDstRectDescs,D3DCOMPOSERECTSOP Operation,int Xoffset,int Yoffset);
813     HRESULT PresentEx( RECT* pSourceRect, RECT* pDestRect,HWND hDestWindowOverride, RGNDATA* pDirtyRegion,DWORD dwFlags);
814     HRESULT GetGPUThreadPriority( INT* pPriority);
815     HRESULT SetGPUThreadPriority( INT Priority);
816     HRESULT WaitForVBlank( UINT iSwapChain);
817     HRESULT CheckResourceResidency( LPDIRECT3DRESOURCE9* pResourceArray,UINT32 NumResources);
818     HRESULT SetMaximumFrameLatency( UINT MaxLatency);
819     HRESULT GetMaximumFrameLatency( UINT* pMaxLatency);
820     HRESULT CheckDeviceState( HWND hDestinationWindow);
821     HRESULT CreateRenderTargetEx( UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,LPDIRECT3DSURFACE9* ppSurface,HANDLE* pSharedHandle,DWORD Usage);
822     HRESULT CreateOffscreenPlainSurfaceEx( UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,LPDIRECT3DSURFACE9* ppSurface,HANDLE* pSharedHandle,DWORD Usage);
823     HRESULT CreateDepthStencilSurfaceEx( UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,LPDIRECT3DSURFACE9* ppSurface,HANDLE* pSharedHandle,DWORD Usage);
824     HRESULT ResetEx( D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX *pFullscreenDisplayMode);
825     HRESULT GetDisplayModeEx( UINT iSwapChain,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation);
826 }
827 
828 alias LPDIRECT3DDEVICE9EX IDirect3DDevice9Ex;
829 
830 interface LPDIRECT3DSWAPCHAIN9EX : LPDIRECT3DSWAPCHAIN9
831 {
832     HRESULT GetLastPresentCount( UINT* pLastPresentCount);
833     HRESULT GetPresentStats( D3DPRESENTSTATS* pPresentationStatistics);
834     HRESULT GetDisplayModeEx( D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation);
835 }
836 
837 alias LPDIRECT3DSWAPCHAIN9EX IDirect3DSwapChain9Ex;