Add Clear, Present and EndScene support and fix a bug in the drawing
[wine] / dlls / d3d9 / device.c
1 /*
2  * IDirect3DDevice9 implementation
3  *
4  * Copyright 2002-2003 Jason Edmeades
5  *                     Raphael Junqueira
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #include "config.h"
23 #include "d3d9_private.h"
24
25 /** currently desactiving 1_4 support as mesa doesn't implement all 1_4 support while defining it */
26 #undef GL_VERSION_1_4
27
28 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
29 WINE_DECLARE_DEBUG_CHANNEL(d3d_shader);
30
31
32 /* IDirect3D IUnknown parts follow: */
33 HRESULT WINAPI IDirect3DDevice9Impl_QueryInterface(LPDIRECT3DDEVICE9 iface, REFIID riid, LPVOID* ppobj) {
34     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
35
36     if (IsEqualGUID(riid, &IID_IUnknown)
37         || IsEqualGUID(riid, &IID_IDirect3DDevice9)) {
38         IDirect3DDevice9Impl_AddRef(iface);
39         *ppobj = This;
40         return D3D_OK;
41     }
42
43     WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
44     return E_NOINTERFACE;
45 }
46
47 ULONG WINAPI IDirect3DDevice9Impl_AddRef(LPDIRECT3DDEVICE9 iface) {
48     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
49     TRACE("(%p) : AddRef from %ld\n", This, This->ref);
50     return ++(This->ref);
51 }
52
53 ULONG WINAPI IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9 iface) {
54     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
55     ULONG ref = --This->ref;
56     TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
57     if (ref == 0) {
58       IDirect3D9_Release((LPDIRECT3D9) This->direct3d);
59       IWineD3DDevice_Release(This->WineD3DDevice);
60       HeapFree(GetProcessHeap(), 0, This);
61     }
62     return ref;
63 }
64
65 /* IDirect3DDevice Interface follow: */
66 HRESULT  WINAPI  IDirect3DDevice9Impl_TestCooperativeLevel(LPDIRECT3DDEVICE9 iface) {
67     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
68     TRACE("(%p) : stub\n", This);    /* No way of notifying yet! */
69     return D3D_OK;
70 }
71
72 UINT     WINAPI  IDirect3DDevice9Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface) {
73     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
74     TRACE("(%p) : stub, emulating 32Mb for now\n", This);
75     /*
76      * pretend we have 32MB of any type of memory queried.
77      */
78     return (1024*1024*32);
79 }
80
81 HRESULT  WINAPI  IDirect3DDevice9Impl_EvictManagedRessources(LPDIRECT3DDEVICE9 iface) {
82     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
83     FIXME("(%p) : stub\n", This);    
84     return D3D_OK;
85 }
86
87 HRESULT  WINAPI  IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDirect3D9** ppD3D9) {
88     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
89     TRACE("(%p) : returning %p\n", This, This->direct3d);
90     /* Inc ref count */
91     *ppD3D9 = (IDirect3D9*) This->direct3d;
92     IDirect3D9_AddRef(*ppD3D9);
93     return D3D_OK;
94 }
95
96 HRESULT  WINAPI  IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9* pCaps) {
97     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
98     FIXME("(%p) : stub, calling idirect3d for now\n", This);
99     IDirect3D9Impl_GetDeviceCaps((LPDIRECT3D9) This->direct3d, This->adapterNo, This->devType, pCaps);
100     return D3D_OK;
101 }
102
103 HRESULT  WINAPI  IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode) {
104     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
105     FIXME("(%p) : stub\n", This);
106     return D3D_OK;
107 }
108
109 HRESULT  WINAPI  IDirect3DDevice9Impl_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS *pParameters) {
110     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
111     TRACE("(%p) copying to %p\n", This, pParameters);    
112     memcpy(pParameters, &This->CreateParms, sizeof(D3DDEVICE_CREATION_PARAMETERS));
113     return D3D_OK;
114 }
115
116 HRESULT  WINAPI  IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) {
117     IDirect3DSurface9Impl* pSur = (IDirect3DSurface9Impl*) pCursorBitmap;
118     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
119     TRACE("(%p) : Spot Pos(%u,%u)\n", This, XHotSpot, YHotSpot);
120
121     if (D3DFMT_A8R8G8B8 != pSur->myDesc.Format) {
122       ERR("(%p) : surface(%p) have a invalid format\n", This, pCursorBitmap);
123       return D3DERR_INVALIDCALL;
124     }
125     if (32 != pSur->myDesc.Height || 32 != pSur->myDesc.Width) {
126       ERR("(%p) : surface(%p) have a invalid size\n", This, pCursorBitmap);
127       return D3DERR_INVALIDCALL;
128     }
129
130     This->xHotSpot = XHotSpot;
131     This->yHotSpot = YHotSpot;
132     return D3D_OK;
133 }
134
135 void     WINAPI  IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int XScreenSpace, int YScreenSpace, DWORD Flags) {
136     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
137     TRACE("(%p) : SetPos to (%u,%u)\n", This, XScreenSpace, YScreenSpace);
138     This->xScreenSpace = XScreenSpace;
139     This->yScreenSpace = YScreenSpace;
140     return;
141 }
142
143 BOOL     WINAPI  IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow) {
144     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
145     TRACE("(%p) : visible(%d)\n", This, bShow); 
146     This->bCursorVisible = bShow;
147     return D3D_OK;
148 }
149
150 HRESULT  WINAPI  IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
151     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
152     FIXME("(%p) : stub\n", This);
153     return D3D_OK;
154 }
155
156 HRESULT  WINAPI  IDirect3DDevice9Impl_Present(LPDIRECT3DDEVICE9 iface, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) {
157     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
158     return IWineD3DDevice_Present(This->WineD3DDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
159 }
160
161 HRESULT  WINAPI  IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
162     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
163     *ppBackBuffer = (LPDIRECT3DSURFACE9) This->backBuffer;
164     TRACE("(%p) : BackBuf %d Type %d returning %p\n", This, BackBuffer, Type, *ppBackBuffer);
165     if (BackBuffer > This->PresentParms.BackBufferCount - 1) {
166         FIXME("Only one backBuffer currently supported\n");
167         return D3DERR_INVALIDCALL;
168     }
169     /* Note inc ref on returned surface */
170     IDirect3DSurface9Impl_AddRef((LPDIRECT3DSURFACE9) *ppBackBuffer);
171     return D3D_OK;
172 }
173
174 HRESULT  WINAPI  IDirect3DDevice9Impl_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) {
175     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
176     FIXME("(%p) : stub\n", This);    
177     return D3D_OK;
178 }
179
180 HRESULT WINAPI IDirect3DDevice9Impl_SetDialogBoxMode(LPDIRECT3DDEVICE9 iface, BOOL bEnableDialogs) {
181     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
182     FIXME("(%p) : stub\n", This);    
183     return D3D_OK;
184 }
185
186 void WINAPI IDirect3DDevice9Impl_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) {
187     HDC hDC;
188     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
189
190     FIXME("(%p) : pRamp@%p\n", This, pRamp);
191     hDC = GetDC(This->win_handle);
192     SetDeviceGammaRamp(hDC, (LPVOID) pRamp);
193     ReleaseDC(This->win_handle, hDC);
194     return;
195 }
196
197 void WINAPI IDirect3DDevice9Impl_GetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP* pRamp) {
198     HDC hDC;
199     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
200
201     FIXME("(%p) : pRamp@%p\n", This, pRamp);
202     hDC = GetDC(This->win_handle);
203     GetDeviceGammaRamp(hDC, pRamp);
204     ReleaseDC(This->win_handle, hDC);
205     return;
206 }
207
208 HRESULT  WINAPI  IDirect3DDevice9Impl_CreateRenderTarget(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
209     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
210     FIXME("(%p) : stub\n", This);    
211     return D3D_OK;
212 }
213
214 HRESULT  WINAPI  IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
215     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
216     FIXME("(%p) : stub\n", This);    
217     return D3D_OK;
218 }
219
220 HRESULT  WINAPI  IDirect3DDevice9Impl_UpdateSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) {
221     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
222     FIXME("(%p) : stub\n", This);
223     return D3D_OK;
224 }
225
226 HRESULT  WINAPI  IDirect3DDevice9Impl_UpdateTexture(LPDIRECT3DDEVICE9 iface, IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) {
227     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
228     FIXME("(%p) : stub\n", This);
229     return D3D_OK;
230 }
231
232 HRESULT  WINAPI  IDirect3DDevice9Impl_GetFrontBuffer(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pDestSurface) {
233     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
234     FIXME("(%p) : stub\n", This);
235     return D3D_OK;
236 }
237
238 HRESULT  WINAPI  IDirect3DDevice9Impl_GetRenderTargetData(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) {
239     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
240     FIXME("(%p) : stub\n", This);
241     return D3D_OK;
242 }
243
244 HRESULT  WINAPI  IDirect3DDevice9Impl_GetFrontBufferData(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9* pDestSurface) {
245     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
246     FIXME("(%p) : stub\n", This);
247     return D3D_OK;
248 }
249
250 HRESULT  WINAPI  IDirect3DDevice9Impl_StretchRects(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) {
251     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
252     FIXME("(%p) : stub\n", This);
253     return D3D_OK;
254 }
255
256 HRESULT  WINAPI  IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) {
257     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
258     FIXME("(%p) : stub\n", This);
259     return D3D_OK;
260 }
261
262 HRESULT  WINAPI  IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
263     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
264     FIXME("(%p) : stub\n", This);
265     return D3D_OK;
266 }
267
268 HRESULT  WINAPI  IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) {
269     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
270     FIXME("(%p) : stub\n", This);
271     return D3D_OK;
272 }
273
274 HRESULT  WINAPI  IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) {
275     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
276     FIXME("(%p) : stub\n", This);
277     return D3D_OK;
278 }
279
280 HRESULT  WINAPI  IDirect3DDevice9Impl_SetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pZStencilSurface) {
281     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
282     FIXME("(%p) : stub\n", This);
283     return D3D_OK;
284 }
285
286 HRESULT  WINAPI  IDirect3DDevice9Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9** ppZStencilSurface) {
287     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
288     FIXME("(%p) : stub\n", This);
289     return D3D_OK;
290 }
291
292 HRESULT  WINAPI  IDirect3DDevice9Impl_BeginScene(LPDIRECT3DDEVICE9 iface) {
293     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
294     return IWineD3DDevice_BeginScene(This->WineD3DDevice);
295 }
296
297 HRESULT  WINAPI  IDirect3DDevice9Impl_EndScene(LPDIRECT3DDEVICE9 iface) {
298     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
299     return IWineD3DDevice_EndScene(This->WineD3DDevice);
300 }
301
302 HRESULT  WINAPI  IDirect3DDevice9Impl_Clear(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) {
303     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
304     return IWineD3DDevice_Clear(This->WineD3DDevice, Count, pRects, Flags, Color, Z, Stencil);
305 }
306
307 HRESULT  WINAPI  IDirect3DDevice9Impl_SetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* lpMatrix) {
308     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
309     return IWineD3DDevice_SetTransform(This->WineD3DDevice, State, lpMatrix);
310 }
311
312 HRESULT  WINAPI  IDirect3DDevice9Impl_GetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) {
313     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
314     return IWineD3DDevice_GetTransform(This->WineD3DDevice, State, pMatrix);
315 }
316
317 HRESULT  WINAPI  IDirect3DDevice9Impl_MultiplyTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) {
318     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
319     return IWineD3DDevice_MultiplyTransform(This->WineD3DDevice, State, pMatrix);
320 }
321
322 HRESULT  WINAPI  IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) {
323     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
324     return IWineD3DDevice_SetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport);
325 }
326
327 HRESULT  WINAPI  IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport) {
328     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
329     return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport);
330 }
331
332 HRESULT  WINAPI  IDirect3DDevice9Impl_SetMaterial(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial) {
333     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
334     return IWineD3DDevice_SetMaterial(This->WineD3DDevice, (WINED3DMATERIAL *)pMaterial);
335 }
336
337 HRESULT  WINAPI  IDirect3DDevice9Impl_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATERIAL9* pMaterial) {
338     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
339     return IWineD3DDevice_GetMaterial(This->WineD3DDevice, (WINED3DMATERIAL *)pMaterial);
340 }
341
342 HRESULT  WINAPI  IDirect3DDevice9Impl_SetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST D3DLIGHT9* pLight) {
343     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
344     return IWineD3DDevice_SetLight(This->WineD3DDevice, Index, (WINED3DLIGHT *)pLight);
345 }
346
347 HRESULT  WINAPI  IDirect3DDevice9Impl_GetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, D3DLIGHT9* pLight) {
348     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
349     return IWineD3DDevice_GetLight(This->WineD3DDevice, Index, (WINED3DLIGHT *)pLight);
350 }
351
352 HRESULT  WINAPI  IDirect3DDevice9Impl_LightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL Enable) {
353     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
354     return IWineD3DDevice_SetLightEnable(This->WineD3DDevice, Index, Enable);
355 }
356
357 HRESULT  WINAPI  IDirect3DDevice9Impl_GetLightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL* pEnable) {
358     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
359     return IWineD3DDevice_GetLightEnable(This->WineD3DDevice, Index, pEnable);
360 }
361
362 HRESULT  WINAPI  IDirect3DDevice9Impl_SetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST float* pPlane) {
363     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
364     return IWineD3DDevice_SetClipPlane(This->WineD3DDevice, Index, pPlane);
365 }
366
367 HRESULT  WINAPI  IDirect3DDevice9Impl_GetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, float* pPlane) {
368     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
369     return IWineD3DDevice_GetClipPlane(This->WineD3DDevice, Index, pPlane);
370 }
371
372 HRESULT  WINAPI  IDirect3DDevice9Impl_SetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value) {
373     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
374     return IWineD3DDevice_SetRenderState(This->WineD3DDevice, State, Value);
375 }
376
377 HRESULT  WINAPI  IDirect3DDevice9Impl_GetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD* pValue) {
378     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
379     return IWineD3DDevice_GetRenderState(This->WineD3DDevice, State, pValue);
380 }
381
382 HRESULT  WINAPI  IDirect3DDevice9Impl_SetClipStatus(LPDIRECT3DDEVICE9 iface, CONST D3DCLIPSTATUS9* pClipStatus) {
383     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
384     return IWineD3DDevice_SetClipStatus(This->WineD3DDevice, (WINED3DCLIPSTATUS *)pClipStatus);
385 }
386
387 HRESULT  WINAPI  IDirect3DDevice9Impl_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3DCLIPSTATUS9* pClipStatus) {
388     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
389     return IWineD3DDevice_GetClipStatus(This->WineD3DDevice, (WINED3DCLIPSTATUS *)pClipStatus);
390 }
391
392 HRESULT  WINAPI  IDirect3DDevice9Impl_GetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9** ppTexture) {
393     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
394     TRACE("(%p) : returning %p for stage %ld\n", This, This->UpdateStateBlock->textures[Stage], Stage);
395     *ppTexture = (LPDIRECT3DBASETEXTURE9) This->UpdateStateBlock->textures[Stage];
396     IDirect3DBaseTexture9Impl_AddRef(*ppTexture);
397     return D3D_OK;
398 }
399
400 HRESULT  WINAPI  IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9* pTexture) {
401     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
402     FIXME("(%p) : stub\n", This);
403     return D3D_OK;
404 }
405
406 HRESULT  WINAPI  IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) {
407     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
408     return IWineD3DDevice_GetTextureStageState(This->WineD3DDevice, Stage, Type, pValue);
409 }
410
411 HRESULT  WINAPI  IDirect3DDevice9Impl_SetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) {
412     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
413     return IWineD3DDevice_SetTextureStageState(This->WineD3DDevice, Stage, Type, Value);
414 }
415
416 HRESULT  WINAPI  IDirect3DDevice9Impl_GetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) {
417     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
418     FIXME("(%p) : stub\n", This);
419     return D3D_OK;
420 }
421
422 HRESULT  WINAPI  IDirect3DDevice9Impl_SetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) {
423     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
424     FIXME("(%p) : stub\n", This);
425     return D3D_OK;
426 }
427
428 HRESULT  WINAPI  IDirect3DDevice9Impl_ValidateDevice(LPDIRECT3DDEVICE9 iface, DWORD* pNumPasses) {
429     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
430     TRACE("(%p) : stub\n", This);
431     return D3D_OK;
432 }
433
434 HRESULT  WINAPI  IDirect3DDevice9Impl_SetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries) {
435     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
436     FIXME("(%p) : setting p[%u] <= RGBA(%02x,%02x,%02x,%02x)\n", This, PaletteNumber, pEntries->peRed, pEntries->peGreen, pEntries->peBlue, pEntries->peFlags);
437     memcpy(This->palettes[PaletteNumber], pEntries, 256 * sizeof(PALETTEENTRY));
438     return D3D_OK;
439 }
440
441 HRESULT  WINAPI  IDirect3DDevice9Impl_GetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, PALETTEENTRY* pEntries) {
442     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
443     memcpy(pEntries, This->palettes[PaletteNumber], 256 * sizeof(PALETTEENTRY));
444     FIXME("(%p) : returning p[%u] => RGBA(%02x,%02x,%02x,%02x)\n", This, PaletteNumber, pEntries->peRed, pEntries->peGreen, pEntries->peBlue, pEntries->peFlags);
445     return D3D_OK;
446 }
447
448 HRESULT  WINAPI  IDirect3DDevice9Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber) {
449     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
450     TRACE("(%p) : stub\n", This);
451     return D3D_OK;
452 }
453
454 HRESULT  WINAPI  IDirect3DDevice9Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT* PaletteNumber) {
455     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
456     *PaletteNumber = This->currentPalette;
457     FIXME("(%p) : Returning (%u)\n", This, *PaletteNumber);
458     return D3D_OK;
459 }
460
461 HRESULT  WINAPI  IDirect3DDevice9Impl_SetScissorRect(LPDIRECT3DDEVICE9 iface, CONST RECT* pRect) {
462     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
463     FIXME("(%p) : stub\n", This);
464     return D3D_OK;
465 }
466
467 HRESULT  WINAPI  IDirect3DDevice9Impl_GetScissorRect(LPDIRECT3DDEVICE9 iface, RECT* pRect) {
468     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
469     FIXME("(%p) : stub\n", This);
470     return D3D_OK;
471 }
472
473 HRESULT  WINAPI  IDirect3DDevice9Impl_SetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface, BOOL bSoftware) {
474     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
475     FIXME("(%p) : stub\n", This);
476     return D3D_OK;
477 }
478
479 BOOL     WINAPI  IDirect3DDevice9Impl_GetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface) {
480     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
481     FIXME("(%p) : stub\n", This);
482     return D3D_OK;
483 }
484
485 HRESULT  WINAPI  IDirect3DDevice9Impl_SetNPatchMode(LPDIRECT3DDEVICE9 iface, float nSegments) {
486     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
487     FIXME("(%p) : stub\n", This);
488     return D3D_OK;
489 }
490
491 float    WINAPI  IDirect3DDevice9Impl_GetNPatchMode(LPDIRECT3DDEVICE9 iface) {
492     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
493     FIXME("(%p) : stub\n", This);
494     return 0.0f;
495 }
496
497 HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) {
498     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
499     return IWineD3DDevice_DrawPrimitive(This->WineD3DDevice, PrimitiveType, StartVertex, PrimitiveCount);
500 }
501
502 HRESULT  WINAPI  IDirect3DDevice9Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType,
503                                                            INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) {
504     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
505     return IWineD3DDevice_DrawIndexedPrimitive(This->WineD3DDevice, PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
506 }
507
508 HRESULT  WINAPI  IDirect3DDevice9Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
509     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
510     return IWineD3DDevice_DrawPrimitiveUP(This->WineD3DDevice, PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
511 }
512
513 HRESULT  WINAPI  IDirect3DDevice9Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex,
514                                                              UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData,
515                                                              D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
516     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
517     return IWineD3DDevice_DrawIndexedPrimitiveUP(This->WineD3DDevice, PrimitiveType, MinVertexIndex, NumVertexIndices, PrimitiveCount,
518                                                  pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
519 }
520
521 HRESULT  WINAPI  IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9 iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) {
522     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
523     FIXME("(%p) : stub\n", This);
524     return D3D_OK;
525 }
526
527 HRESULT  WINAPI  IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9 iface, DWORD FVF) {
528     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
529     return IWineD3DDevice_SetFVF(This->WineD3DDevice, FVF);
530 }
531
532 HRESULT  WINAPI  IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9 iface, DWORD* pFVF) {
533     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
534     return IWineD3DDevice_GetFVF(This->WineD3DDevice, pFVF);
535 }
536
537 HRESULT  WINAPI  IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) {
538     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
539     return IWineD3DDevice_SetStreamSource(This->WineD3DDevice, StreamNumber, 
540                                           pStreamData==NULL ? NULL:((IDirect3DVertexBuffer9Impl *)pStreamData)->wineD3DVertexBuffer, 
541                                           OffsetInBytes, Stride);
542 }
543
544 HRESULT  WINAPI  IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9** pStream, UINT* OffsetInBytes, UINT* pStride) {
545     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
546     IWineD3DVertexBuffer *retStream = NULL;
547     HRESULT rc = D3D_OK;
548
549     rc = IWineD3DDevice_GetStreamSource(This->WineD3DDevice, StreamNumber, (IWineD3DVertexBuffer **)&retStream, OffsetInBytes, pStride);
550     if (rc == D3D_OK && NULL != *pStream) {
551         IWineD3DVertexBuffer_GetParent(retStream, (IUnknown **)pStream);
552         IWineD3DVertexBuffer_Release(retStream);
553     }
554     return rc;
555 }
556
557 HRESULT  WINAPI  IDirect3DDevice9Impl_SetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT Divider) {
558     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
559     FIXME("(%p) : stub\n", This); 
560     return D3D_OK;
561 }
562
563 HRESULT  WINAPI  IDirect3DDevice9Impl_GetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT* Divider) {
564     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
565     FIXME("(%p) : stub\n", This); 
566     return D3D_OK;
567 }
568
569 HRESULT  WINAPI  IDirect3DDevice9Impl_SetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData) {
570     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
571     return IWineD3DDevice_SetIndices(This->WineD3DDevice, 
572                                      pIndexData==NULL ? NULL:((IDirect3DIndexBuffer9Impl *)pIndexData)->wineD3DIndexBuffer, 
573                                      0);
574 }
575
576 HRESULT  WINAPI  IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9** ppIndexData) {
577     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
578     IWineD3DIndexBuffer *retIndexData = NULL;
579     HRESULT rc = D3D_OK;
580     UINT tmp;
581
582     rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData, &tmp);
583     if (rc == D3D_OK && NULL != *ppIndexData) {
584         IWineD3DVertexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData);
585         IWineD3DVertexBuffer_Release(retIndexData);
586     }
587     return rc;
588 }
589
590 HRESULT  WINAPI  IDirect3DDevice9Impl_DrawRectPatch(LPDIRECT3DDEVICE9 iface, UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) {
591     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
592     FIXME("(%p) : stub\n", This);    
593     return D3D_OK;
594 }
595
596 HRESULT  WINAPI  IDirect3DDevice9Impl_DrawTriPatch(LPDIRECT3DDEVICE9 iface, UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) {
597     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
598     FIXME("(%p) : stub\n", This);    
599     return D3D_OK;
600 }
601
602 HRESULT  WINAPI  IDirect3DDevice9Impl_DeletePatch(LPDIRECT3DDEVICE9 iface, UINT Handle) {
603     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
604     FIXME("(%p) : stub\n", This);
605     return D3D_OK;
606 }
607
608
609 IDirect3DDevice9Vtbl Direct3DDevice9_Vtbl =
610 {
611     IDirect3DDevice9Impl_QueryInterface,
612     IDirect3DDevice9Impl_AddRef,
613     IDirect3DDevice9Impl_Release,
614     IDirect3DDevice9Impl_TestCooperativeLevel,
615     IDirect3DDevice9Impl_GetAvailableTextureMem,
616     IDirect3DDevice9Impl_EvictManagedRessources,
617     IDirect3DDevice9Impl_GetDirect3D,
618     IDirect3DDevice9Impl_GetDeviceCaps,
619     IDirect3DDevice9Impl_GetDisplayMode,
620     IDirect3DDevice9Impl_GetCreationParameters,
621     IDirect3DDevice9Impl_SetCursorProperties,
622     IDirect3DDevice9Impl_SetCursorPosition,
623     IDirect3DDevice9Impl_ShowCursor,
624     IDirect3DDevice9Impl_CreateAdditionalSwapChain,
625     IDirect3DDevice9Impl_GetSwapChain,
626     IDirect3DDevice9Impl_GetNumberOfSwapChains,
627     IDirect3DDevice9Impl_Reset,
628     IDirect3DDevice9Impl_Present,
629     IDirect3DDevice9Impl_GetBackBuffer,
630     IDirect3DDevice9Impl_GetRasterStatus,
631     IDirect3DDevice9Impl_SetDialogBoxMode,
632     IDirect3DDevice9Impl_SetGammaRamp,
633     IDirect3DDevice9Impl_GetGammaRamp,
634     IDirect3DDevice9Impl_CreateTexture,
635     IDirect3DDevice9Impl_CreateVolumeTexture,
636     IDirect3DDevice9Impl_CreateCubeTexture,
637     IDirect3DDevice9Impl_CreateVertexBuffer,
638     IDirect3DDevice9Impl_CreateIndexBuffer,
639     IDirect3DDevice9Impl_CreateRenderTarget,
640     IDirect3DDevice9Impl_CreateDepthStencilSurface,
641     IDirect3DDevice9Impl_UpdateSurface,
642     IDirect3DDevice9Impl_UpdateTexture,
643     IDirect3DDevice9Impl_GetRenderTargetData,
644     IDirect3DDevice9Impl_GetFrontBufferData,
645     IDirect3DDevice9Impl_StretchRects,
646     IDirect3DDevice9Impl_ColorFill,
647     IDirect3DDevice9Impl_CreateOffscreenPlainSurface,
648     IDirect3DDevice9Impl_SetRenderTarget,
649     IDirect3DDevice9Impl_GetRenderTarget,
650     IDirect3DDevice9Impl_SetDepthStencilSurface,
651     IDirect3DDevice9Impl_GetDepthStencilSurface,
652     IDirect3DDevice9Impl_BeginScene,
653     IDirect3DDevice9Impl_EndScene,
654     IDirect3DDevice9Impl_Clear,
655     IDirect3DDevice9Impl_SetTransform,
656     IDirect3DDevice9Impl_GetTransform,
657     IDirect3DDevice9Impl_MultiplyTransform,
658     IDirect3DDevice9Impl_SetViewport,
659     IDirect3DDevice9Impl_GetViewport,
660     IDirect3DDevice9Impl_SetMaterial,
661     IDirect3DDevice9Impl_GetMaterial,
662     IDirect3DDevice9Impl_SetLight,
663     IDirect3DDevice9Impl_GetLight,
664     IDirect3DDevice9Impl_LightEnable,
665     IDirect3DDevice9Impl_GetLightEnable,
666     IDirect3DDevice9Impl_SetClipPlane,
667     IDirect3DDevice9Impl_GetClipPlane,
668     IDirect3DDevice9Impl_SetRenderState,
669     IDirect3DDevice9Impl_GetRenderState,
670     IDirect3DDevice9Impl_CreateStateBlock,
671     IDirect3DDevice9Impl_BeginStateBlock,
672     IDirect3DDevice9Impl_EndStateBlock,
673     IDirect3DDevice9Impl_SetClipStatus,
674     IDirect3DDevice9Impl_GetClipStatus,
675     IDirect3DDevice9Impl_GetTexture,
676     IDirect3DDevice9Impl_SetTexture,
677     IDirect3DDevice9Impl_GetTextureStageState,
678     IDirect3DDevice9Impl_SetTextureStageState,
679     IDirect3DDevice9Impl_GetSamplerState,
680     IDirect3DDevice9Impl_SetSamplerState,
681     IDirect3DDevice9Impl_ValidateDevice,
682     IDirect3DDevice9Impl_SetPaletteEntries,
683     IDirect3DDevice9Impl_GetPaletteEntries,
684     IDirect3DDevice9Impl_SetCurrentTexturePalette,
685     IDirect3DDevice9Impl_GetCurrentTexturePalette,
686     IDirect3DDevice9Impl_SetScissorRect,
687     IDirect3DDevice9Impl_GetScissorRect,
688     IDirect3DDevice9Impl_SetSoftwareVertexProcessing,
689     IDirect3DDevice9Impl_GetSoftwareVertexProcessing,
690     IDirect3DDevice9Impl_SetNPatchMode,
691     IDirect3DDevice9Impl_GetNPatchMode,
692     IDirect3DDevice9Impl_DrawPrimitive,
693     IDirect3DDevice9Impl_DrawIndexedPrimitive,
694     IDirect3DDevice9Impl_DrawPrimitiveUP,
695     IDirect3DDevice9Impl_DrawIndexedPrimitiveUP,
696     IDirect3DDevice9Impl_ProcessVertices,
697     IDirect3DDevice9Impl_CreateVertexDeclaration,
698     IDirect3DDevice9Impl_SetVertexDeclaration,
699     IDirect3DDevice9Impl_GetVertexDeclaration,
700     IDirect3DDevice9Impl_SetFVF,
701     IDirect3DDevice9Impl_GetFVF,
702     IDirect3DDevice9Impl_CreateVertexShader,
703     IDirect3DDevice9Impl_SetVertexShader,
704     IDirect3DDevice9Impl_GetVertexShader,
705     IDirect3DDevice9Impl_SetVertexShaderConstantF,
706     IDirect3DDevice9Impl_GetVertexShaderConstantF,
707     IDirect3DDevice9Impl_SetVertexShaderConstantI,
708     IDirect3DDevice9Impl_GetVertexShaderConstantI,
709     IDirect3DDevice9Impl_SetVertexShaderConstantB,
710     IDirect3DDevice9Impl_GetVertexShaderConstantB,
711     IDirect3DDevice9Impl_SetStreamSource,
712     IDirect3DDevice9Impl_GetStreamSource,
713     IDirect3DDevice9Impl_SetStreamSourceFreq,
714     IDirect3DDevice9Impl_GetStreamSourceFreq,
715     IDirect3DDevice9Impl_SetIndices,
716     IDirect3DDevice9Impl_GetIndices,
717     IDirect3DDevice9Impl_CreatePixelShader,
718     IDirect3DDevice9Impl_SetPixelShader,
719     IDirect3DDevice9Impl_GetPixelShader,
720     IDirect3DDevice9Impl_SetPixelShaderConstantF,
721     IDirect3DDevice9Impl_GetPixelShaderConstantF,
722     IDirect3DDevice9Impl_SetPixelShaderConstantI,
723     IDirect3DDevice9Impl_GetPixelShaderConstantI,
724     IDirect3DDevice9Impl_SetPixelShaderConstantB,
725     IDirect3DDevice9Impl_GetPixelShaderConstantB,
726     IDirect3DDevice9Impl_DrawRectPatch,
727     IDirect3DDevice9Impl_DrawTriPatch,
728     IDirect3DDevice9Impl_DeletePatch,
729     IDirect3DDevice9Impl_CreateQuery
730 };