d3d8: All objects created by device should keep reference to it.
[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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __WINE_D3D8_PRIVATE_H
24 #define __WINE_D3D8_PRIVATE_H
25
26 #ifndef __WINE_CONFIG_H
27 # error You must include config.h to use this header
28 #endif
29
30 #undef APIENTRY
31 #undef CALLBACK
32 #undef WINAPI
33
34 /* Redefines the constants */
35 #define CALLBACK    __stdcall
36 #define WINAPI      __stdcall
37 #define APIENTRY    WINAPI
38
39 #include <stdarg.h>
40
41 #define NONAMELESSUNION
42 #define NONAMELESSSTRUCT
43 #define COBJMACROS
44 #include "windef.h"
45 #include "winbase.h"
46 #include "wingdi.h"
47 #include "wine/debug.h"
48 #include "d3d8.h"
49 #include "ddraw.h"
50 #include "wine/wined3d_interface.h"
51
52 /* Device caps */
53 #define MAX_SHADERS        64
54
55 /* CreateVertexShader can return > 0xFFFF */
56 #define VS_HIGHESTFIXEDFXF 0xF0000000
57
58 /* ===========================================================================
59     Macros
60    =========================================================================== */
61 /* Not nice, but it lets wined3d support different versions of directx */
62 #define D3D8CAPSTOWINECAPS(_pD3D8Caps, _pWineCaps) \
63     _pWineCaps->DeviceType                        = (WINED3DDEVTYPE *) &_pD3D8Caps->DeviceType; \
64     _pWineCaps->AdapterOrdinal                    = &_pD3D8Caps->AdapterOrdinal; \
65     _pWineCaps->Caps                              = &_pD3D8Caps->Caps; \
66     _pWineCaps->Caps2                             = &_pD3D8Caps->Caps2; \
67     _pWineCaps->Caps3                             = &_pD3D8Caps->Caps3; \
68     _pWineCaps->PresentationIntervals             = &_pD3D8Caps->PresentationIntervals; \
69     _pWineCaps->CursorCaps                        = &_pD3D8Caps->CursorCaps; \
70     _pWineCaps->DevCaps                           = &_pD3D8Caps->DevCaps; \
71     _pWineCaps->PrimitiveMiscCaps                 = &_pD3D8Caps->PrimitiveMiscCaps; \
72     _pWineCaps->RasterCaps                        = &_pD3D8Caps->RasterCaps; \
73     _pWineCaps->ZCmpCaps                          = &_pD3D8Caps->ZCmpCaps; \
74     _pWineCaps->SrcBlendCaps                      = &_pD3D8Caps->SrcBlendCaps; \
75     _pWineCaps->DestBlendCaps                     = &_pD3D8Caps->DestBlendCaps; \
76     _pWineCaps->AlphaCmpCaps                      = &_pD3D8Caps->AlphaCmpCaps; \
77     _pWineCaps->ShadeCaps                         = &_pD3D8Caps->ShadeCaps; \
78     _pWineCaps->TextureCaps                       = &_pD3D8Caps->TextureCaps; \
79     _pWineCaps->TextureFilterCaps                 = &_pD3D8Caps->TextureFilterCaps; \
80     _pWineCaps->CubeTextureFilterCaps             = &_pD3D8Caps->CubeTextureFilterCaps; \
81     _pWineCaps->VolumeTextureFilterCaps           = &_pD3D8Caps->VolumeTextureFilterCaps; \
82     _pWineCaps->TextureAddressCaps                = &_pD3D8Caps->TextureAddressCaps; \
83     _pWineCaps->VolumeTextureAddressCaps          = &_pD3D8Caps->VolumeTextureAddressCaps; \
84     _pWineCaps->LineCaps                          = &_pD3D8Caps->LineCaps; \
85     _pWineCaps->MaxTextureWidth                   = &_pD3D8Caps->MaxTextureWidth; \
86     _pWineCaps->MaxTextureHeight                  = &_pD3D8Caps->MaxTextureHeight; \
87     _pWineCaps->MaxVolumeExtent                   = &_pD3D8Caps->MaxVolumeExtent; \
88     _pWineCaps->MaxTextureRepeat                  = &_pD3D8Caps->MaxTextureRepeat; \
89     _pWineCaps->MaxTextureAspectRatio             = &_pD3D8Caps->MaxTextureAspectRatio; \
90     _pWineCaps->MaxAnisotropy                     = &_pD3D8Caps->MaxAnisotropy; \
91     _pWineCaps->MaxVertexW                        = &_pD3D8Caps->MaxVertexW; \
92     _pWineCaps->GuardBandLeft                     = &_pD3D8Caps->GuardBandLeft; \
93     _pWineCaps->GuardBandTop                      = &_pD3D8Caps->GuardBandTop; \
94     _pWineCaps->GuardBandRight                    = &_pD3D8Caps->GuardBandRight; \
95     _pWineCaps->GuardBandBottom                   = &_pD3D8Caps->GuardBandBottom; \
96     _pWineCaps->ExtentsAdjust                     = &_pD3D8Caps->ExtentsAdjust; \
97     _pWineCaps->StencilCaps                       = &_pD3D8Caps->StencilCaps; \
98     _pWineCaps->FVFCaps                           = &_pD3D8Caps->FVFCaps; \
99     _pWineCaps->TextureOpCaps                     = &_pD3D8Caps->TextureOpCaps; \
100     _pWineCaps->MaxTextureBlendStages             = &_pD3D8Caps->MaxTextureBlendStages; \
101     _pWineCaps->MaxSimultaneousTextures           = &_pD3D8Caps->MaxSimultaneousTextures; \
102     _pWineCaps->VertexProcessingCaps              = &_pD3D8Caps->VertexProcessingCaps; \
103     _pWineCaps->MaxActiveLights                   = &_pD3D8Caps->MaxActiveLights; \
104     _pWineCaps->MaxUserClipPlanes                 = &_pD3D8Caps->MaxUserClipPlanes; \
105     _pWineCaps->MaxVertexBlendMatrices            = &_pD3D8Caps->MaxVertexBlendMatrices; \
106     _pWineCaps->MaxVertexBlendMatrixIndex         = &_pD3D8Caps->MaxVertexBlendMatrixIndex; \
107     _pWineCaps->MaxPointSize                      = &_pD3D8Caps->MaxPointSize; \
108     _pWineCaps->MaxPrimitiveCount                 = &_pD3D8Caps->MaxPrimitiveCount; \
109     _pWineCaps->MaxVertexIndex                    = &_pD3D8Caps->MaxVertexIndex; \
110     _pWineCaps->MaxStreams                        = &_pD3D8Caps->MaxStreams; \
111     _pWineCaps->MaxStreamStride                   = &_pD3D8Caps->MaxStreamStride; \
112     _pWineCaps->VertexShaderVersion               = &_pD3D8Caps->VertexShaderVersion; \
113     _pWineCaps->MaxVertexShaderConst              = &_pD3D8Caps->MaxVertexShaderConst; \
114     _pWineCaps->PixelShaderVersion                = &_pD3D8Caps->PixelShaderVersion; \
115     _pWineCaps->PixelShader1xMaxValue             = &_pD3D8Caps->MaxPixelShaderValue;
116
117 /* Direct3D8 Interfaces: */
118 typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
119 typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
120 typedef struct IDirect3D8Impl IDirect3D8Impl;
121 typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
122 typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
123 typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
124 typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
125 typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
126 typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
127 typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
128 typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
129 typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
130
131 /** Private Interfaces: */
132 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
133 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
134 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
135 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
136
137 /* Advance declaration of structures to satisfy compiler */
138 typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
139
140 /* ===========================================================================
141     The interfactes themselves
142    =========================================================================== */
143
144 /* ---------- */
145 /* IDirect3D8 */
146 /* ---------- */
147
148 /*****************************************************************************
149  * Predeclare the interface implementation structures
150  */
151 extern const IDirect3D8Vtbl Direct3D8_Vtbl;
152
153 /*****************************************************************************
154  * IDirect3D implementation structure
155  */
156 struct IDirect3D8Impl
157 {
158     /* IUnknown fields */
159     const IDirect3D8Vtbl   *lpVtbl;
160     LONG                    ref;
161
162     /* The WineD3D device */
163     IWineD3D               *WineD3D;
164 };
165
166 /* ---------------- */
167 /* IDirect3DDevice8 */
168 /* ---------------- */
169
170 /*****************************************************************************
171  * Predeclare the interface implementation structures
172  */
173 extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl;
174
175 /*****************************************************************************
176  * IDirect3DDevice8 implementation structure
177  */
178 struct IDirect3DDevice8Impl
179 {
180     /* IUnknown fields */
181     const IDirect3DDevice8Vtbl   *lpVtbl;
182     LONG                         ref;
183 /* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
184     IWineD3DDevice               *WineD3DDevice;
185     IDirect3DVertexShader8Impl   *vShaders[MAX_SHADERS];
186 /* FIXME: Move *baseVertexIndex somewhere sensible like wined3d */
187     UINT                          baseVertexIndex;
188 };
189
190 /* ---------------- */
191 /* IDirect3DVolume8 */
192 /* ---------------- */
193
194 /*****************************************************************************
195  * Predeclare the interface implementation structures
196  */
197 extern const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl;
198
199 /*****************************************************************************
200  * IDirect3DVolume8 implementation structure
201  */
202 struct IDirect3DVolume8Impl
203 {
204     /* IUnknown fields */
205     const IDirect3DVolume8Vtbl *lpVtbl;
206     LONG                        ref;
207
208     /* IDirect3DVolume8 fields */
209     IWineD3DVolume             *wineD3DVolume;
210 };
211
212 /* ------------------- */
213 /* IDirect3DSwapChain8 */
214 /* ------------------- */
215
216 /*****************************************************************************
217  * Predeclare the interface implementation structures
218  */
219 extern const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl;
220
221 /*****************************************************************************
222  * IDirect3DSwapChain8 implementation structure
223  */
224 struct IDirect3DSwapChain8Impl
225 {
226     /* IUnknown fields */
227     const IDirect3DSwapChain8Vtbl *lpVtbl;
228     LONG                           ref;
229
230     /* IDirect3DSwapChain8 fields */
231     IWineD3DSwapChain             *wineD3DSwapChain;
232
233     /* Parent reference */
234     LPDIRECT3DDEVICE8              parentDevice;
235 };
236
237 /* ----------------- */
238 /* IDirect3DSurface8 */
239 /* ----------------- */
240
241 /*****************************************************************************
242  * Predeclare the interface implementation structures
243  */
244 extern const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl;
245
246 /*****************************************************************************
247  * IDirect3DSurface8 implementation structure
248  */
249 struct IDirect3DSurface8Impl
250 {
251     /* IUnknown fields */
252     const IDirect3DSurface8Vtbl *lpVtbl;
253     LONG                         ref;
254
255     /* IDirect3DSurface8 fields */
256     IWineD3DSurface             *wineD3DSurface;
257 };
258
259 /* ------------------ */
260 /* IDirect3DResource8 */
261 /* ------------------ */
262
263 /*****************************************************************************
264  * Predeclare the interface implementation structures
265  */
266 extern const IDirect3DResource8Vtbl Direct3DResource8_Vtbl;
267
268 /*****************************************************************************
269  * IDirect3DResource8 implementation structure
270  */
271 struct IDirect3DResource8Impl
272 {
273     /* IUnknown fields */
274     const IDirect3DResource8Vtbl *lpVtbl;
275     LONG                          ref;
276
277     /* IDirect3DResource8 fields */
278     IWineD3DResource             *wineD3DResource;
279 };
280 extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
281
282 /* ---------------------- */
283 /* IDirect3DVertexBuffer8 */
284 /* ---------------------- */
285
286 /*****************************************************************************
287  * Predeclare the interface implementation structures
288  */
289 extern const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl;
290
291 /*****************************************************************************
292  * IDirect3DVertexBuffer8 implementation structure
293  */
294 struct IDirect3DVertexBuffer8Impl
295 {
296     /* IUnknown fields */
297     const IDirect3DVertexBuffer8Vtbl *lpVtbl;
298     LONG                              ref;
299
300     /* IDirect3DResource8 fields */
301     IWineD3DVertexBuffer             *wineD3DVertexBuffer;
302
303     /* Parent reference */
304     LPDIRECT3DDEVICE8                 parentDevice;
305 };
306
307 /* --------------------- */
308 /* IDirect3DIndexBuffer8 */
309 /* --------------------- */
310
311 /*****************************************************************************
312  * Predeclare the interface implementation structures
313  */
314 extern const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl;
315
316 /*****************************************************************************
317  * IDirect3DIndexBuffer8 implementation structure
318  */
319 struct IDirect3DIndexBuffer8Impl
320 {
321     /* IUnknown fields */
322     const IDirect3DIndexBuffer8Vtbl *lpVtbl;
323     LONG                             ref;
324
325     /* IDirect3DResource8 fields */
326     IWineD3DIndexBuffer             *wineD3DIndexBuffer;
327
328     /* Parent reference */
329     LPDIRECT3DDEVICE8                parentDevice;
330 };
331
332 /* --------------------- */
333 /* IDirect3DBaseTexture8 */
334 /* --------------------- */
335
336 /*****************************************************************************
337  * IDirect3DBaseTexture8 implementation structure
338  */
339 struct IDirect3DBaseTexture8Impl
340 {
341     /* IUnknown fields */
342     const IDirect3DBaseTexture8Vtbl *lpVtbl;
343     LONG                   ref;
344
345     /* IDirect3DResource8 fields */
346     IWineD3DBaseTexture             *wineD3DBaseTexture;
347 };
348
349 /* --------------------- */
350 /* IDirect3DCubeTexture8 */
351 /* --------------------- */
352
353 /*****************************************************************************
354  * Predeclare the interface implementation structures
355  */
356 extern const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl;
357
358 /*****************************************************************************
359  * IDirect3DCubeTexture8 implementation structure
360  */
361 struct IDirect3DCubeTexture8Impl
362 {
363     /* IUnknown fields */
364     const IDirect3DCubeTexture8Vtbl *lpVtbl;
365     LONG                   ref;
366
367     /* IDirect3DResource8 fields */
368     IWineD3DCubeTexture             *wineD3DCubeTexture;
369
370     /* Parent reference */
371     LPDIRECT3DDEVICE8                parentDevice;
372 };
373
374 /* ----------------- */
375 /* IDirect3DTexture8 */
376 /* ----------------- */
377
378 /*****************************************************************************
379  * Predeclare the interface implementation structures
380  */
381 extern const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl;
382
383 /*****************************************************************************
384  * IDirect3DTexture8 implementation structure
385  */
386 struct IDirect3DTexture8Impl
387 {
388     /* IUnknown fields */
389     const IDirect3DTexture8Vtbl *lpVtbl;
390     LONG                   ref;
391
392     /* IDirect3DResourc8 fields */
393     IWineD3DTexture             *wineD3DTexture;
394
395     /* Parent reference */
396     LPDIRECT3DDEVICE8            parentDevice;
397 };
398
399 /* ----------------------- */
400 /* IDirect3DVolumeTexture8 */
401 /* ----------------------- */
402
403 /*****************************************************************************
404  * Predeclare the interface implementation structures
405  */
406 extern const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl;
407
408 /*****************************************************************************
409  * IDirect3DVolumeTexture8 implementation structure
410  */
411 struct IDirect3DVolumeTexture8Impl
412 {
413     /* IUnknown fields */
414     const IDirect3DVolumeTexture8Vtbl *lpVtbl;
415     LONG                   ref;
416
417     /* IDirect3DResource8 fields */
418     IWineD3DVolumeTexture             *wineD3DVolumeTexture;
419
420     /* Parent reference */
421     LPDIRECT3DDEVICE8                  parentDevice;
422 };
423
424 /* ----------------------- */
425 /* IDirect3DStateBlockImpl */
426 /* ----------------------- */
427
428 /* TODO: Generate a valid GUIDs */
429 /* {83B073CE-6F30-11d9-C687-00046142C14F} */
430 DEFINE_GUID(IID_IDirect3DStateBlock8, 
431 0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
432
433 DEFINE_GUID(IID_IDirect3DVertexShader8,
434 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
435
436 DEFINE_GUID(IID_IDirect3DPixelShader8,
437 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89);
438
439
440 /*****************************************************************************
441  * IDirect3DStateBlock8 interface
442  */
443 #define INTERFACE IDirect3DStateBlock8
444 DECLARE_INTERFACE_(IDirect3DStateBlock8, IUnknown)
445 {
446     /*** IUnknown methods ***/
447     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
448     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
449     STDMETHOD_(ULONG,Release)(THIS) PURE;
450     /*** IDirect3DStateBlock9 methods ***/
451     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
452     STDMETHOD(Capture)(THIS) PURE;
453     STDMETHOD(Apply)(THIS) PURE;
454 };
455 #undef INTERFACE
456
457 /*** IUnknown methods ***/
458 #define IDirect3DStateBlock8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
459 #define IDirect3DStateBlock8_AddRef(p)              (p)->lpVtbl->AddRef(p)
460 #define IDirect3DStateBlock8_Release(p)             (p)->lpVtbl->Release(p)
461 /*** IDirect3DStateBlock9 methods ***/
462 #define IDirect3DStateBlock8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
463 #define IDirect3DStateBlock8_Capture(p)             (p)->lpVtbl->Capture(p)
464 #define IDirect3DStateBlock8_Apply(p)               (p)->lpVtbl->Apply(p)
465
466 /*****************************************************************************
467  * Predeclare the interface implementation structures
468  */
469 extern const IDirect3DStateBlock8Vtbl Direct3DStateBlock8_Vtbl;
470
471 /*****************************************************************************
472  * IDirect3DStateBlock implementation structure
473  */
474 typedef struct  IDirect3DStateBlock8Impl {
475     /* IUnknown fields */
476     const IDirect3DStateBlock8Vtbl *lpVtbl;
477     LONG                   ref;
478
479     /* IDirect3DResource8 fields */
480     IWineD3DStateBlock             *wineD3DStateBlock;
481 } IDirect3DStateBlock8Impl;
482
483 /*****************************************************************************
484  * IDirect3DVertexShader9 interface
485  */
486 #define INTERFACE IDirect3DVertexShader8
487 DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown)
488 {
489     /*** IUnknown methods ***/
490     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
491     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
492     STDMETHOD_(ULONG,Release)(THIS) PURE;
493     /*** IDirect3DVertexShader9 methods ***/
494     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
495     STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
496 };
497 #undef INTERFACE
498
499 /*** IUnknown methods ***/
500 #define IDirect3DVertexShader8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
501 #define IDirect3DVertexShader8_AddRef(p)              (p)->lpVtbl->AddRef(p)
502 #define IDirect3DVertexShader8_Release(p)             (p)->lpVtbl->Release(p)
503 /*** IDirect3DVertexShader8 methods ***/
504 #define IDirect3DVertexShader8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
505 #define IDirect3DVertexShader8_GetFunction(p,a,b)     (p)->lpVtbl->GetFunction(p,a,b)
506
507 /* ------------------------- */
508 /* IDirect3DVertexShader8Impl */
509 /* ------------------------- */
510
511 /*****************************************************************************
512  * IDirect3DPixelShader9 interface
513  */
514 #define INTERFACE IDirect3DPixelShader8
515 DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown)
516 {
517     /*** IUnknown methods ***/
518     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
519     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
520     STDMETHOD_(ULONG,Release)(THIS) PURE;
521     /*** IDirect3DPixelShader8 methods ***/
522     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
523     STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
524 };
525 #undef INTERFACE
526
527 /*** IUnknown methods ***/
528 #define IDirect3DPixelShader8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
529 #define IDirect3DPixelShader8_AddRef(p)              (p)->lpVtbl->AddRef(p)
530 #define IDirect3DPixelShader8_Release(p)             (p)->lpVtbl->Release(p)
531 /*** IDirect3DPixelShader8 methods ***/
532 #define IDirect3DPixelShader8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
533 #define IDirect3DPixelShader8_GetFunction(p,a,b)     (p)->lpVtbl->GetFunction(p,a,b)
534
535
536 /*****************************************************************************
537  * Predeclare the interface implementation structures
538  */
539 extern const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl;
540
541 /*****************************************************************************
542  * IDirect3DVertexShader implementation structure
543  */
544
545 struct IDirect3DVertexShader8Impl {
546   const IDirect3DVertexShader8Vtbl *lpVtbl;
547   LONG ref;
548
549   IWineD3DVertexShader             *wineD3DVertexShader;
550 };
551
552
553 /* ------------------------ */
554 /* IDirect3DPixelShaderImpl */
555 /* ------------------------ */
556
557
558 /*****************************************************************************
559  * Predeclare the interface implementation structures
560  */
561 extern const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl;
562
563 /*****************************************************************************
564  * IDirect3DPixelShader implementation structure
565  */
566 typedef struct IDirect3DPixelShader8Impl {
567     const IDirect3DPixelShader8Vtbl *lpVtbl;
568     LONG                             ref;
569
570     /* The device, to be replaced by an IDirect3DDeviceImpl */
571     IWineD3DPixelShader             *wineD3DPixelShader;
572 } IDirect3DPixelShader8Impl;
573
574 /**
575  * Internals functions
576  *
577  * to see how not defined it here
578  */ 
579  
580 /* Callbacks */
581 extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, UINT Width, UINT Height, 
582                                          WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
583                                          IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
584
585 extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown  *pDevice, UINT Width, UINT Height, UINT Depth, 
586                                           WINED3DFORMAT  Format, WINED3DPOOL Pool, DWORD Usage,
587                                           IWineD3DVolume **ppVolume, 
588                                           HANDLE   * pSharedHandle);
589
590 extern HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, UINT Width, UINT Height,
591                                          WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
592                                          DWORD MultisampleQuality, BOOL Discard,
593                                          IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
594
595 extern HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Height,
596                                          WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
597                                          DWORD MultisampleQuality, BOOL Lockable, 
598                                          IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
599
600 #endif /* __WINE_D3DX8_PRIVATE_H */