Accelerator resource struct fix for sparc.
[wine] / dlls / d3d9 / d3d9_private.h
1 /*
2  * Direct3D 9 private include file
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 #ifndef __WINE_D3D9_PRIVATE_H
23 #define __WINE_D3D9_PRIVATE_H
24
25 #ifndef __WINE_CONFIG_H
26 # error You must include config.h to use this header
27 #endif
28
29 /* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */
30 #include <stdarg.h>
31
32 #define NONAMELESSUNION
33 #define NONAMELESSSTRUCT
34 #define COBJMACROS
35 #include "windef.h"
36 #include "winbase.h"
37 #include "wingdi.h"
38 #include "winuser.h"
39 #include "wine/debug.h"
40 #include "wine/unicode.h"
41
42 #define XMD_H 
43 #include <GL/gl.h>
44 #include <GL/glx.h>
45 #ifdef HAVE_GL_GLEXT_H
46 # include <GL/glext.h>
47 #endif
48 #undef  XMD_H
49
50 #undef APIENTRY
51 #undef CALLBACK
52 #undef WINAPI
53
54 /* Redefines the constants */
55 #define CALLBACK    __stdcall
56 #define WINAPI      __stdcall
57 #define APIENTRY    WINAPI
58
59 #include "d3d9.h"
60 #include "d3d9_private.h"
61 #include "wine/wined3d_interface.h"
62
63 /* X11 locking */
64
65 extern void (*wine_tsx11_lock_ptr)(void);
66 extern void (*wine_tsx11_unlock_ptr)(void);
67
68 /* As GLX relies on X, this is needed */
69 #define ENTER_GL() wine_tsx11_lock_ptr()
70 #define LEAVE_GL() wine_tsx11_unlock_ptr()
71
72 #include <stdarg.h>
73
74 #include "windef.h"
75 #include "winbase.h"
76 #include "d3d9.h"
77
78 /* Device caps */
79 #define MAX_PALETTES      256
80 #define MAX_STREAMS       16
81 #define MAX_ACTIVE_LIGHTS 8
82 #define MAX_CLIPPLANES    D3DMAXUSERCLIPPLANES
83 #define MAX_LEVELS        256
84
85 /* Other useful values */
86 #define HIGHEST_RENDER_STATE 174
87 #define HIGHEST_TEXTURE_STATE 29
88 #define HIGHEST_TRANSFORMSTATE 512
89 #define D3DSBT_RECORDED 0xfffffffe
90
91 #define D3D_VSHADER_MAX_CONSTANTS 96
92 #define D3D_PSHADER_MAX_CONSTANTS 32
93
94 /* Direct3D9 Interfaces: */
95 typedef struct IDirect3D9Impl                  IDirect3D9Impl;
96 typedef struct IDirect3DDevice9Impl            IDirect3DDevice9Impl;
97 typedef struct IDirect3DBaseTexture9Impl       IDirect3DBaseTexture9Impl;
98 typedef struct IDirect3DTexture9Impl           IDirect3DTexture9Impl;
99 typedef struct IDirect3DVolumeTexture9Impl     IDirect3DVolumeTexture9Impl;
100 typedef struct IDirect3DCubeTexture9Impl       IDirect3DCubeTexture9Impl;
101 typedef struct IDirect3DVertexBuffer9Impl      IDirect3DVertexBuffer9Impl;
102 typedef struct IDirect3DIndexBuffer9Impl       IDirect3DIndexBuffer9Impl;
103 typedef struct IDirect3DSurface9Impl           IDirect3DSurface9Impl;
104 typedef struct IDirect3DSwapChain9Impl         IDirect3DSwapChain9Impl;
105 typedef struct IDirect3DResource9Impl          IDirect3DResource9Impl;
106 typedef struct IDirect3DVolume9Impl            IDirect3DVolume9Impl;
107 typedef struct IDirect3DStateBlock9Impl        IDirect3DStateBlock9Impl;
108 typedef struct IDirect3DVertexShader9Impl      IDirect3DVertexShader9Impl;
109 typedef struct IDirect3DPixelShader9Impl       IDirect3DPixelShader9Impl;
110 typedef struct IDirect3DVertexDeclaration9Impl IDirect3DVertexDeclaration9Impl;
111 typedef struct IDirect3DQuery9Impl             IDirect3DQuery9Impl;
112
113
114 #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
115 #define D3DCOLOR_G(dw) (((float) (((dw) >>  8) & 0xFF)) / 255.0f)
116 #define D3DCOLOR_B(dw) (((float) (((dw) >>  0) & 0xFF)) / 255.0f)
117 #define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f)
118
119 #define D3DCOLORTOCOLORVALUE(dw, col) \
120   (col).r = D3DCOLOR_R(dw); \
121   (col).g = D3DCOLOR_G(dw); \
122   (col).b = D3DCOLOR_B(dw); \
123   (col).a = D3DCOLOR_A(dw); 
124
125 #define D3DCOLORTOVECTOR4(dw, vec) \
126   (vec).x = D3DCOLOR_R(dw); \
127   (vec).y = D3DCOLOR_G(dw); \
128   (vec).z = D3DCOLOR_B(dw); \
129   (vec).w = D3DCOLOR_A(dw);
130
131 #define D3DCOLORTOGLFLOAT4(dw, vec) \
132   (vec)[0] = D3DCOLOR_R(dw); \
133   (vec)[1] = D3DCOLOR_G(dw); \
134   (vec)[2] = D3DCOLOR_B(dw); \
135   (vec)[3] = D3DCOLOR_A(dw);
136
137 /**
138  * State Block for Begin/End/Capture/Create/Apply State Block
139  *  Note: Very long winded but I do not believe gl Lists will 
140  *  resolve everything we need, so doing it manually for now
141  */
142 typedef struct SAVEDSTATES {
143   BOOL          lightEnable[MAX_ACTIVE_LIGHTS];
144   BOOL          Indices;
145   BOOL          lights[MAX_ACTIVE_LIGHTS];
146   BOOL          material;
147   BOOL          stream_source[MAX_STREAMS];
148   BOOL          textures[8];
149   BOOL          transform[HIGHEST_TRANSFORMSTATE];
150   BOOL          viewport;
151   BOOL          vertexShader;
152   BOOL          vertexShaderConstant;
153   BOOL          vertexShaderDecl;
154   BOOL          pixelShader;
155   BOOL          pixelShaderConstant;
156   BOOL          renderstate[HIGHEST_RENDER_STATE];
157   BOOL          texture_state[8][HIGHEST_TEXTURE_STATE];
158   BOOL          clipplane[MAX_CLIPPLANES];
159 } SAVEDSTATES;
160
161 typedef struct D3DSHADERVECTORF {
162   float x;
163   float y;
164   float z;
165   float w;
166 } D3DSHADERVECTORF;
167
168 typedef struct D3DSHADERVECTORI {
169   int x;
170   int y;
171   int z;
172   int w;
173 } D3DSHADERVECTORI;
174
175 /* ===========================================================================
176     The interfactes themselves
177    =========================================================================== */
178
179 /* ---------- */
180 /* IDirect3D9 */
181 /* ---------- */
182
183 /*****************************************************************************
184  * Predeclare the interface implementation structures
185  */
186 extern IDirect3D9Vtbl Direct3D9_Vtbl;
187
188 /*****************************************************************************
189  * IDirect3D implementation structure
190  */
191 struct IDirect3D9Impl
192 {
193     /* IUnknown fields */
194     IDirect3D9Vtbl         *lpVtbl;
195     DWORD                   ref;
196
197     /* The WineD3D device */
198     IWineD3D               *WineD3D;
199
200     /* IDirect3D9 fields */
201 };
202
203 /* IUnknown: */
204 extern HRESULT WINAPI   IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface,REFIID refiid,LPVOID *obj);
205 extern ULONG WINAPI     IDirect3D9Impl_AddRef(LPDIRECT3D9 iface);
206 extern ULONG WINAPI     IDirect3D9Impl_Release(LPDIRECT3D9 iface);
207
208 /* IDirect3d9: */
209 extern HRESULT  WINAPI  IDirect3D9Impl_RegisterSoftwareDevice(LPDIRECT3D9 iface, void* pInitializeFunction);
210 extern UINT     WINAPI  IDirect3D9Impl_GetAdapterCount(LPDIRECT3D9 iface);
211 extern HRESULT  WINAPI  IDirect3D9Impl_GetAdapterIdentifier(LPDIRECT3D9 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier);
212 extern UINT     WINAPI  IDirect3D9Impl_GetAdapterModeCount(LPDIRECT3D9 iface, UINT Adapter, D3DFORMAT Format);
213 extern HRESULT  WINAPI  IDirect3D9Impl_EnumAdapterModes(LPDIRECT3D9 iface, UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode);
214 extern HRESULT  WINAPI  IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UINT Adapter, D3DDISPLAYMODE* pMode);
215 extern HRESULT  WINAPI  IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed);
216 extern HRESULT  WINAPI  IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
217 extern HRESULT  WINAPI  IDirect3D9Impl_CheckDeviceMultiSampleType(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels);
218 extern HRESULT  WINAPI  IDirect3D9Impl_CheckDepthStencilMatch(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
219 extern HRESULT  WINAPI  IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
220 extern HRESULT  WINAPI  IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps);
221 extern HMONITOR WINAPI  IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT Adapter);
222 extern HRESULT  WINAPI  IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface);
223
224 /* ---------------- */
225 /* IDirect3DDevice9 */
226 /* ---------------- */
227
228 /*****************************************************************************
229  * Predeclare the interface implementation structures
230  */
231 extern IDirect3DDevice9Vtbl Direct3DDevice9_Vtbl;
232
233 /*****************************************************************************
234  * IDirect3DDevice9 implementation structure
235  */
236 struct IDirect3DDevice9Impl
237 {
238     /* IUnknown fields */
239     IDirect3DDevice9Vtbl         *lpVtbl;
240     DWORD                         ref;
241
242     /* IDirect3DDevice9 fields */
243     IDirect3D9Impl               *direct3d;
244     IWineD3DDevice               *WineD3DDevice;
245
246     /* FIXME: To be sorted out during move */
247     IDirect3DSurface9Impl        *frontBuffer;
248     IDirect3DSurface9Impl        *backBuffer;
249     IDirect3DSurface9Impl        *depthStencilBuffer;
250
251     IDirect3DSurface9Impl        *renderTarget;
252     IDirect3DSurface9Impl        *stencilBufferTarget;
253
254     D3DPRESENT_PARAMETERS         PresentParms;
255     D3DDEVICE_CREATION_PARAMETERS CreateParms;
256
257     UINT                          adapterNo;
258     D3DDEVTYPE                    devType;
259
260     UINT                          srcBlend;
261     UINT                          dstBlend;
262     UINT                          alphafunc;
263     UINT                          stencilfunc;
264
265     /* State block related */
266     BOOL                          isRecordingState;
267     IDirect3DStateBlock9Impl     *StateBlock;
268     IDirect3DStateBlock9Impl     *UpdateStateBlock;
269
270     /* Other required values */
271     float                         lightPosn[MAX_ACTIVE_LIGHTS][4];
272     float                         lightDirn[MAX_ACTIVE_LIGHTS][4];
273
274     /* palettes texture management */
275     PALETTEENTRY                  palettes[MAX_PALETTES][256];
276     UINT                          currentPalette;
277
278     /* Optimization */
279     D3DMATRIX                     lastProj;
280     D3DMATRIX                     lastView;
281     D3DMATRIX                     lastWorld0;
282     D3DMATRIX                     lastTexTrans[8];
283
284     /* OpenGL related */
285     /*
286     GLXContext                    glCtx;
287     XVisualInfo                  *visInfo;
288     Display                      *display;
289     GLXContext                    render_ctx;
290     Drawable                      drawable;
291     Window                        win;
292     */
293     HWND                          win_handle;
294
295     /* OpenGL Extension related */
296
297     /* Cursor management */
298     BOOL                          bCursorVisible;
299     UINT                          xHotSpot;
300     UINT                          yHotSpot;
301     UINT                          xScreenSpace;
302     UINT                          yScreenSpace;
303
304     UINT                          dummyTextureName[8];
305 };
306
307 /* IUnknown: */
308 extern HRESULT WINAPI   IDirect3DDevice9Impl_QueryInterface(LPDIRECT3DDEVICE9 iface, REFIID refiid, LPVOID *obj);
309 extern ULONG WINAPI     IDirect3DDevice9Impl_AddRef(LPDIRECT3DDEVICE9 iface);
310 extern ULONG WINAPI     IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9 iface);
311
312 /* IDirect3DDevice9: */
313 extern HRESULT  WINAPI  IDirect3DDevice9Impl_TestCooperativeLevel(LPDIRECT3DDEVICE9 iface);
314 extern UINT     WINAPI  IDirect3DDevice9Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface);
315 extern HRESULT  WINAPI  IDirect3DDevice9Impl_EvictManagedRessources(LPDIRECT3DDEVICE9 iface);
316 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDirect3D9** ppD3D9);
317 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9* pCaps);
318 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode);
319 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters);
320 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap);
321 extern void     WINAPI  IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int XScreenSpace, int YScreenSpace, DWORD Flags);
322 extern BOOL     WINAPI  IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow);
323 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain);
324 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9** pSwapChain);
325 extern UINT     WINAPI  IDirect3DDevice9Impl_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 iface);
326 extern HRESULT  WINAPI  IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters);
327 extern HRESULT  WINAPI  IDirect3DDevice9Impl_Present(LPDIRECT3DDEVICE9 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
328 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer);
329 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus);
330 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetDialogBoxMode(LPDIRECT3DDEVICE9 iface, BOOL bEnableDialogs);
331 extern void     WINAPI  IDirect3DDevice9Impl_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
332 extern void     WINAPI  IDirect3DDevice9Impl_GetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP* pRamp);
333 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle);
334 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateVolumeTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle);
335 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateCubeTexture(LPDIRECT3DDEVICE9 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle);
336 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle);
337 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle);
338 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateRenderTarget(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
339 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
340 extern HRESULT  WINAPI  IDirect3DDevice9Impl_UpdateSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint);
341 extern HRESULT  WINAPI  IDirect3DDevice9Impl_UpdateTexture(LPDIRECT3DDEVICE9 iface, IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture);
342 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetRenderTargetData(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface);
343 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetFrontBufferData(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9* pDestSurface);
344 extern HRESULT  WINAPI  IDirect3DDevice9Impl_StretchRects(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter);
345 extern HRESULT  WINAPI  IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color);
346 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
347 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget);
348 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget);
349 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pNewZStencilSurface);
350 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9** ppZStencilSurface);
351 extern HRESULT  WINAPI  IDirect3DDevice9Impl_BeginScene(LPDIRECT3DDEVICE9 iface);
352 extern HRESULT  WINAPI  IDirect3DDevice9Impl_EndScene(LPDIRECT3DDEVICE9 iface);
353 extern HRESULT  WINAPI  IDirect3DDevice9Impl_Clear(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
354 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
355 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
356 extern HRESULT  WINAPI  IDirect3DDevice9Impl_MultiplyTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
357 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport);
358 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport);
359 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetMaterial(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial);
360 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATERIAL9* pMaterial);
361 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST D3DLIGHT9* pLight);
362 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, D3DLIGHT9* pLight);
363 extern HRESULT  WINAPI  IDirect3DDevice9Impl_LightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL Enable);
364 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetLightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL* pEnable);
365 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST float* pPlane);
366 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, float* pPlane);
367 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value);
368 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD* pValue);
369 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateStateBlock(LPDIRECT3DDEVICE9 iface, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB);
370 extern HRESULT  WINAPI  IDirect3DDevice9Impl_BeginStateBlock(LPDIRECT3DDEVICE9 iface);
371 extern HRESULT  WINAPI  IDirect3DDevice9Impl_EndStateBlock(LPDIRECT3DDEVICE9 iface, IDirect3DStateBlock9** ppSB);
372 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetClipStatus(LPDIRECT3DDEVICE9 iface, CONST D3DCLIPSTATUS9* pClipStatus);
373 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3DCLIPSTATUS9* pClipStatus);
374 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9** ppTexture);
375 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9* pTexture);
376 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
377 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
378 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue);
379 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value);
380 extern HRESULT  WINAPI  IDirect3DDevice9Impl_ValidateDevice(LPDIRECT3DDEVICE9 iface, DWORD* pNumPasses);
381 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
382 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, PALETTEENTRY* pEntries);
383 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber);
384 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT *PaletteNumber);
385 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetScissorRect(LPDIRECT3DDEVICE9 iface, CONST RECT* pRect);
386 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetScissorRect(LPDIRECT3DDEVICE9 iface, RECT* pRect);
387 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface, BOOL bSoftware);
388 extern BOOL     WINAPI  IDirect3DDevice9Impl_GetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface);
389 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetNPatchMode(LPDIRECT3DDEVICE9 iface, float nSegments);
390 extern float    WINAPI  IDirect3DDevice9Impl_GetNPatchMode(LPDIRECT3DDEVICE9 iface);
391 extern HRESULT  WINAPI  IDirect3DDevice9Impl_DrawPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
392 extern HRESULT  WINAPI  IDirect3DDevice9Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
393 extern HRESULT  WINAPI  IDirect3DDevice9Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
394 extern HRESULT  WINAPI  IDirect3DDevice9Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
395 extern HRESULT  WINAPI  IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9 iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags);
396 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9 iface, CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl);
397 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9* pDecl);
398 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9** ppDecl);
399 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9 iface, DWORD FVF);
400 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9 iface, DWORD* pFVF);
401 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateVertexShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader);
402 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9* pShader);
403 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9** ppShader);
404 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
405 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount);
406 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
407 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount);
408 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
409 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
410 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride);
411 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride);
412 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT Divider);
413 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT* Divider);
414 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData);
415 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9** ppIndexData);
416 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreatePixelShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader);
417 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9* pShader);
418 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9** ppShader);
419 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
420 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount);
421 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
422 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount);
423 extern HRESULT  WINAPI  IDirect3DDevice9Impl_SetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
424 extern HRESULT  WINAPI  IDirect3DDevice9Impl_GetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
425 extern HRESULT  WINAPI  IDirect3DDevice9Impl_DrawRectPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo);
426 extern HRESULT  WINAPI  IDirect3DDevice9Impl_DrawTriPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo);
427 extern HRESULT  WINAPI  IDirect3DDevice9Impl_DeletePatch(LPDIRECT3DDEVICE9 iface, UINT Handle);
428 extern HRESULT  WINAPI  IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery);
429
430
431 /* ---------------- */
432 /* IDirect3DVolume9 */
433 /* ---------------- */
434
435 /*****************************************************************************
436  * Predeclare the interface implementation structures
437  */
438 extern IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl;
439
440 /*****************************************************************************
441  * IDirect3DVolume9 implementation structure
442  */
443 struct IDirect3DVolume9Impl
444 {
445     /* IUnknown fields */
446     IDirect3DVolume9Vtbl   *lpVtbl;
447     DWORD                   ref;
448
449     /* IDirect3DVolume9 fields */
450     IDirect3DDevice9Impl   *Device;
451     D3DRESOURCETYPE         ResourceType;
452
453     IUnknown               *Container;
454     D3DVOLUME_DESC          myDesc;
455     BYTE                   *allocatedMemory;
456     UINT                    textureName;
457     UINT                    bytesPerPixel;
458
459     BOOL                    lockable;
460     BOOL                    locked;
461     D3DBOX                  lockedBox;
462     D3DBOX                  dirtyBox;
463     BOOL                    Dirty;
464 };
465
466 /* IUnknown: */
467 extern HRESULT WINAPI IDirect3DVolume9Impl_QueryInterface(LPDIRECT3DVOLUME9 iface, REFIID refiid, LPVOID* obj);
468 extern ULONG WINAPI   IDirect3DVolume9Impl_AddRef(LPDIRECT3DVOLUME9 iface);
469 extern ULONG WINAPI   IDirect3DVolume9Impl_Release(LPDIRECT3DVOLUME9 iface);
470
471 /* IDirect3DVolume9: */
472 extern HRESULT WINAPI IDirect3DVolume9Impl_GetDevice(LPDIRECT3DVOLUME9 iface, IDirect3DDevice9** ppDevice);
473 extern HRESULT WINAPI IDirect3DVolume9Impl_SetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
474 extern HRESULT WINAPI IDirect3DVolume9Impl_GetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID  refguid, void* pData, DWORD* pSizeOfData);
475 extern HRESULT WINAPI IDirect3DVolume9Impl_FreePrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid);
476 extern HRESULT WINAPI IDirect3DVolume9Impl_GetContainer(LPDIRECT3DVOLUME9 iface, REFIID riid, void** ppContainer);
477 extern HRESULT WINAPI IDirect3DVolume9Impl_GetDesc(LPDIRECT3DVOLUME9 iface, D3DVOLUME_DESC* pDesc);
478 extern HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
479 extern HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface);
480
481
482 /* ------------------- */
483 /* IDirect3DSwapChain9 */
484 /* ------------------- */
485
486 /*****************************************************************************
487  * Predeclare the interface implementation structures
488  */
489 extern IDirect3DSwapChain9Vtbl Direct3DSwapChain9_Vtbl;
490
491 /*****************************************************************************
492  * IDirect3DSwapChain9 implementation structure
493  */
494 struct IDirect3DSwapChain9Impl
495 {
496     /* IUnknown fields */
497     IDirect3DSwapChain9Vtbl *lpVtbl;
498     DWORD                   ref;
499
500     /* IDirect3DSwapChain9 fields */
501     IDirect3DDevice9Impl   *Device;
502     IDirect3DSurface9Impl  *frontBuffer;
503     IDirect3DSurface9Impl  *backBuffer;
504     IDirect3DSurface9Impl  *depthStencilBuffer;
505     D3DPRESENT_PARAMETERS   PresentParms;        
506 };
507
508 /* IUnknown: */
509 extern HRESULT WINAPI IDirect3DSwapChain9Impl_QueryInterface(LPDIRECT3DSWAPCHAIN9 iface, REFIID refiid, LPVOID* obj);
510 extern ULONG WINAPI   IDirect3DSwapChain9Impl_AddRef(LPDIRECT3DSWAPCHAIN9 iface);
511 extern ULONG WINAPI   IDirect3DSwapChain9Impl_Release(LPDIRECT3DSWAPCHAIN9 iface);
512
513 /* IDirect3DSwapChain9: */
514 extern HRESULT WINAPI IDirect3DSwapChain9Impl_Present(LPDIRECT3DSWAPCHAIN9 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags);
515 extern HRESULT WINAPI IDirect3DSwapChain9Impl_GetFrontBufferData(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DSurface9* pDestSurface);
516 extern HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN9 iface, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer);
517 extern HRESULT WINAPI IDirect3DSwapChain9Impl_GetRasterStatus(LPDIRECT3DSWAPCHAIN9 iface, D3DRASTER_STATUS* pRasterStatus);
518 extern HRESULT WINAPI IDirect3DSwapChain9Impl_GetDisplayMode(LPDIRECT3DSWAPCHAIN9 iface, D3DDISPLAYMODE* pMode);
519 extern HRESULT WINAPI IDirect3DSwapChain9Impl_GetDevice(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DDevice9** ppDevice);
520 extern HRESULT WINAPI IDirect3DSwapChain9Impl_GetPresentParameters(LPDIRECT3DSWAPCHAIN9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters);
521
522
523 /* ------------------ */
524 /* IDirect3DResource9 */
525 /* ------------------ */
526
527 /*****************************************************************************
528  * Predeclare the interface implementation structures
529  */
530 extern IDirect3DResource9Vtbl Direct3DResource9_Vtbl;
531
532 /*****************************************************************************
533  * IDirect3DResource9 implementation structure
534  */
535 struct IDirect3DResource9Impl
536 {
537     /* IUnknown fields */
538     IDirect3DResource9Vtbl *lpVtbl;
539     DWORD                   ref;
540
541     /* IDirect3DResource9 fields */
542     IWineD3DResource       *wineD3DResource;
543     IDirect3DDevice9       *device;
544 };
545
546 /* IUnknown: */
547 extern HRESULT WINAPI         IDirect3DResource9Impl_QueryInterface(LPDIRECT3DRESOURCE9 iface,REFIID refiid,LPVOID *obj);
548 extern ULONG WINAPI           IDirect3DResource9Impl_AddRef(LPDIRECT3DRESOURCE9 iface);
549 extern ULONG WINAPI           IDirect3DResource9Impl_Release(LPDIRECT3DRESOURCE9 iface);
550
551 /* IDirect3DResource9: */
552 extern HRESULT  WINAPI        IDirect3DResource9Impl_GetDevice(LPDIRECT3DRESOURCE9 iface, IDirect3DDevice9** ppDevice);
553 extern HRESULT  WINAPI        IDirect3DResource9Impl_SetPrivateData(LPDIRECT3DRESOURCE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
554 extern HRESULT  WINAPI        IDirect3DResource9Impl_GetPrivateData(LPDIRECT3DRESOURCE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
555 extern HRESULT  WINAPI        IDirect3DResource9Impl_FreePrivateData(LPDIRECT3DRESOURCE9 iface, REFGUID refguid);
556 extern DWORD    WINAPI        IDirect3DResource9Impl_SetPriority(LPDIRECT3DRESOURCE9 iface, DWORD PriorityNew);
557 extern DWORD    WINAPI        IDirect3DResource9Impl_GetPriority(LPDIRECT3DRESOURCE9 iface);
558 extern void     WINAPI        IDirect3DResource9Impl_PreLoad(LPDIRECT3DRESOURCE9 iface);
559 extern D3DRESOURCETYPE WINAPI IDirect3DResource9Impl_GetType(LPDIRECT3DRESOURCE9 iface);
560
561
562 /* ----------------- */
563 /* IDirect3DSurface9 */
564 /* ----------------- */
565
566 /*****************************************************************************
567  * Predeclare the interface implementation structures
568  */
569 extern IDirect3DSurface9Vtbl Direct3DSurface9_Vtbl;
570
571 /*****************************************************************************
572  * IDirect3DSurface9 implementation structure
573  */
574 struct IDirect3DSurface9Impl
575 {
576     /* IUnknown fields */
577     IDirect3DSurface9Vtbl  *lpVtbl;
578     DWORD                   ref;
579
580     /* IDirect3DResource9 fields */
581     IDirect3DDevice9Impl   *Device;
582     D3DRESOURCETYPE         ResourceType;
583
584     /* IDirect3DSurface9 fields */
585     IUnknown               *Container;
586     D3DSURFACE_DESC         myDesc;
587     BYTE                   *allocatedMemory;
588     UINT                    textureName;
589     UINT                    bytesPerPixel;
590
591     BOOL                    lockable;
592     BOOL                    locked;
593     RECT                    lockedRect;
594     RECT                    dirtyRect;
595     BOOL                    Dirty;
596 };
597
598 /* IUnknown: */
599 extern HRESULT WINAPI IDirect3DSurface9Impl_QueryInterface(LPDIRECT3DSURFACE9 iface, REFIID refiid, LPVOID* obj);
600 extern ULONG WINAPI   IDirect3DSurface9Impl_AddRef(LPDIRECT3DSURFACE9 iface);
601 extern ULONG WINAPI   IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface);
602
603 /* IDirect3DSurface9: (Inherited from IDirect3DResource9) */
604 extern HRESULT WINAPI IDirect3DSurface9Impl_GetDevice(LPDIRECT3DSURFACE9 iface, IDirect3DDevice9** ppDevice);
605 extern HRESULT WINAPI IDirect3DSurface9Impl_SetPrivateData(LPDIRECT3DSURFACE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
606 extern HRESULT WINAPI IDirect3DSurface9Impl_GetPrivateData(LPDIRECT3DSURFACE9 iface, REFGUID refguid, void* pData,DWORD* pSizeOfData);
607 extern HRESULT WINAPI IDirect3DSurface9Impl_FreePrivateData(LPDIRECT3DSURFACE9 iface, REFGUID refguid);
608 extern DWORD   WINAPI IDirect3DSurface9Impl_SetPriority(LPDIRECT3DSURFACE9 iface, DWORD PriorityNew);
609 extern DWORD   WINAPI IDirect3DSurface9Impl_GetPriority(LPDIRECT3DSURFACE9 iface);
610 extern void    WINAPI IDirect3DSurface9Impl_PreLoad(LPDIRECT3DSURFACE9 iface);
611 extern D3DRESOURCETYPE WINAPI IDirect3DSurface9Impl_GetType(LPDIRECT3DSURFACE9 iface);
612
613 /* IDirect3DSurface9: */
614 extern HRESULT WINAPI IDirect3DSurface9Impl_GetContainer(LPDIRECT3DSURFACE9 iface, REFIID riid, void** ppContainer);
615 extern HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(LPDIRECT3DSURFACE9 iface, D3DSURFACE_DESC *pDesc);
616 extern HRESULT WINAPI IDirect3DSurface9Impl_LockRect(LPDIRECT3DSURFACE9 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
617 extern HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface);
618 extern HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC* phdc);
619 extern HRESULT WINAPI IDirect3DSurface9Impl_ReleaseDC(LPDIRECT3DSURFACE9 iface, HDC hdc);
620
621
622 /* ---------------------- */
623 /* IDirect3DVertexBuffer9 */
624 /* ---------------------- */
625
626 /*****************************************************************************
627  * Predeclare the interface implementation structures
628  */
629 extern IDirect3DVertexBuffer9Vtbl Direct3DVertexBuffer9_Vtbl;
630
631 /*****************************************************************************
632  * IDirect3DVertexBuffer9 implementation structure
633  */
634 struct IDirect3DVertexBuffer9Impl
635 {
636     /* IUnknown fields */
637     IDirect3DVertexBuffer9Vtbl *lpVtbl;
638     DWORD                   ref;
639
640     /* IDirect3DResource9 fields */
641     IWineD3DVertexBuffer   *wineD3DVertexBuffer;
642     IDirect3DDevice9Impl   *device;
643 };
644
645 /* IUnknown: */
646 extern HRESULT WINAPI         IDirect3DVertexBuffer9Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER9 iface,REFIID refiid,LPVOID *obj);
647 extern ULONG WINAPI           IDirect3DVertexBuffer9Impl_AddRef(LPDIRECT3DVERTEXBUFFER9 iface);
648 extern ULONG WINAPI           IDirect3DVertexBuffer9Impl_Release(LPDIRECT3DVERTEXBUFFER9 iface);
649
650 /* IDirect3DVertexBuffer9: (Inherited from IDirect3DResource9) */
651 extern HRESULT  WINAPI        IDirect3DVertexBuffer9Impl_GetDevice(LPDIRECT3DVERTEXBUFFER9 iface, IDirect3DDevice9** ppDevice);
652 extern HRESULT  WINAPI        IDirect3DVertexBuffer9Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
653 extern HRESULT  WINAPI        IDirect3DVertexBuffer9Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
654 extern HRESULT  WINAPI        IDirect3DVertexBuffer9Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER9 iface, REFGUID refguid);
655 extern DWORD    WINAPI        IDirect3DVertexBuffer9Impl_SetPriority(LPDIRECT3DVERTEXBUFFER9 iface, DWORD PriorityNew);
656 extern DWORD    WINAPI        IDirect3DVertexBuffer9Impl_GetPriority(LPDIRECT3DVERTEXBUFFER9 iface);
657 extern void     WINAPI        IDirect3DVertexBuffer9Impl_PreLoad(LPDIRECT3DVERTEXBUFFER9 iface);
658 extern D3DRESOURCETYPE WINAPI IDirect3DVertexBuffer9Impl_GetType(LPDIRECT3DVERTEXBUFFER9 iface);
659
660 /* IDirect3DVertexBuffer9: */
661 extern HRESULT  WINAPI        IDirect3DVertexBuffer9Impl_Lock(LPDIRECT3DVERTEXBUFFER9 iface, UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags);
662 extern HRESULT  WINAPI        IDirect3DVertexBuffer9Impl_Unlock(LPDIRECT3DVERTEXBUFFER9 iface);
663 extern HRESULT  WINAPI        IDirect3DVertexBuffer9Impl_GetDesc(LPDIRECT3DVERTEXBUFFER9 iface, D3DVERTEXBUFFER_DESC *pDesc);
664
665
666 /* --------------------- */
667 /* IDirect3DIndexBuffer9 */
668 /* --------------------- */
669
670 /*****************************************************************************
671  * Predeclare the interface implementation structures
672  */
673 extern IDirect3DIndexBuffer9Vtbl Direct3DIndexBuffer9_Vtbl;
674
675 /*****************************************************************************
676  * IDirect3DIndexBuffer9 implementation structure
677  */
678 struct IDirect3DIndexBuffer9Impl
679 {
680     /* IUnknown fields */
681     IDirect3DIndexBuffer9Vtbl *lpVtbl;
682     DWORD                   ref;
683
684     /* IDirect3DResource9 fields */
685     IDirect3DDevice9Impl   *Device;
686     D3DRESOURCETYPE         ResourceType;
687
688     /* IDirect3DIndexBuffer9 fields */
689     void                   *allocatedMemory;
690     D3DINDEXBUFFER_DESC     myDesc;
691 };
692
693 /* IUnknown: */
694 extern HRESULT WINAPI         IDirect3DIndexBuffer9Impl_QueryInterface(LPDIRECT3DINDEXBUFFER9 iface,REFIID refiid,LPVOID *obj);
695 extern ULONG WINAPI           IDirect3DIndexBuffer9Impl_AddRef(LPDIRECT3DINDEXBUFFER9 iface);
696 extern ULONG WINAPI           IDirect3DIndexBuffer9Impl_Release(LPDIRECT3DINDEXBUFFER9 iface);
697
698 /* IDirect3DIndexBuffer9: (Inherited from IDirect3DResource9) */
699 extern HRESULT  WINAPI        IDirect3DIndexBuffer9Impl_GetDevice(LPDIRECT3DINDEXBUFFER9 iface, IDirect3DDevice9** ppDevice);
700 extern HRESULT  WINAPI        IDirect3DIndexBuffer9Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
701 extern HRESULT  WINAPI        IDirect3DIndexBuffer9Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
702 extern HRESULT  WINAPI        IDirect3DIndexBuffer9Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER9 iface, REFGUID refguid);
703 extern DWORD    WINAPI        IDirect3DIndexBuffer9Impl_SetPriority(LPDIRECT3DINDEXBUFFER9 iface, DWORD PriorityNew);
704 extern DWORD    WINAPI        IDirect3DIndexBuffer9Impl_GetPriority(LPDIRECT3DINDEXBUFFER9 iface);
705 extern void     WINAPI        IDirect3DIndexBuffer9Impl_PreLoad(LPDIRECT3DINDEXBUFFER9 iface);
706 extern D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer9Impl_GetType(LPDIRECT3DINDEXBUFFER9 iface);
707
708 /* IDirect3DIndexBuffer9: */
709 extern HRESULT  WINAPI        IDirect3DIndexBuffer9Impl_Lock(LPDIRECT3DINDEXBUFFER9 iface, UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags);
710 extern HRESULT  WINAPI        IDirect3DIndexBuffer9Impl_Unlock(LPDIRECT3DINDEXBUFFER9 iface);
711 extern HRESULT  WINAPI        IDirect3DIndexBuffer9Impl_GetDesc(LPDIRECT3DINDEXBUFFER9 iface, D3DINDEXBUFFER_DESC *pDesc);
712
713
714 /* --------------------- */
715 /* IDirect3DBaseTexture9 */
716 /* --------------------- */
717
718 /*****************************************************************************
719  * Predeclare the interface implementation structures
720  */
721 extern IDirect3DBaseTexture9Vtbl Direct3DBaseTexture9_Vtbl;
722
723 /*****************************************************************************
724  * IDirect3DBaseTexture9 implementation structure
725  */
726 struct IDirect3DBaseTexture9Impl
727 {
728     /* IUnknown fields */
729     IDirect3DBaseTexture9Vtbl *lpVtbl;
730     DWORD                   ref;
731
732     /* IDirect3DResource9 fields */
733     IDirect3DDevice9Impl   *Device;
734     D3DRESOURCETYPE         ResourceType;
735
736     /* IDirect3DBaseTexture9 fields */
737     BOOL                    Dirty;
738     D3DFORMAT               format;
739     UINT                    levels;
740 };
741
742 /* IUnknown: */
743 extern HRESULT WINAPI         IDirect3DBaseTexture9Impl_QueryInterface(LPDIRECT3DBASETEXTURE9 iface,REFIID refiid,LPVOID *obj);
744 extern ULONG WINAPI           IDirect3DBaseTexture9Impl_AddRef(LPDIRECT3DBASETEXTURE9 iface);
745 extern ULONG WINAPI           IDirect3DBaseTexture9Impl_Release(LPDIRECT3DBASETEXTURE9 iface);
746
747 /* IDirect3DBaseTexture9: (Inherited from IDirect3DResource9) */
748 extern HRESULT  WINAPI        IDirect3DBaseTexture9Impl_GetDevice(LPDIRECT3DBASETEXTURE9 iface, IDirect3DDevice9** ppDevice);
749 extern HRESULT  WINAPI        IDirect3DBaseTexture9Impl_SetPrivateData(LPDIRECT3DBASETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
750 extern HRESULT  WINAPI        IDirect3DBaseTexture9Impl_GetPrivateData(LPDIRECT3DBASETEXTURE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
751 extern HRESULT  WINAPI        IDirect3DBaseTexture9Impl_FreePrivateData(LPDIRECT3DBASETEXTURE9 iface, REFGUID refguid);
752 extern DWORD    WINAPI        IDirect3DBaseTexture9Impl_SetPriority(LPDIRECT3DBASETEXTURE9 iface, DWORD PriorityNew);
753 extern DWORD    WINAPI        IDirect3DBaseTexture9Impl_GetPriority(LPDIRECT3DBASETEXTURE9 iface);
754 extern void     WINAPI        IDirect3DBaseTexture9Impl_PreLoad(LPDIRECT3DBASETEXTURE9 iface);
755 extern D3DRESOURCETYPE WINAPI IDirect3DBaseTexture9Impl_GetType(LPDIRECT3DBASETEXTURE9 iface);
756
757 /* IDirect3DBaseTexture9: */
758 extern DWORD    WINAPI        IDirect3DBaseTexture9Impl_SetLOD(LPDIRECT3DBASETEXTURE9 iface, DWORD LODNew);
759 extern DWORD    WINAPI        IDirect3DBaseTexture9Impl_GetLOD(LPDIRECT3DBASETEXTURE9 iface);
760 extern DWORD    WINAPI        IDirect3DBaseTexture9Impl_GetLevelCount(LPDIRECT3DBASETEXTURE9 iface);
761 extern HRESULT  WINAPI        IDirect3DBaseTexture9Impl_SetAutoGenFilterType(LPDIRECT3DBASETEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType);
762 extern D3DTEXTUREFILTERTYPE WINAPI IDirect3DBaseTexture9Impl_GetAutoGenFilterType(LPDIRECT3DBASETEXTURE9 iface);
763 extern void     WINAPI        IDirect3DBaseTexture9Impl_GenerateMipSubLevels(LPDIRECT3DBASETEXTURE9 iface);
764
765
766 /* --------------------- */
767 /* IDirect3DCubeTexture9 */
768 /* --------------------- */
769
770 /*****************************************************************************
771  * Predeclare the interface implementation structures
772  */
773 extern IDirect3DCubeTexture9Vtbl Direct3DCubeTexture9_Vtbl;
774
775 /*****************************************************************************
776  * IDirect3DCubeTexture9 implementation structure
777  */
778 struct IDirect3DCubeTexture9Impl
779 {
780     /* IUnknown fields */
781     IDirect3DCubeTexture9Vtbl *lpVtbl;
782     DWORD                     ref;
783
784     /* IDirect3DResource9 fields */
785     IDirect3DDevice9Impl     *Device;
786     D3DRESOURCETYPE           ResourceType;
787
788     /* IDirect3DBaseTexture9 fields */
789     BOOL                      Dirty;
790     D3DFORMAT                 format;
791     UINT                      levels;
792
793     /* IDirect3DCubeTexture9 fields */
794     UINT                      edgeLength;
795     DWORD                     usage;
796     IDirect3DSurface9Impl    *surfaces[6][MAX_LEVELS];
797 };
798
799 /* IUnknown: */
800 extern HRESULT WINAPI         IDirect3DCubeTexture9Impl_QueryInterface(LPDIRECT3DCUBETEXTURE9 iface,REFIID refiid,LPVOID *obj);
801 extern ULONG WINAPI           IDirect3DCubeTexture9Impl_AddRef(LPDIRECT3DCUBETEXTURE9 iface);
802 extern ULONG WINAPI           IDirect3DCubeTexture9Impl_Release(LPDIRECT3DCUBETEXTURE9 iface);
803
804 /* IDirect3DCubeTexture9: (Inherited from IDirect3DResource9) */
805 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_GetDevice(LPDIRECT3DCUBETEXTURE9 iface, IDirect3DDevice9** ppDevice);
806 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
807 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
808 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE9 iface, REFGUID refguid);
809 extern DWORD    WINAPI        IDirect3DCubeTexture9Impl_SetPriority(LPDIRECT3DCUBETEXTURE9 iface, DWORD PriorityNew);
810 extern DWORD    WINAPI        IDirect3DCubeTexture9Impl_GetPriority(LPDIRECT3DCUBETEXTURE9 iface);
811 extern void     WINAPI        IDirect3DCubeTexture9Impl_PreLoad(LPDIRECT3DCUBETEXTURE9 iface);
812 extern D3DRESOURCETYPE WINAPI IDirect3DCubeTexture9Impl_GetType(LPDIRECT3DCUBETEXTURE9 iface);
813
814 /* IDirect3DCubeTexture9: (Inherited from IDirect3DBaseTexture9) */
815 extern DWORD    WINAPI        IDirect3DCubeTexture9Impl_SetLOD(LPDIRECT3DCUBETEXTURE9 iface, DWORD LODNew);
816 extern DWORD    WINAPI        IDirect3DCubeTexture9Impl_GetLOD(LPDIRECT3DCUBETEXTURE9 iface);
817 extern DWORD    WINAPI        IDirect3DCubeTexture9Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE9 iface);
818 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_SetAutoGenFilterType(LPDIRECT3DCUBETEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType);
819 extern D3DTEXTUREFILTERTYPE WINAPI IDirect3DCubeTexture9Impl_GetAutoGenFilterType(LPDIRECT3DCUBETEXTURE9 iface);
820 extern void     WINAPI        IDirect3DCubeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DCUBETEXTURE9 iface);
821
822 /* IDirect3DCubeTexture9 */
823 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE9 iface, UINT Level, D3DSURFACE_DESC* pDesc);
824 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9** ppCubeMapSurface);
825 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_LockRect(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
826 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_UnlockRect(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, UINT Level);
827 extern HRESULT  WINAPI        IDirect3DCubeTexture9Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect);
828
829
830 /* ----------------- */
831 /* IDirect3DTexture9 */
832 /* ----------------- */
833
834 /*****************************************************************************
835  * Predeclare the interface implementation structures
836  */
837 extern IDirect3DTexture9Vtbl Direct3DTexture9_Vtbl;
838
839 /*****************************************************************************
840  * IDirect3DTexture9 implementation structure
841  */
842 struct IDirect3DTexture9Impl
843 {
844     /* IUnknown fields */
845     IDirect3DTexture9Vtbl  *lpVtbl;
846     DWORD                   ref;
847
848     /* IDirect3DResource9 fields */
849     IDirect3DDevice9Impl   *Device;
850     D3DRESOURCETYPE         ResourceType;
851
852     /* IDirect3DBaseTexture9 fields */
853     BOOL                    Dirty;
854     D3DFORMAT               format;
855     UINT                    levels;
856
857     /* IDirect3DTexture9 fields */
858     UINT                    width;
859     UINT                    height;
860     DWORD                   usage;
861     IDirect3DSurface9Impl  *surfaces[MAX_LEVELS];
862 };
863
864 /* IUnknown: */
865 extern HRESULT WINAPI         IDirect3DTexture9Impl_QueryInterface(LPDIRECT3DTEXTURE9 iface,REFIID refiid,LPVOID *obj);
866 extern ULONG WINAPI           IDirect3DTexture9Impl_AddRef(LPDIRECT3DTEXTURE9 iface);
867 extern ULONG WINAPI           IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface);
868
869 /* IDirect3DTexture9: (Inherited from IDirect3DResource9) */
870 extern HRESULT  WINAPI        IDirect3DTexture9Impl_GetDevice(LPDIRECT3DTEXTURE9 iface, IDirect3DDevice9** ppDevice);
871 extern HRESULT  WINAPI        IDirect3DTexture9Impl_SetPrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
872 extern HRESULT  WINAPI        IDirect3DTexture9Impl_GetPrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
873 extern HRESULT  WINAPI        IDirect3DTexture9Impl_FreePrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid);
874 extern DWORD    WINAPI        IDirect3DTexture9Impl_SetPriority(LPDIRECT3DTEXTURE9 iface, DWORD PriorityNew);
875 extern DWORD    WINAPI        IDirect3DTexture9Impl_GetPriority(LPDIRECT3DTEXTURE9 iface);
876 extern void     WINAPI        IDirect3DTexture9Impl_PreLoad(LPDIRECT3DTEXTURE9 iface);
877 extern D3DRESOURCETYPE WINAPI IDirect3DTexture9Impl_GetType(LPDIRECT3DTEXTURE9 iface);
878
879 /* IDirect3DTexture9: (Inherited from IDirect3DBaseTexture9) */
880 extern DWORD    WINAPI        IDirect3DTexture9Impl_SetLOD(LPDIRECT3DTEXTURE9 iface, DWORD LODNew);
881 extern DWORD    WINAPI        IDirect3DTexture9Impl_GetLOD(LPDIRECT3DTEXTURE9 iface);
882 extern DWORD    WINAPI        IDirect3DTexture9Impl_GetLevelCount(LPDIRECT3DTEXTURE9 iface);
883 extern HRESULT  WINAPI        IDirect3DTexture9Impl_SetAutoGenFilterType(LPDIRECT3DTEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType);
884 extern D3DTEXTUREFILTERTYPE WINAPI IDirect3DTexture9Impl_GetAutoGenFilterType(LPDIRECT3DTEXTURE9 iface);
885 extern void     WINAPI         IDirect3DTexture9Impl_GenerateMipSubLevels(LPDIRECT3DTEXTURE9 iface);
886
887 /* IDirect3DTexture9: */
888 extern HRESULT  WINAPI        IDirect3DTexture9Impl_GetLevelDesc(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DSURFACE_DESC* pDesc);
889 extern HRESULT  WINAPI        IDirect3DTexture9Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE9 iface, UINT Level, IDirect3DSurface9** ppSurfaceLevel);
890 extern HRESULT  WINAPI        IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
891 extern HRESULT  WINAPI        IDirect3DTexture9Impl_UnlockRect(LPDIRECT3DTEXTURE9 iface, UINT Level);
892 extern HRESULT  WINAPI        IDirect3DTexture9Impl_AddDirtyRect(LPDIRECT3DTEXTURE9 iface, CONST RECT* pDirtyRect);
893
894
895 /* ----------------------- */
896 /* IDirect3DVolumeTexture9 */
897 /* ----------------------- */
898
899 /*****************************************************************************
900  * Predeclare the interface implementation structures
901  */
902 extern IDirect3DVolumeTexture9Vtbl Direct3DVolumeTexture9_Vtbl;
903
904 /*****************************************************************************
905  * IDirect3DVolumeTexture9 implementation structure
906  */
907 struct IDirect3DVolumeTexture9Impl
908 {
909     /* IUnknown fields */
910     IDirect3DVolumeTexture9Vtbl *lpVtbl;
911     DWORD                       ref;
912
913     /* IDirect3DResource9 fields */
914     IDirect3DDevice9Impl   *Device;
915     D3DRESOURCETYPE         ResourceType;
916
917     /* IDirect3DBaseTexture9 fields */
918     BOOL                    Dirty;
919     D3DFORMAT               format;
920     UINT                    levels;
921
922     /* IDirect3DVolumeTexture9 fields */
923     UINT                    width;
924     UINT                    height;
925     UINT                    depth;
926     DWORD                   usage;
927     IDirect3DVolume9Impl   *volumes[MAX_LEVELS];
928 };
929
930 /* IUnknown: */
931 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE9 iface,REFIID refiid,LPVOID *obj);
932 extern ULONG    WINAPI        IDirect3DVolumeTexture9Impl_AddRef(LPDIRECT3DVOLUMETEXTURE9 iface);
933 extern ULONG    WINAPI        IDirect3DVolumeTexture9Impl_Release(LPDIRECT3DVOLUMETEXTURE9 iface);
934
935 /* IDirect3DVolumeTexture9: (Inherited from IDirect3DResource9) */
936 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE9 iface, IDirect3DDevice9** ppDevice);
937 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
938 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
939 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE9 iface, REFGUID refguid);
940 extern DWORD    WINAPI        IDirect3DVolumeTexture9Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE9 iface, DWORD PriorityNew);
941 extern DWORD    WINAPI        IDirect3DVolumeTexture9Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE9 iface);
942 extern void     WINAPI        IDirect3DVolumeTexture9Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE9 iface);
943 extern D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture9Impl_GetType(LPDIRECT3DVOLUMETEXTURE9 iface);
944
945 /* IDirect3DVolumeTexture9: (Inherited from IDirect3DBaseTexture9) */
946 extern DWORD    WINAPI        IDirect3DVolumeTexture9Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE9 iface, DWORD LODNew);
947 extern DWORD    WINAPI        IDirect3DVolumeTexture9Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE9 iface);
948 extern DWORD    WINAPI        IDirect3DVolumeTexture9Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE9 iface);
949 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_SetAutoGenFilterType(LPDIRECT3DVOLUMETEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType);
950 extern D3DTEXTUREFILTERTYPE WINAPI IDirect3DVolumeTexture9Impl_GetAutoGenFilterType(LPDIRECT3DVOLUMETEXTURE9 iface);
951 extern void     WINAPI         IDirect3DVolumeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DVOLUMETEXTURE9 iface);
952
953 /* IDirect3DVolumeTexture9: */
954 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, D3DVOLUME_DESC *pDesc);
955 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, IDirect3DVolume9** ppVolumeLevel);
956 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_LockBox(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
957 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level);
958 extern HRESULT  WINAPI        IDirect3DVolumeTexture9Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE9 iface, CONST D3DBOX* pDirtyBox);
959
960
961 /* ----------------------- */
962 /* IDirect3DStateBlock9 */
963 /* ----------------------- */
964
965 /*****************************************************************************
966  * Predeclare the interface implementation structures
967  */
968 extern IDirect3DStateBlock9Vtbl Direct3DStateBlock9_Vtbl;
969
970 /*****************************************************************************
971  * IDirect3DStateBlock9 implementation structure
972  */
973 struct  IDirect3DStateBlock9Impl {
974   /* IUnknown fields */
975   IDirect3DStateBlock9Vtbl *lpVtbl;
976   DWORD                     ref;
977
978   /* IDirect3DStateBlock9 fields */
979   IDirect3DDevice9Impl*     Device;
980
981   D3DSTATEBLOCKTYPE         blockType;
982
983   SAVEDSTATES               Changed;
984   SAVEDSTATES               Set;
985   
986   /* Light Enable */
987   BOOL                      lightEnable[MAX_ACTIVE_LIGHTS];
988   
989   /* ClipPlane */
990   double                    clipplane[MAX_CLIPPLANES][4];
991   
992   /* Stream Source */
993   UINT                      stream_stride[MAX_STREAMS];
994   IDirect3DVertexBuffer9*   stream_source[MAX_STREAMS];
995   BOOL                      streamIsUP;
996
997   /* Indices */
998   IDirect3DIndexBuffer9*    pIndexData;
999   UINT                      baseVertexIndex;
1000   
1001   /* Texture */
1002   IDirect3DBaseTexture9*    textures[8];
1003   int                       textureDimensions[8];
1004   /* Texture State Stage */
1005   DWORD                     texture_state[8][HIGHEST_TEXTURE_STATE];
1006   
1007   /* RenderState */
1008   DWORD                     renderstate[HIGHEST_RENDER_STATE];
1009   
1010   /* Transform */
1011   D3DMATRIX                 transforms[HIGHEST_TRANSFORMSTATE];
1012   
1013
1014   /* ViewPort */
1015   D3DVIEWPORT9              viewport;
1016   
1017   /* Lights */
1018   D3DLIGHT9                 lights[MAX_ACTIVE_LIGHTS];
1019   
1020   /* Material */
1021   D3DMATERIAL9              material;
1022
1023   DWORD                     FVF;
1024   
1025   /* Vertex Shader */
1026   IDirect3DVertexShader9*   VertexShader;
1027
1028   /* Vertex Shader Declaration */
1029   IDirect3DVertexDeclaration9Impl* vertexDecl;
1030   
1031   /* Pixel Shader */
1032   IDirect3DPixelShader9*    PixelShader;
1033   
1034   /* Indexed Vertex Blending */
1035   D3DVERTEXBLENDFLAGS       vertex_blend;
1036   FLOAT                     tween_factor;
1037
1038   /* Vertex Shader Constant */
1039   D3DSHADERVECTORF          vertexShaderConstantF[D3D_VSHADER_MAX_CONSTANTS];
1040   D3DSHADERVECTORI          vertexShaderConstantI[D3D_VSHADER_MAX_CONSTANTS];
1041   BOOL                      vertexShaderConstantB[D3D_VSHADER_MAX_CONSTANTS];
1042   /* Pixel Shader Constant */
1043   D3DSHADERVECTORF          pixelShaderConstantF[D3D_PSHADER_MAX_CONSTANTS];
1044   D3DSHADERVECTORI          pixelShaderConstantI[D3D_PSHADER_MAX_CONSTANTS];
1045   BOOL                      pixelShaderConstantB[D3D_PSHADER_MAX_CONSTANTS];
1046 };
1047
1048 /* IUnknown: */
1049 extern HRESULT WINAPI         IDirect3DStateBlock9Impl_QueryInterface(LPDIRECT3DSTATEBLOCK9 iface, REFIID refiid, LPVOID* obj);
1050 extern ULONG WINAPI           IDirect3DStateBlock9Impl_AddRef(LPDIRECT3DSTATEBLOCK9 iface);
1051 extern ULONG WINAPI           IDirect3DStateBlock9Impl_Release(LPDIRECT3DSTATEBLOCK9 iface);
1052
1053 /* IDirect3DStateBlock9: */
1054 extern HRESULT WINAPI         IDirect3DStateBlock9Impl_GetDevice(LPDIRECT3DSTATEBLOCK9 iface, IDirect3DDevice9** ppDevice);
1055 extern HRESULT WINAPI         IDirect3DStateBlock9Impl_Capture(LPDIRECT3DSTATEBLOCK9 iface);
1056 extern HRESULT WINAPI         IDirect3DStateBlock9Impl_Apply(LPDIRECT3DSTATEBLOCK9 iface);
1057
1058
1059 /* --------------------------- */
1060 /* IDirect3DVertexDeclaration9 */
1061 /* --------------------------- */
1062
1063 /*****************************************************************************
1064  * Predeclare the interface implementation structures
1065  */
1066 extern IDirect3DVertexDeclaration9Vtbl Direct3DVertexDeclaration9_Vtbl;
1067
1068 /*****************************************************************************
1069  * IDirect3DVertexShaderDeclaration implementation structure
1070  */
1071 struct IDirect3DVertexDeclaration9Impl {
1072   /* IUnknown fields */
1073   IDirect3DVertexDeclaration9Vtbl *lpVtbl;
1074   DWORD   ref;
1075
1076   /* IDirect3DVertexDeclaration9 fields */
1077   IDirect3DDevice9Impl* Device;
1078
1079   /** precomputed fvf if simple declaration */
1080   DWORD   fvf[MAX_STREAMS];
1081   DWORD   allFVF;
1082
1083   /** dx8 compatible Declaration fields */
1084   DWORD*  pDeclaration8;
1085   DWORD   declaration8Length;
1086 };
1087
1088 /* IUnknown: */
1089 extern HRESULT  WINAPI      IDirect3DVertexDeclaration9Impl_QueryInterface(LPDIRECT3DVERTEXDECLARATION9 iface, REFIID refiid, LPVOID* obj);
1090 extern ULONG    WINAPI      IDirect3DVertexDeclaration9Impl_AddRef(LPDIRECT3DVERTEXDECLARATION9 iface);
1091 extern ULONG    WINAPI      IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECLARATION9 iface);
1092
1093 /* IDirect3DVertexDeclaration9: */
1094 extern HRESULT  WINAPI      IDirect3DVertexDeclaration9Impl_GetDevice(LPDIRECT3DVERTEXDECLARATION9 iface, IDirect3DDevice9** ppDevice);
1095 extern HRESULT  WINAPI      IDirect3DVertexDeclaration9Impl_GetDeclaration(LPDIRECT3DVERTEXDECLARATION9 iface, D3DVERTEXELEMENT9* pDecl, UINT* pNumElements);
1096
1097
1098 /* ---------------------- */
1099 /* IDirect3DVertexShader9 */
1100 /* ---------------------- */
1101
1102 /*****************************************************************************
1103  * Predeclare the interface implementation structures
1104  */
1105 extern IDirect3DVertexShader9Vtbl Direct3DVertexShader9_Vtbl;
1106
1107 /*****************************************************************************
1108  * IDirect3DVertexShader implementation structure
1109  */
1110 struct IDirect3DVertexShader9Impl {
1111   /* IUnknown fields */
1112   IDirect3DVertexShader9Vtbl *lpVtbl;
1113   DWORD ref;
1114
1115   /* IDirect3DVertexDeclaration9 fields */
1116   IDirect3DDevice9Impl* Device;
1117
1118   DWORD* function;
1119   UINT functionLength;
1120   DWORD usage; /* 0 || D3DUSAGE_SOFTWAREPROCESSING */
1121   DWORD version;
1122   /* run time datas */
1123   /*
1124   VSHADERDATA* data;
1125   VSHADERINPUTDATA input;
1126   VSHADEROUTPUTDATA output;
1127   */
1128 };
1129
1130 /* IUnknown: */
1131 extern HRESULT WINAPI         IDirect3DVertexShader9Impl_QueryInterface(LPDIRECT3DVERTEXSHADER9 iface, REFIID refiid, LPVOID* obj);
1132 extern ULONG WINAPI           IDirect3DVertexShader9Impl_AddRef(LPDIRECT3DVERTEXSHADER9 iface);
1133 extern ULONG WINAPI           IDirect3DVertexShader9Impl_Release(LPDIRECT3DVERTEXSHADER9 iface);
1134
1135 /* IDirect3DVertexShader9: */
1136 extern HRESULT WINAPI         IDirect3DVertexShader9Impl_GetDevice(LPDIRECT3DVERTEXSHADER9 iface, IDirect3DDevice9** ppDevice);
1137 extern HRESULT WINAPI         IDirect3DVertexShader9Impl_GetFunction(LPDIRECT3DVERTEXSHADER9 iface, VOID* pData, UINT* pSizeOfData);
1138
1139
1140 /* --------------------- */
1141 /* IDirect3DPixelShader9 */
1142 /* --------------------- */
1143
1144 /*****************************************************************************
1145  * Predeclare the interface implementation structures
1146  */
1147 extern IDirect3DPixelShader9Vtbl Direct3DPixelShader9_Vtbl;
1148
1149 /*****************************************************************************
1150  * IDirect3DPixelShader implementation structure
1151  */
1152 struct IDirect3DPixelShader9Impl { 
1153   /* IUnknown fields */
1154   IDirect3DPixelShader9Vtbl *lpVtbl;
1155   DWORD ref;
1156
1157   /* IDirect3DPixelShader9 fields */
1158   IDirect3DDevice9Impl* Device;
1159
1160   DWORD* function;
1161   UINT functionLength;
1162   DWORD version;
1163   /* run time datas */
1164   /*
1165   PSHADERDATA* data;
1166   PSHADERINPUTDATA input;
1167   PSHADEROUTPUTDATA output;
1168   */
1169 };
1170
1171 /* IUnknown: */
1172 extern HRESULT WINAPI         IDirect3DPixelShader9Impl_QueryInterface(LPDIRECT3DPIXELSHADER9 iface, REFIID refiid, LPVOID* obj);
1173 extern ULONG WINAPI           IDirect3DPixelShader9Impl_AddRef(LPDIRECT3DPIXELSHADER9 iface);
1174 extern ULONG WINAPI           IDirect3DPixelShader9Impl_Release(LPDIRECT3DPIXELSHADER9 iface);
1175
1176 /* IDirect3DPixelShader9: */
1177 extern HRESULT WINAPI         IDirect3DPixelShader9Impl_GetDevice(LPDIRECT3DPIXELSHADER9 iface, IDirect3DDevice9** ppDevice);
1178 extern HRESULT WINAPI         IDirect3DPixelShader9Impl_GetFunction(LPDIRECT3DPIXELSHADER9 iface, VOID* pData, UINT* pSizeOfData);
1179
1180
1181 /* --------------- */
1182 /* IDirect3DQuery9 */
1183 /* --------------- */
1184
1185 /*****************************************************************************
1186  * Predeclare the interface implementation structures
1187  */
1188 extern IDirect3DQuery9Vtbl Direct3DQuery9_Vtbl;
1189
1190 /*****************************************************************************
1191  * IDirect3DPixelShader implementation structure
1192  */
1193 struct IDirect3DQuery9Impl { 
1194     /* IUnknown fields */
1195     IDirect3DQuery9Vtbl *lpVtbl;
1196     DWORD ref;
1197
1198     /* IDirect3DQuery9 fields */  
1199     IDirect3DDevice9Impl* Device;
1200 };
1201
1202 /* IUnknown: */
1203 extern HRESULT  WINAPI     IDirect3DQuery9Impl_QueryInterface(LPDIRECT3DQUERY9 iface, REFIID riid, LPVOID* ppobj);
1204 extern ULONG    WINAPI     IDirect3DQuery9Impl_AddRef(LPDIRECT3DQUERY9 iface);
1205 extern ULONG    WINAPI     IDirect3DQuery9Impl_Release(LPDIRECT3DQUERY9 iface);
1206
1207 /* IDirect3DQuery9: */
1208 extern HRESULT  WINAPI     IDirect3DQuery9Impl_GetDevice(LPDIRECT3DQUERY9 iface, IDirect3DDevice9** ppDevice);
1209 extern D3DQUERYTYPE WINAPI IDirect3DQuery9Impl_GetType(LPDIRECT3DQUERY9 iface);
1210 extern DWORD    WINAPI     IDirect3DQuery9Impl_GetDataSize(LPDIRECT3DQUERY9 iface);
1211 extern HRESULT  WINAPI     IDirect3DQuery9Impl_Issue(LPDIRECT3DQUERY9 iface, DWORD dwIssueFlags);
1212 extern HRESULT  WINAPI     IDirect3DQuery9Impl_GetData(LPDIRECT3DQUERY9 iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags);
1213
1214
1215 #endif /* __WINE_D3D9_PRIVATE_H */