d3d8: Don't store shader_handle's.
[wine/hacks.git] / dlls / d3d8 / d3d8_private.h
blob86adcbac1cc40436bca2d27453cf961ad2a865b5
1 /*
2 * Direct3D 8 private include file
4 * Copyright 2002-2004 Jason Edmeades
5 * Copyright 2003-2004 Raphael Junqueira
6 * Copyright 2004 Christian Costa
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.
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.
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
23 #ifndef __WINE_D3D8_PRIVATE_H
24 #define __WINE_D3D8_PRIVATE_H
26 #include <stdarg.h>
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"
38 /* Device caps */
39 #define INITIAL_SHADER_HANDLE_TABLE_SIZE 64
41 /* CreateVertexShader can return > 0xFFFF */
42 #define VS_HIGHESTFIXEDFXF 0xF0000000
44 /* ===========================================================================
45 Macros
46 =========================================================================== */
47 /* Not nice, but it lets wined3d support different versions of directx */
48 #define WINECAPSTOD3D8CAPS(_pD3D8Caps, _pWineCaps) \
49 _pD3D8Caps->DeviceType = (D3DDEVTYPE) _pWineCaps->DeviceType; \
50 _pD3D8Caps->AdapterOrdinal = _pWineCaps->AdapterOrdinal; \
51 _pD3D8Caps->Caps = _pWineCaps->Caps; \
52 _pD3D8Caps->Caps2 = _pWineCaps->Caps2; \
53 _pD3D8Caps->Caps3 = _pWineCaps->Caps3; \
54 _pD3D8Caps->PresentationIntervals = _pWineCaps->PresentationIntervals; \
55 _pD3D8Caps->CursorCaps = _pWineCaps->CursorCaps; \
56 _pD3D8Caps->DevCaps = _pWineCaps->DevCaps; \
57 _pD3D8Caps->PrimitiveMiscCaps = _pWineCaps->PrimitiveMiscCaps; \
58 _pD3D8Caps->RasterCaps = _pWineCaps->RasterCaps; \
59 _pD3D8Caps->ZCmpCaps = _pWineCaps->ZCmpCaps; \
60 _pD3D8Caps->SrcBlendCaps = _pWineCaps->SrcBlendCaps; \
61 _pD3D8Caps->DestBlendCaps = _pWineCaps->DestBlendCaps; \
62 _pD3D8Caps->AlphaCmpCaps = _pWineCaps->AlphaCmpCaps; \
63 _pD3D8Caps->ShadeCaps = _pWineCaps->ShadeCaps; \
64 _pD3D8Caps->TextureCaps = _pWineCaps->TextureCaps; \
65 _pD3D8Caps->TextureFilterCaps = _pWineCaps->TextureFilterCaps; \
66 _pD3D8Caps->CubeTextureFilterCaps = _pWineCaps->CubeTextureFilterCaps; \
67 _pD3D8Caps->VolumeTextureFilterCaps = _pWineCaps->VolumeTextureFilterCaps; \
68 _pD3D8Caps->TextureAddressCaps = _pWineCaps->TextureAddressCaps; \
69 _pD3D8Caps->VolumeTextureAddressCaps = _pWineCaps->VolumeTextureAddressCaps; \
70 _pD3D8Caps->LineCaps = _pWineCaps->LineCaps; \
71 _pD3D8Caps->MaxTextureWidth = _pWineCaps->MaxTextureWidth; \
72 _pD3D8Caps->MaxTextureHeight = _pWineCaps->MaxTextureHeight; \
73 _pD3D8Caps->MaxVolumeExtent = _pWineCaps->MaxVolumeExtent; \
74 _pD3D8Caps->MaxTextureRepeat = _pWineCaps->MaxTextureRepeat; \
75 _pD3D8Caps->MaxTextureAspectRatio = _pWineCaps->MaxTextureAspectRatio; \
76 _pD3D8Caps->MaxAnisotropy = _pWineCaps->MaxAnisotropy; \
77 _pD3D8Caps->MaxVertexW = _pWineCaps->MaxVertexW; \
78 _pD3D8Caps->GuardBandLeft = _pWineCaps->GuardBandLeft; \
79 _pD3D8Caps->GuardBandTop = _pWineCaps->GuardBandTop; \
80 _pD3D8Caps->GuardBandRight = _pWineCaps->GuardBandRight; \
81 _pD3D8Caps->GuardBandBottom = _pWineCaps->GuardBandBottom; \
82 _pD3D8Caps->ExtentsAdjust = _pWineCaps->ExtentsAdjust; \
83 _pD3D8Caps->StencilCaps = _pWineCaps->StencilCaps; \
84 _pD3D8Caps->FVFCaps = _pWineCaps->FVFCaps; \
85 _pD3D8Caps->TextureOpCaps = _pWineCaps->TextureOpCaps; \
86 _pD3D8Caps->MaxTextureBlendStages = _pWineCaps->MaxTextureBlendStages; \
87 _pD3D8Caps->MaxSimultaneousTextures = _pWineCaps->MaxSimultaneousTextures; \
88 _pD3D8Caps->VertexProcessingCaps = _pWineCaps->VertexProcessingCaps; \
89 _pD3D8Caps->MaxActiveLights = _pWineCaps->MaxActiveLights; \
90 _pD3D8Caps->MaxUserClipPlanes = _pWineCaps->MaxUserClipPlanes; \
91 _pD3D8Caps->MaxVertexBlendMatrices = _pWineCaps->MaxVertexBlendMatrices; \
92 _pD3D8Caps->MaxVertexBlendMatrixIndex = _pWineCaps->MaxVertexBlendMatrixIndex; \
93 _pD3D8Caps->MaxPointSize = _pWineCaps->MaxPointSize; \
94 _pD3D8Caps->MaxPrimitiveCount = _pWineCaps->MaxPrimitiveCount; \
95 _pD3D8Caps->MaxVertexIndex = _pWineCaps->MaxVertexIndex; \
96 _pD3D8Caps->MaxStreams = _pWineCaps->MaxStreams; \
97 _pD3D8Caps->MaxStreamStride = _pWineCaps->MaxStreamStride; \
98 _pD3D8Caps->VertexShaderVersion = _pWineCaps->VertexShaderVersion; \
99 _pD3D8Caps->MaxVertexShaderConst = _pWineCaps->MaxVertexShaderConst; \
100 _pD3D8Caps->PixelShaderVersion = _pWineCaps->PixelShaderVersion; \
101 _pD3D8Caps->MaxPixelShaderValue = _pWineCaps->PixelShader1xMaxValue;
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;
117 /** Private Interfaces: */
118 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
119 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
120 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
121 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
123 /* Advance declaration of structures to satisfy compiler */
124 typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
126 /* Global critical section */
127 extern CRITICAL_SECTION d3d8_cs;
129 /* ===========================================================================
130 The interfaces themselves
131 =========================================================================== */
133 /* ---------- */
134 /* IDirect3D8 */
135 /* ---------- */
137 /*****************************************************************************
138 * Predeclare the interface implementation structures
140 extern const IDirect3D8Vtbl Direct3D8_Vtbl;
142 /*****************************************************************************
143 * IDirect3D implementation structure
145 struct IDirect3D8Impl
147 /* IUnknown fields */
148 const IDirect3D8Vtbl *lpVtbl;
149 LONG ref;
151 /* The WineD3D device */
152 IWineD3D *WineD3D;
155 /* ---------------- */
156 /* IDirect3DDevice8 */
157 /* ---------------- */
159 /*****************************************************************************
160 * Predeclare the interface implementation structures
162 extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl;
164 /*****************************************************************************
165 * IDirect3DDevice8 implementation structure
168 typedef void * shader_handle;
170 struct FvfToDecl
172 DWORD fvf;
173 IWineD3DVertexDeclaration *decl;
176 struct IDirect3DDevice8Impl
178 /* IUnknown fields */
179 const IDirect3DDevice8Vtbl *lpVtbl;
180 LONG ref;
181 /* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
182 IWineD3DDevice *WineD3DDevice;
183 DWORD shader_handle_table_size;
184 DWORD allocated_shader_handles;
185 shader_handle *shader_handles;
186 shader_handle *free_shader_handles;
188 /* FVF management */
189 struct FvfToDecl *decls;
190 UINT numConvertedDecls, declArraySize;
192 /* Avoids recursion with nested ReleaseRef to 0 */
193 BOOL inDestruction;
196 /* ---------------- */
197 /* IDirect3DVolume8 */
198 /* ---------------- */
200 /*****************************************************************************
201 * IDirect3DVolume8 implementation structure
203 struct IDirect3DVolume8Impl
205 /* IUnknown fields */
206 const IDirect3DVolume8Vtbl *lpVtbl;
207 LONG ref;
209 /* IDirect3DVolume8 fields */
210 IWineD3DVolume *wineD3DVolume;
212 /* The volume container */
213 IUnknown *container;
215 /* If set forward refcounting to this object */
216 IUnknown *forwardReference;
219 /* ------------------- */
220 /* IDirect3DSwapChain8 */
221 /* ------------------- */
223 /*****************************************************************************
224 * Predeclare the interface implementation structures
226 extern const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl;
228 /*****************************************************************************
229 * IDirect3DSwapChain8 implementation structure
231 struct IDirect3DSwapChain8Impl
233 /* IUnknown fields */
234 const IDirect3DSwapChain8Vtbl *lpVtbl;
235 LONG ref;
237 /* IDirect3DSwapChain8 fields */
238 IWineD3DSwapChain *wineD3DSwapChain;
240 /* Parent reference */
241 LPDIRECT3DDEVICE8 parentDevice;
244 /* ----------------- */
245 /* IDirect3DSurface8 */
246 /* ----------------- */
248 /*****************************************************************************
249 * Predeclare the interface implementation structures
251 extern const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl;
253 /*****************************************************************************
254 * IDirect3DSurface8 implementation structure
256 struct IDirect3DSurface8Impl
258 /* IUnknown fields */
259 const IDirect3DSurface8Vtbl *lpVtbl;
260 LONG ref;
262 /* IDirect3DSurface8 fields */
263 IWineD3DSurface *wineD3DSurface;
265 /* Parent reference */
266 LPDIRECT3DDEVICE8 parentDevice;
268 /* The surface container */
269 IUnknown *container;
271 /* If set forward refcounting to this object */
272 IUnknown *forwardReference;
274 /* Flags an implicit surface */
275 BOOL isImplicit;
278 /* ------------------ */
279 /* IDirect3DResource8 */
280 /* ------------------ */
282 /*****************************************************************************
283 * Predeclare the interface implementation structures
285 extern const IDirect3DResource8Vtbl Direct3DResource8_Vtbl;
287 /*****************************************************************************
288 * IDirect3DResource8 implementation structure
290 struct IDirect3DResource8Impl
292 /* IUnknown fields */
293 const IDirect3DResource8Vtbl *lpVtbl;
294 LONG ref;
296 /* IDirect3DResource8 fields */
297 IWineD3DResource *wineD3DResource;
299 extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
301 /* ---------------------- */
302 /* IDirect3DVertexBuffer8 */
303 /* ---------------------- */
305 /*****************************************************************************
306 * Predeclare the interface implementation structures
308 extern const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl;
310 /*****************************************************************************
311 * IDirect3DVertexBuffer8 implementation structure
313 struct IDirect3DVertexBuffer8Impl
315 /* IUnknown fields */
316 const IDirect3DVertexBuffer8Vtbl *lpVtbl;
317 LONG ref;
319 /* IDirect3DResource8 fields */
320 IWineD3DVertexBuffer *wineD3DVertexBuffer;
322 /* Parent reference */
323 LPDIRECT3DDEVICE8 parentDevice;
326 /* --------------------- */
327 /* IDirect3DIndexBuffer8 */
328 /* --------------------- */
330 /*****************************************************************************
331 * Predeclare the interface implementation structures
333 extern const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl;
335 /*****************************************************************************
336 * IDirect3DIndexBuffer8 implementation structure
338 struct IDirect3DIndexBuffer8Impl
340 /* IUnknown fields */
341 const IDirect3DIndexBuffer8Vtbl *lpVtbl;
342 LONG ref;
344 /* IDirect3DResource8 fields */
345 IWineD3DIndexBuffer *wineD3DIndexBuffer;
347 /* Parent reference */
348 LPDIRECT3DDEVICE8 parentDevice;
351 /* --------------------- */
352 /* IDirect3DBaseTexture8 */
353 /* --------------------- */
355 /*****************************************************************************
356 * IDirect3DBaseTexture8 implementation structure
358 struct IDirect3DBaseTexture8Impl
360 /* IUnknown fields */
361 const IDirect3DBaseTexture8Vtbl *lpVtbl;
362 LONG ref;
364 /* IDirect3DResource8 fields */
365 IWineD3DBaseTexture *wineD3DBaseTexture;
368 /* --------------------- */
369 /* IDirect3DCubeTexture8 */
370 /* --------------------- */
372 /*****************************************************************************
373 * Predeclare the interface implementation structures
375 extern const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl;
377 /*****************************************************************************
378 * IDirect3DCubeTexture8 implementation structure
380 struct IDirect3DCubeTexture8Impl
382 /* IUnknown fields */
383 const IDirect3DCubeTexture8Vtbl *lpVtbl;
384 LONG ref;
386 /* IDirect3DResource8 fields */
387 IWineD3DCubeTexture *wineD3DCubeTexture;
389 /* Parent reference */
390 LPDIRECT3DDEVICE8 parentDevice;
393 /* ----------------- */
394 /* IDirect3DTexture8 */
395 /* ----------------- */
397 /*****************************************************************************
398 * Predeclare the interface implementation structures
400 extern const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl;
402 /*****************************************************************************
403 * IDirect3DTexture8 implementation structure
405 struct IDirect3DTexture8Impl
407 /* IUnknown fields */
408 const IDirect3DTexture8Vtbl *lpVtbl;
409 LONG ref;
411 /* IDirect3DResourc8 fields */
412 IWineD3DTexture *wineD3DTexture;
414 /* Parent reference */
415 LPDIRECT3DDEVICE8 parentDevice;
418 /* ----------------------- */
419 /* IDirect3DVolumeTexture8 */
420 /* ----------------------- */
422 /*****************************************************************************
423 * Predeclare the interface implementation structures
425 extern const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl;
427 /*****************************************************************************
428 * IDirect3DVolumeTexture8 implementation structure
430 struct IDirect3DVolumeTexture8Impl
432 /* IUnknown fields */
433 const IDirect3DVolumeTexture8Vtbl *lpVtbl;
434 LONG ref;
436 /* IDirect3DResource8 fields */
437 IWineD3DVolumeTexture *wineD3DVolumeTexture;
439 /* Parent reference */
440 LPDIRECT3DDEVICE8 parentDevice;
443 /* ----------------------- */
444 /* IDirect3DStateBlockImpl */
445 /* ----------------------- */
447 /* TODO: Generate a valid GUIDs */
448 /* {83B073CE-6F30-11d9-C687-00046142C14F} */
449 DEFINE_GUID(IID_IDirect3DStateBlock8,
450 0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
452 DEFINE_GUID(IID_IDirect3DVertexDeclaration8,
453 0x5dd7478d, 0xcbf3, 0x41a6, 0x8c, 0xfd, 0xfd, 0x19, 0x2b, 0x11, 0xc7, 0x90);
455 DEFINE_GUID(IID_IDirect3DVertexShader8,
456 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
458 DEFINE_GUID(IID_IDirect3DPixelShader8,
459 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89);
462 /*****************************************************************************
463 * IDirect3DStateBlock8 interface
465 #define INTERFACE IDirect3DStateBlock8
466 DECLARE_INTERFACE_(IDirect3DStateBlock8, IUnknown)
468 /*** IUnknown methods ***/
469 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
470 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
471 STDMETHOD_(ULONG,Release)(THIS) PURE;
472 /*** IDirect3DStateBlock9 methods ***/
473 STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
474 STDMETHOD(Capture)(THIS) PURE;
475 STDMETHOD(Apply)(THIS) PURE;
477 #undef INTERFACE
479 /*** IUnknown methods ***/
480 #define IDirect3DStateBlock8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
481 #define IDirect3DStateBlock8_AddRef(p) (p)->lpVtbl->AddRef(p)
482 #define IDirect3DStateBlock8_Release(p) (p)->lpVtbl->Release(p)
483 /*** IDirect3DStateBlock9 methods ***/
484 #define IDirect3DStateBlock8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
485 #define IDirect3DStateBlock8_Capture(p) (p)->lpVtbl->Capture(p)
486 #define IDirect3DStateBlock8_Apply(p) (p)->lpVtbl->Apply(p)
488 /*****************************************************************************
489 * Predeclare the interface implementation structures
491 extern const IDirect3DStateBlock8Vtbl Direct3DStateBlock8_Vtbl;
493 /*****************************************************************************
494 * IDirect3DStateBlock implementation structure
496 typedef struct IDirect3DStateBlock8Impl {
497 /* IUnknown fields */
498 const IDirect3DStateBlock8Vtbl *lpVtbl;
499 LONG ref;
501 /* IDirect3DResource8 fields */
502 IWineD3DStateBlock *wineD3DStateBlock;
503 } IDirect3DStateBlock8Impl;
505 /*****************************************************************************
506 * IDirect3DVertexDeclaration8 interface
508 #define INTERFACE IDirect3DVertexDeclaration8
509 DECLARE_INTERFACE_(IDirect3DVertexDeclaration8, IUnknown)
511 /*** IUnknown methods ***/
512 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** obj_ptr) PURE;
513 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
514 STDMETHOD_(ULONG,Release)(THIS) PURE;
516 #undef INTERFACE
518 /*** IUnknown methods ***/
519 #define IDirect3DVertexDeclaration8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
520 #define IDirect3DVertexDeclaration8_AddRef(p) (p)->lpVtbl->AddRef(p)
521 #define IDirect3DVertexDeclaration8_Release(p) (p)->lpVtbl->Release(p)
523 /*** Implementation ***/
524 extern const IDirect3DVertexDeclaration8Vtbl Direct3DVertexDeclaration8_Vtbl;
526 typedef struct {
527 const IDirect3DVertexDeclaration8Vtbl *lpVtbl;
528 LONG ref_count;
530 DWORD *elements;
531 DWORD elements_size; /* Size of elements, in bytes */
533 IWineD3DVertexDeclaration *wined3d_vertex_declaration;
534 } IDirect3DVertexDeclaration8Impl;
537 /*****************************************************************************
538 * IDirect3DVertexShader9 interface
540 #define INTERFACE IDirect3DVertexShader8
541 DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown)
543 /*** IUnknown methods ***/
544 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
545 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
546 STDMETHOD_(ULONG,Release)(THIS) PURE;
547 /*** IDirect3DVertexShader9 methods ***/
548 STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
549 STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
551 #undef INTERFACE
553 /*** IUnknown methods ***/
554 #define IDirect3DVertexShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
555 #define IDirect3DVertexShader8_AddRef(p) (p)->lpVtbl->AddRef(p)
556 #define IDirect3DVertexShader8_Release(p) (p)->lpVtbl->Release(p)
557 /*** IDirect3DVertexShader8 methods ***/
558 #define IDirect3DVertexShader8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
559 #define IDirect3DVertexShader8_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b)
561 /* ------------------------- */
562 /* IDirect3DVertexShader8Impl */
563 /* ------------------------- */
565 /*****************************************************************************
566 * IDirect3DPixelShader9 interface
568 #define INTERFACE IDirect3DPixelShader8
569 DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown)
571 /*** IUnknown methods ***/
572 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
573 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
574 STDMETHOD_(ULONG,Release)(THIS) PURE;
575 /*** IDirect3DPixelShader8 methods ***/
576 STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
577 STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
579 #undef INTERFACE
581 /*** IUnknown methods ***/
582 #define IDirect3DPixelShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
583 #define IDirect3DPixelShader8_AddRef(p) (p)->lpVtbl->AddRef(p)
584 #define IDirect3DPixelShader8_Release(p) (p)->lpVtbl->Release(p)
585 /*** IDirect3DPixelShader8 methods ***/
586 #define IDirect3DPixelShader8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
587 #define IDirect3DPixelShader8_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b)
590 /*****************************************************************************
591 * Predeclare the interface implementation structures
593 extern const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl;
595 /*****************************************************************************
596 * IDirect3DVertexShader implementation structure
599 struct IDirect3DVertexShader8Impl {
600 const IDirect3DVertexShader8Vtbl *lpVtbl;
601 LONG ref;
603 DWORD handle;
604 IDirect3DVertexDeclaration8 *vertex_declaration;
605 IWineD3DVertexShader *wineD3DVertexShader;
609 /* ------------------------ */
610 /* IDirect3DPixelShaderImpl */
611 /* ------------------------ */
614 /*****************************************************************************
615 * Predeclare the interface implementation structures
617 extern const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl;
619 /*****************************************************************************
620 * IDirect3DPixelShader implementation structure
622 typedef struct IDirect3DPixelShader8Impl {
623 const IDirect3DPixelShader8Vtbl *lpVtbl;
624 LONG ref;
626 DWORD handle;
627 /* The device, to be replaced by an IDirect3DDeviceImpl */
628 IWineD3DPixelShader *wineD3DPixelShader;
629 } IDirect3DPixelShader8Impl;
632 * Internals functions
634 * to see how not defined it here
636 void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wined3d_vertex_shader);
637 UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elements_size, WINED3DVERTEXELEMENT **wined3d_elements);
638 size_t parse_token(const DWORD* pToken);
640 /* Callbacks */
641 extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
642 WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
643 WINED3DCUBEMAP_FACES Face, IWineD3DSurface** ppSurface,
644 HANDLE* pSharedHandle);
646 extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth,
647 WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage,
648 IWineD3DVolume **ppVolume,
649 HANDLE * pSharedHandle);
651 extern HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
652 WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
653 DWORD MultisampleQuality, BOOL Discard,
654 IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
656 extern HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
657 WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
658 DWORD MultisampleQuality, BOOL Lockable,
659 IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
661 extern ULONG WINAPI D3D8CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain);
663 extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
665 extern ULONG WINAPI D3D8CB_DestroyRenderTarget (IWineD3DSurface *pSurface);
667 extern ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface);
669 extern ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume);
671 #endif /* __WINE_D3DX8_PRIVATE_H */