quartz: Exclude unused headers.
[wine] / dlls / d3d8 / d3d8_private.h
1 /*
2  * Direct3D 8 private include file
3  *
4  * Copyright 2002-2004 Jason Edmeades
5  * Copyright 2003-2004 Raphael Junqueira
6  * Copyright 2004 Christian Costa
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22
23 #ifndef __WINE_D3D8_PRIVATE_H
24 #define __WINE_D3D8_PRIVATE_H
25
26 #include <stdarg.h>
27
28 #define NONAMELESSUNION
29 #define NONAMELESSSTRUCT
30 #define COBJMACROS
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "wine/debug.h"
35 #include "d3d8.h"
36 #include "wine/wined3d_interface.h"
37
38 /* Device caps */
39 #define INITIAL_SHADER_HANDLE_TABLE_SIZE        64
40
41 /* CreateVertexShader can return > 0xFFFF */
42 #define VS_HIGHESTFIXEDFXF 0xF0000000
43
44 /* ===========================================================================
45     Macros
46    =========================================================================== */
47 /* Not nice, but it lets wined3d support different versions of directx */
48 #define D3D8CAPSTOWINECAPS(_pD3D8Caps, _pWineCaps) \
49     _pWineCaps->DeviceType                        = (WINED3DDEVTYPE *) &_pD3D8Caps->DeviceType; \
50     _pWineCaps->AdapterOrdinal                    = &_pD3D8Caps->AdapterOrdinal; \
51     _pWineCaps->Caps                              = &_pD3D8Caps->Caps; \
52     _pWineCaps->Caps2                             = &_pD3D8Caps->Caps2; \
53     _pWineCaps->Caps3                             = &_pD3D8Caps->Caps3; \
54     _pWineCaps->PresentationIntervals             = &_pD3D8Caps->PresentationIntervals; \
55     _pWineCaps->CursorCaps                        = &_pD3D8Caps->CursorCaps; \
56     _pWineCaps->DevCaps                           = &_pD3D8Caps->DevCaps; \
57     _pWineCaps->PrimitiveMiscCaps                 = &_pD3D8Caps->PrimitiveMiscCaps; \
58     _pWineCaps->RasterCaps                        = &_pD3D8Caps->RasterCaps; \
59     _pWineCaps->ZCmpCaps                          = &_pD3D8Caps->ZCmpCaps; \
60     _pWineCaps->SrcBlendCaps                      = &_pD3D8Caps->SrcBlendCaps; \
61     _pWineCaps->DestBlendCaps                     = &_pD3D8Caps->DestBlendCaps; \
62     _pWineCaps->AlphaCmpCaps                      = &_pD3D8Caps->AlphaCmpCaps; \
63     _pWineCaps->ShadeCaps                         = &_pD3D8Caps->ShadeCaps; \
64     _pWineCaps->TextureCaps                       = &_pD3D8Caps->TextureCaps; \
65     _pWineCaps->TextureFilterCaps                 = &_pD3D8Caps->TextureFilterCaps; \
66     _pWineCaps->CubeTextureFilterCaps             = &_pD3D8Caps->CubeTextureFilterCaps; \
67     _pWineCaps->VolumeTextureFilterCaps           = &_pD3D8Caps->VolumeTextureFilterCaps; \
68     _pWineCaps->TextureAddressCaps                = &_pD3D8Caps->TextureAddressCaps; \
69     _pWineCaps->VolumeTextureAddressCaps          = &_pD3D8Caps->VolumeTextureAddressCaps; \
70     _pWineCaps->LineCaps                          = &_pD3D8Caps->LineCaps; \
71     _pWineCaps->MaxTextureWidth                   = &_pD3D8Caps->MaxTextureWidth; \
72     _pWineCaps->MaxTextureHeight                  = &_pD3D8Caps->MaxTextureHeight; \
73     _pWineCaps->MaxVolumeExtent                   = &_pD3D8Caps->MaxVolumeExtent; \
74     _pWineCaps->MaxTextureRepeat                  = &_pD3D8Caps->MaxTextureRepeat; \
75     _pWineCaps->MaxTextureAspectRatio             = &_pD3D8Caps->MaxTextureAspectRatio; \
76     _pWineCaps->MaxAnisotropy                     = &_pD3D8Caps->MaxAnisotropy; \
77     _pWineCaps->MaxVertexW                        = &_pD3D8Caps->MaxVertexW; \
78     _pWineCaps->GuardBandLeft                     = &_pD3D8Caps->GuardBandLeft; \
79     _pWineCaps->GuardBandTop                      = &_pD3D8Caps->GuardBandTop; \
80     _pWineCaps->GuardBandRight                    = &_pD3D8Caps->GuardBandRight; \
81     _pWineCaps->GuardBandBottom                   = &_pD3D8Caps->GuardBandBottom; \
82     _pWineCaps->ExtentsAdjust                     = &_pD3D8Caps->ExtentsAdjust; \
83     _pWineCaps->StencilCaps                       = &_pD3D8Caps->StencilCaps; \
84     _pWineCaps->FVFCaps                           = &_pD3D8Caps->FVFCaps; \
85     _pWineCaps->TextureOpCaps                     = &_pD3D8Caps->TextureOpCaps; \
86     _pWineCaps->MaxTextureBlendStages             = &_pD3D8Caps->MaxTextureBlendStages; \
87     _pWineCaps->MaxSimultaneousTextures           = &_pD3D8Caps->MaxSimultaneousTextures; \
88     _pWineCaps->VertexProcessingCaps              = &_pD3D8Caps->VertexProcessingCaps; \
89     _pWineCaps->MaxActiveLights                   = &_pD3D8Caps->MaxActiveLights; \
90     _pWineCaps->MaxUserClipPlanes                 = &_pD3D8Caps->MaxUserClipPlanes; \
91     _pWineCaps->MaxVertexBlendMatrices            = &_pD3D8Caps->MaxVertexBlendMatrices; \
92     _pWineCaps->MaxVertexBlendMatrixIndex         = &_pD3D8Caps->MaxVertexBlendMatrixIndex; \
93     _pWineCaps->MaxPointSize                      = &_pD3D8Caps->MaxPointSize; \
94     _pWineCaps->MaxPrimitiveCount                 = &_pD3D8Caps->MaxPrimitiveCount; \
95     _pWineCaps->MaxVertexIndex                    = &_pD3D8Caps->MaxVertexIndex; \
96     _pWineCaps->MaxStreams                        = &_pD3D8Caps->MaxStreams; \
97     _pWineCaps->MaxStreamStride                   = &_pD3D8Caps->MaxStreamStride; \
98     _pWineCaps->VertexShaderVersion               = &_pD3D8Caps->VertexShaderVersion; \
99     _pWineCaps->MaxVertexShaderConst              = &_pD3D8Caps->MaxVertexShaderConst; \
100     _pWineCaps->PixelShaderVersion                = &_pD3D8Caps->PixelShaderVersion; \
101     _pWineCaps->PixelShader1xMaxValue             = &_pD3D8Caps->MaxPixelShaderValue;
102
103 /* Direct3D8 Interfaces: */
104 typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
105 typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
106 typedef struct IDirect3D8Impl IDirect3D8Impl;
107 typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
108 typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
109 typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
110 typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
111 typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
112 typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
113 typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
114 typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
115 typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
116
117 /** Private Interfaces: */
118 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
119 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
120 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
121 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
122
123 /* Advance declaration of structures to satisfy compiler */
124 typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
125
126 /* ===========================================================================
127     The interfactes themselves
128    =========================================================================== */
129
130 /* ---------- */
131 /* IDirect3D8 */
132 /* ---------- */
133
134 /*****************************************************************************
135  * Predeclare the interface implementation structures
136  */
137 extern const IDirect3D8Vtbl Direct3D8_Vtbl;
138
139 /*****************************************************************************
140  * IDirect3D implementation structure
141  */
142 struct IDirect3D8Impl
143 {
144     /* IUnknown fields */
145     const IDirect3D8Vtbl   *lpVtbl;
146     LONG                    ref;
147
148     /* The WineD3D device */
149     IWineD3D               *WineD3D;
150 };
151
152 /* ---------------- */
153 /* IDirect3DDevice8 */
154 /* ---------------- */
155
156 /*****************************************************************************
157  * Predeclare the interface implementation structures
158  */
159 extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl;
160
161 /*****************************************************************************
162  * IDirect3DDevice8 implementation structure
163  */
164
165 typedef void * shader_handle;
166
167 struct IDirect3DDevice8Impl
168 {
169     /* IUnknown fields */
170     const IDirect3DDevice8Vtbl   *lpVtbl;
171     LONG                         ref;
172 /* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
173     IWineD3DDevice               *WineD3DDevice;
174     DWORD                         shader_handle_table_size;
175     DWORD                         allocated_shader_handles;
176     shader_handle                *shader_handles;
177     shader_handle                *free_shader_handles;
178
179     /* Avoids recursion with nested ReleaseRef to 0 */
180     BOOL                          inDestruction;
181 };
182
183 /* ---------------- */
184 /* IDirect3DVolume8 */
185 /* ---------------- */
186
187 /*****************************************************************************
188  * IDirect3DVolume8 implementation structure
189  */
190 struct IDirect3DVolume8Impl
191 {
192     /* IUnknown fields */
193     const IDirect3DVolume8Vtbl *lpVtbl;
194     LONG                        ref;
195
196     /* IDirect3DVolume8 fields */
197     IWineD3DVolume             *wineD3DVolume;
198
199     /* The volume container */
200     IUnknown                    *container;
201
202     /* If set forward refcounting to this object */
203     IUnknown                    *forwardReference;
204 };
205
206 /* ------------------- */
207 /* IDirect3DSwapChain8 */
208 /* ------------------- */
209
210 /*****************************************************************************
211  * Predeclare the interface implementation structures
212  */
213 extern const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl;
214
215 /*****************************************************************************
216  * IDirect3DSwapChain8 implementation structure
217  */
218 struct IDirect3DSwapChain8Impl
219 {
220     /* IUnknown fields */
221     const IDirect3DSwapChain8Vtbl *lpVtbl;
222     LONG                           ref;
223
224     /* IDirect3DSwapChain8 fields */
225     IWineD3DSwapChain             *wineD3DSwapChain;
226
227     /* Parent reference */
228     LPDIRECT3DDEVICE8              parentDevice;
229 };
230
231 /* ----------------- */
232 /* IDirect3DSurface8 */
233 /* ----------------- */
234
235 /*****************************************************************************
236  * Predeclare the interface implementation structures
237  */
238 extern const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl;
239
240 /*****************************************************************************
241  * IDirect3DSurface8 implementation structure
242  */
243 struct IDirect3DSurface8Impl
244 {
245     /* IUnknown fields */
246     const IDirect3DSurface8Vtbl *lpVtbl;
247     LONG                         ref;
248
249     /* IDirect3DSurface8 fields */
250     IWineD3DSurface             *wineD3DSurface;
251
252     /* Parent reference */
253     LPDIRECT3DDEVICE8                  parentDevice;
254
255     /* The surface container */
256     IUnknown                    *container;
257
258     /* If set forward refcounting to this object */
259     IUnknown                    *forwardReference;
260
261     /* Flags an implicit surface */
262     BOOL                        isImplicit;
263 };
264
265 /* ------------------ */
266 /* IDirect3DResource8 */
267 /* ------------------ */
268
269 /*****************************************************************************
270  * Predeclare the interface implementation structures
271  */
272 extern const IDirect3DResource8Vtbl Direct3DResource8_Vtbl;
273
274 /*****************************************************************************
275  * IDirect3DResource8 implementation structure
276  */
277 struct IDirect3DResource8Impl
278 {
279     /* IUnknown fields */
280     const IDirect3DResource8Vtbl *lpVtbl;
281     LONG                          ref;
282
283     /* IDirect3DResource8 fields */
284     IWineD3DResource             *wineD3DResource;
285 };
286 extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
287
288 /* ---------------------- */
289 /* IDirect3DVertexBuffer8 */
290 /* ---------------------- */
291
292 /*****************************************************************************
293  * Predeclare the interface implementation structures
294  */
295 extern const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl;
296
297 /*****************************************************************************
298  * IDirect3DVertexBuffer8 implementation structure
299  */
300 struct IDirect3DVertexBuffer8Impl
301 {
302     /* IUnknown fields */
303     const IDirect3DVertexBuffer8Vtbl *lpVtbl;
304     LONG                              ref;
305
306     /* IDirect3DResource8 fields */
307     IWineD3DVertexBuffer             *wineD3DVertexBuffer;
308
309     /* Parent reference */
310     LPDIRECT3DDEVICE8                 parentDevice;
311 };
312
313 /* --------------------- */
314 /* IDirect3DIndexBuffer8 */
315 /* --------------------- */
316
317 /*****************************************************************************
318  * Predeclare the interface implementation structures
319  */
320 extern const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl;
321
322 /*****************************************************************************
323  * IDirect3DIndexBuffer8 implementation structure
324  */
325 struct IDirect3DIndexBuffer8Impl
326 {
327     /* IUnknown fields */
328     const IDirect3DIndexBuffer8Vtbl *lpVtbl;
329     LONG                             ref;
330
331     /* IDirect3DResource8 fields */
332     IWineD3DIndexBuffer             *wineD3DIndexBuffer;
333
334     /* Parent reference */
335     LPDIRECT3DDEVICE8                parentDevice;
336 };
337
338 /* --------------------- */
339 /* IDirect3DBaseTexture8 */
340 /* --------------------- */
341
342 /*****************************************************************************
343  * IDirect3DBaseTexture8 implementation structure
344  */
345 struct IDirect3DBaseTexture8Impl
346 {
347     /* IUnknown fields */
348     const IDirect3DBaseTexture8Vtbl *lpVtbl;
349     LONG                   ref;
350
351     /* IDirect3DResource8 fields */
352     IWineD3DBaseTexture             *wineD3DBaseTexture;
353 };
354
355 /* --------------------- */
356 /* IDirect3DCubeTexture8 */
357 /* --------------------- */
358
359 /*****************************************************************************
360  * Predeclare the interface implementation structures
361  */
362 extern const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl;
363
364 /*****************************************************************************
365  * IDirect3DCubeTexture8 implementation structure
366  */
367 struct IDirect3DCubeTexture8Impl
368 {
369     /* IUnknown fields */
370     const IDirect3DCubeTexture8Vtbl *lpVtbl;
371     LONG                   ref;
372
373     /* IDirect3DResource8 fields */
374     IWineD3DCubeTexture             *wineD3DCubeTexture;
375
376     /* Parent reference */
377     LPDIRECT3DDEVICE8                parentDevice;
378 };
379
380 /* ----------------- */
381 /* IDirect3DTexture8 */
382 /* ----------------- */
383
384 /*****************************************************************************
385  * Predeclare the interface implementation structures
386  */
387 extern const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl;
388
389 /*****************************************************************************
390  * IDirect3DTexture8 implementation structure
391  */
392 struct IDirect3DTexture8Impl
393 {
394     /* IUnknown fields */
395     const IDirect3DTexture8Vtbl *lpVtbl;
396     LONG                   ref;
397
398     /* IDirect3DResourc8 fields */
399     IWineD3DTexture             *wineD3DTexture;
400
401     /* Parent reference */
402     LPDIRECT3DDEVICE8            parentDevice;
403 };
404
405 /* ----------------------- */
406 /* IDirect3DVolumeTexture8 */
407 /* ----------------------- */
408
409 /*****************************************************************************
410  * Predeclare the interface implementation structures
411  */
412 extern const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl;
413
414 /*****************************************************************************
415  * IDirect3DVolumeTexture8 implementation structure
416  */
417 struct IDirect3DVolumeTexture8Impl
418 {
419     /* IUnknown fields */
420     const IDirect3DVolumeTexture8Vtbl *lpVtbl;
421     LONG                   ref;
422
423     /* IDirect3DResource8 fields */
424     IWineD3DVolumeTexture             *wineD3DVolumeTexture;
425
426     /* Parent reference */
427     LPDIRECT3DDEVICE8                  parentDevice;
428 };
429
430 /* ----------------------- */
431 /* IDirect3DStateBlockImpl */
432 /* ----------------------- */
433
434 /* TODO: Generate a valid GUIDs */
435 /* {83B073CE-6F30-11d9-C687-00046142C14F} */
436 DEFINE_GUID(IID_IDirect3DStateBlock8, 
437 0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
438
439 DEFINE_GUID(IID_IDirect3DVertexDeclaration8,
440 0x5dd7478d, 0xcbf3, 0x41a6, 0x8c, 0xfd, 0xfd, 0x19, 0x2b, 0x11, 0xc7, 0x90);
441
442 DEFINE_GUID(IID_IDirect3DVertexShader8,
443 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
444
445 DEFINE_GUID(IID_IDirect3DPixelShader8,
446 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89);
447
448
449 /*****************************************************************************
450  * IDirect3DStateBlock8 interface
451  */
452 #define INTERFACE IDirect3DStateBlock8
453 DECLARE_INTERFACE_(IDirect3DStateBlock8, IUnknown)
454 {
455     /*** IUnknown methods ***/
456     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
457     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
458     STDMETHOD_(ULONG,Release)(THIS) PURE;
459     /*** IDirect3DStateBlock9 methods ***/
460     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
461     STDMETHOD(Capture)(THIS) PURE;
462     STDMETHOD(Apply)(THIS) PURE;
463 };
464 #undef INTERFACE
465
466 /*** IUnknown methods ***/
467 #define IDirect3DStateBlock8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
468 #define IDirect3DStateBlock8_AddRef(p)              (p)->lpVtbl->AddRef(p)
469 #define IDirect3DStateBlock8_Release(p)             (p)->lpVtbl->Release(p)
470 /*** IDirect3DStateBlock9 methods ***/
471 #define IDirect3DStateBlock8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
472 #define IDirect3DStateBlock8_Capture(p)             (p)->lpVtbl->Capture(p)
473 #define IDirect3DStateBlock8_Apply(p)               (p)->lpVtbl->Apply(p)
474
475 /*****************************************************************************
476  * Predeclare the interface implementation structures
477  */
478 extern const IDirect3DStateBlock8Vtbl Direct3DStateBlock8_Vtbl;
479
480 /*****************************************************************************
481  * IDirect3DStateBlock implementation structure
482  */
483 typedef struct  IDirect3DStateBlock8Impl {
484     /* IUnknown fields */
485     const IDirect3DStateBlock8Vtbl *lpVtbl;
486     LONG                   ref;
487
488     /* IDirect3DResource8 fields */
489     IWineD3DStateBlock             *wineD3DStateBlock;
490 } IDirect3DStateBlock8Impl;
491
492 /*****************************************************************************
493  * IDirect3DVertexDeclaration8 interface
494  */
495 #define INTERFACE IDirect3DVertexDeclaration8
496 DECLARE_INTERFACE_(IDirect3DVertexDeclaration8, IUnknown)
497 {
498     /*** IUnknown methods ***/
499     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** obj_ptr) PURE;
500     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
501     STDMETHOD_(ULONG,Release)(THIS) PURE;
502 };
503 #undef INTERFACE
504
505 /*** IUnknown methods ***/
506 #define IDirect3DVertexDeclaration8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
507 #define IDirect3DVertexDeclaration8_AddRef(p)              (p)->lpVtbl->AddRef(p)
508 #define IDirect3DVertexDeclaration8_Release(p)             (p)->lpVtbl->Release(p)
509
510 /*** Implementation ***/
511 extern const IDirect3DVertexDeclaration8Vtbl Direct3DVertexDeclaration8_Vtbl;
512
513 typedef struct {
514     const IDirect3DVertexDeclaration8Vtbl *lpVtbl;
515     LONG ref_count;
516
517     DWORD *elements;
518     DWORD elements_size; /* Size of elements, in bytes */
519
520     IWineD3DVertexDeclaration *wined3d_vertex_declaration;
521 } IDirect3DVertexDeclaration8Impl;
522
523
524 /*****************************************************************************
525  * IDirect3DVertexShader9 interface
526  */
527 #define INTERFACE IDirect3DVertexShader8
528 DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown)
529 {
530     /*** IUnknown methods ***/
531     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
532     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
533     STDMETHOD_(ULONG,Release)(THIS) PURE;
534     /*** IDirect3DVertexShader9 methods ***/
535     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
536     STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
537 };
538 #undef INTERFACE
539
540 /*** IUnknown methods ***/
541 #define IDirect3DVertexShader8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
542 #define IDirect3DVertexShader8_AddRef(p)              (p)->lpVtbl->AddRef(p)
543 #define IDirect3DVertexShader8_Release(p)             (p)->lpVtbl->Release(p)
544 /*** IDirect3DVertexShader8 methods ***/
545 #define IDirect3DVertexShader8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
546 #define IDirect3DVertexShader8_GetFunction(p,a,b)     (p)->lpVtbl->GetFunction(p,a,b)
547
548 /* ------------------------- */
549 /* IDirect3DVertexShader8Impl */
550 /* ------------------------- */
551
552 /*****************************************************************************
553  * IDirect3DPixelShader9 interface
554  */
555 #define INTERFACE IDirect3DPixelShader8
556 DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown)
557 {
558     /*** IUnknown methods ***/
559     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
560     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
561     STDMETHOD_(ULONG,Release)(THIS) PURE;
562     /*** IDirect3DPixelShader8 methods ***/
563     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
564     STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
565 };
566 #undef INTERFACE
567
568 /*** IUnknown methods ***/
569 #define IDirect3DPixelShader8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
570 #define IDirect3DPixelShader8_AddRef(p)              (p)->lpVtbl->AddRef(p)
571 #define IDirect3DPixelShader8_Release(p)             (p)->lpVtbl->Release(p)
572 /*** IDirect3DPixelShader8 methods ***/
573 #define IDirect3DPixelShader8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
574 #define IDirect3DPixelShader8_GetFunction(p,a,b)     (p)->lpVtbl->GetFunction(p,a,b)
575
576
577 /*****************************************************************************
578  * Predeclare the interface implementation structures
579  */
580 extern const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl;
581
582 /*****************************************************************************
583  * IDirect3DVertexShader implementation structure
584  */
585
586 struct IDirect3DVertexShader8Impl {
587   const IDirect3DVertexShader8Vtbl *lpVtbl;
588   LONG ref;
589
590   shader_handle                    *handle;
591   IDirect3DVertexDeclaration8      *vertex_declaration;
592   IWineD3DVertexShader             *wineD3DVertexShader;
593 };
594
595
596 /* ------------------------ */
597 /* IDirect3DPixelShaderImpl */
598 /* ------------------------ */
599
600
601 /*****************************************************************************
602  * Predeclare the interface implementation structures
603  */
604 extern const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl;
605
606 /*****************************************************************************
607  * IDirect3DPixelShader implementation structure
608  */
609 typedef struct IDirect3DPixelShader8Impl {
610     const IDirect3DPixelShader8Vtbl *lpVtbl;
611     LONG                             ref;
612
613     shader_handle                   *handle;
614     /* The device, to be replaced by an IDirect3DDeviceImpl */
615     IWineD3DPixelShader             *wineD3DPixelShader;
616 } IDirect3DPixelShader8Impl;
617
618 /**
619  * Internals functions
620  *
621  * to see how not defined it here
622  */
623 void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wined3d_vertex_shader);
624 size_t convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elements_size, WINED3DVERTEXELEMENT **wined3d_elements);
625
626 /* Callbacks */
627 extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
628                                          WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
629                                          WINED3DCUBEMAP_FACES Face, IWineD3DSurface** ppSurface,
630                                          HANDLE* pSharedHandle);
631
632 extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown  *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth,
633                                           WINED3DFORMAT  Format, WINED3DPOOL Pool, DWORD Usage,
634                                           IWineD3DVolume **ppVolume,
635                                           HANDLE   * pSharedHandle);
636
637 extern HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
638                                          WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
639                                          DWORD MultisampleQuality, BOOL Discard,
640                                          IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
641
642 extern HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
643                                          WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
644                                          DWORD MultisampleQuality, BOOL Lockable,
645                                          IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
646
647 extern ULONG WINAPI D3D8CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain);
648
649 extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
650
651 extern ULONG WINAPI D3D8CB_DestroyRenderTarget (IWineD3DSurface *pSurface);
652
653 extern ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface);
654
655 extern ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume);
656
657 #endif /* __WINE_D3DX8_PRIVATE_H */