VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d8/d3d8_private.h@ 22496

Last change on this file since 22496 was 22496, checked in by vboxsync, 15 years ago

crOpenGL: update wine to 1.1.27 and better fix for depthstencil surface refcounting

  • Property svn:eol-style set to native
File size: 23.9 KB
Line 
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/*
24 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
25 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
26 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
27 * a choice of LGPL license versions is made available with the language indicating
28 * that LGPLv2 or any later version may be used, or where a choice of which version
29 * of the LGPL is applied is otherwise unspecified.
30 */
31
32#ifndef __WINE_D3D8_PRIVATE_H
33#define __WINE_D3D8_PRIVATE_H
34
35#include <stdarg.h>
36
37#define NONAMELESSUNION
38#define NONAMELESSSTRUCT
39#define COBJMACROS
40#include "windef.h"
41#include "winbase.h"
42#include "wingdi.h"
43#include "wine/debug.h"
44#include "d3d8.h"
45#include "wine/wined3d.h"
46
47/* CreateVertexShader can return > 0xFFFF */
48#define VS_HIGHESTFIXEDFXF 0xF0000000
49
50/* ===========================================================================
51 Macros
52 =========================================================================== */
53/* Not nice, but it lets wined3d support different versions of directx */
54#define WINECAPSTOD3D8CAPS(_pD3D8Caps, _pWineCaps) \
55 _pD3D8Caps->DeviceType = (D3DDEVTYPE) _pWineCaps->DeviceType; \
56 _pD3D8Caps->AdapterOrdinal = _pWineCaps->AdapterOrdinal; \
57 _pD3D8Caps->Caps = _pWineCaps->Caps; \
58 _pD3D8Caps->Caps2 = _pWineCaps->Caps2; \
59 _pD3D8Caps->Caps3 = _pWineCaps->Caps3; \
60 _pD3D8Caps->PresentationIntervals = _pWineCaps->PresentationIntervals; \
61 _pD3D8Caps->CursorCaps = _pWineCaps->CursorCaps; \
62 _pD3D8Caps->DevCaps = _pWineCaps->DevCaps; \
63 _pD3D8Caps->PrimitiveMiscCaps = _pWineCaps->PrimitiveMiscCaps; \
64 _pD3D8Caps->RasterCaps = _pWineCaps->RasterCaps; \
65 _pD3D8Caps->ZCmpCaps = _pWineCaps->ZCmpCaps; \
66 _pD3D8Caps->SrcBlendCaps = _pWineCaps->SrcBlendCaps; \
67 _pD3D8Caps->DestBlendCaps = _pWineCaps->DestBlendCaps; \
68 _pD3D8Caps->AlphaCmpCaps = _pWineCaps->AlphaCmpCaps; \
69 _pD3D8Caps->ShadeCaps = _pWineCaps->ShadeCaps; \
70 _pD3D8Caps->TextureCaps = _pWineCaps->TextureCaps; \
71 _pD3D8Caps->TextureFilterCaps = _pWineCaps->TextureFilterCaps; \
72 _pD3D8Caps->CubeTextureFilterCaps = _pWineCaps->CubeTextureFilterCaps; \
73 _pD3D8Caps->VolumeTextureFilterCaps = _pWineCaps->VolumeTextureFilterCaps; \
74 _pD3D8Caps->TextureAddressCaps = _pWineCaps->TextureAddressCaps; \
75 _pD3D8Caps->VolumeTextureAddressCaps = _pWineCaps->VolumeTextureAddressCaps; \
76 _pD3D8Caps->LineCaps = _pWineCaps->LineCaps; \
77 _pD3D8Caps->MaxTextureWidth = _pWineCaps->MaxTextureWidth; \
78 _pD3D8Caps->MaxTextureHeight = _pWineCaps->MaxTextureHeight; \
79 _pD3D8Caps->MaxVolumeExtent = _pWineCaps->MaxVolumeExtent; \
80 _pD3D8Caps->MaxTextureRepeat = _pWineCaps->MaxTextureRepeat; \
81 _pD3D8Caps->MaxTextureAspectRatio = _pWineCaps->MaxTextureAspectRatio; \
82 _pD3D8Caps->MaxAnisotropy = _pWineCaps->MaxAnisotropy; \
83 _pD3D8Caps->MaxVertexW = _pWineCaps->MaxVertexW; \
84 _pD3D8Caps->GuardBandLeft = _pWineCaps->GuardBandLeft; \
85 _pD3D8Caps->GuardBandTop = _pWineCaps->GuardBandTop; \
86 _pD3D8Caps->GuardBandRight = _pWineCaps->GuardBandRight; \
87 _pD3D8Caps->GuardBandBottom = _pWineCaps->GuardBandBottom; \
88 _pD3D8Caps->ExtentsAdjust = _pWineCaps->ExtentsAdjust; \
89 _pD3D8Caps->StencilCaps = _pWineCaps->StencilCaps; \
90 _pD3D8Caps->FVFCaps = _pWineCaps->FVFCaps; \
91 _pD3D8Caps->TextureOpCaps = _pWineCaps->TextureOpCaps; \
92 _pD3D8Caps->MaxTextureBlendStages = _pWineCaps->MaxTextureBlendStages; \
93 _pD3D8Caps->MaxSimultaneousTextures = _pWineCaps->MaxSimultaneousTextures; \
94 _pD3D8Caps->VertexProcessingCaps = _pWineCaps->VertexProcessingCaps; \
95 _pD3D8Caps->MaxActiveLights = _pWineCaps->MaxActiveLights; \
96 _pD3D8Caps->MaxUserClipPlanes = _pWineCaps->MaxUserClipPlanes; \
97 _pD3D8Caps->MaxVertexBlendMatrices = _pWineCaps->MaxVertexBlendMatrices; \
98 _pD3D8Caps->MaxVertexBlendMatrixIndex = _pWineCaps->MaxVertexBlendMatrixIndex; \
99 _pD3D8Caps->MaxPointSize = _pWineCaps->MaxPointSize; \
100 _pD3D8Caps->MaxPrimitiveCount = _pWineCaps->MaxPrimitiveCount; \
101 _pD3D8Caps->MaxVertexIndex = _pWineCaps->MaxVertexIndex; \
102 _pD3D8Caps->MaxStreams = _pWineCaps->MaxStreams; \
103 _pD3D8Caps->MaxStreamStride = _pWineCaps->MaxStreamStride; \
104 _pD3D8Caps->VertexShaderVersion = _pWineCaps->VertexShaderVersion; \
105 _pD3D8Caps->MaxVertexShaderConst = _pWineCaps->MaxVertexShaderConst; \
106 _pD3D8Caps->PixelShaderVersion = _pWineCaps->PixelShaderVersion; \
107 _pD3D8Caps->MaxPixelShaderValue = _pWineCaps->PixelShader1xMaxValue;
108
109void fixup_caps(WINED3DCAPS *pWineCaps);
110
111/* Direct3D8 Interfaces: */
112typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
113typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
114typedef struct IDirect3D8Impl IDirect3D8Impl;
115typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
116typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
117typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
118typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
119typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
120typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
121typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
122typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
123typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
124
125/** Private Interfaces: */
126typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
127typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
128typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
129typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
130
131/* Advance declaration of structures to satisfy compiler */
132typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
133
134/* Global critical section */
135extern CRITICAL_SECTION d3d8_cs;
136
137/* ===========================================================================
138 The interfaces themselves
139 =========================================================================== */
140
141/* ---------- */
142/* IDirect3D8 */
143/* ---------- */
144
145/*****************************************************************************
146 * Predeclare the interface implementation structures
147 */
148extern const IDirect3D8Vtbl Direct3D8_Vtbl;
149
150/*****************************************************************************
151 * IDirect3D implementation structure
152 */
153struct IDirect3D8Impl
154{
155 /* IUnknown fields */
156 const IDirect3D8Vtbl *lpVtbl;
157 LONG ref;
158
159 /* The WineD3D device */
160 IWineD3D *WineD3D;
161};
162
163/* ---------------- */
164/* IDirect3DDevice8 */
165/* ---------------- */
166
167/*****************************************************************************
168 * Predeclare the interface implementation structures
169 */
170extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl;
171extern const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl;
172
173/*****************************************************************************
174 * IDirect3DDevice8 implementation structure
175 */
176
177#define D3D8_INITIAL_HANDLE_TABLE_SIZE 64
178#define D3D8_INVALID_HANDLE ~0U
179
180enum d3d8_handle_type
181{
182 D3D8_HANDLE_FREE,
183 D3D8_HANDLE_VS,
184 D3D8_HANDLE_PS,
185 D3D8_HANDLE_SB,
186};
187
188struct d3d8_handle_entry
189{
190 void *object;
191 enum d3d8_handle_type type;
192};
193
194struct d3d8_handle_table
195{
196 struct d3d8_handle_entry *entries;
197 struct d3d8_handle_entry *free_entries;
198 UINT table_size;
199 UINT entry_count;
200};
201
202struct FvfToDecl
203{
204 DWORD fvf;
205 struct IDirect3DVertexDeclaration8 *decl;
206};
207
208struct IDirect3DDevice8Impl
209{
210 /* IUnknown fields */
211 const IDirect3DDevice8Vtbl *lpVtbl;
212 const IWineD3DDeviceParentVtbl *device_parent_vtbl;
213 LONG ref;
214/* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
215 IWineD3DDevice *WineD3DDevice;
216 struct d3d8_handle_table handle_table;
217
218 /* FVF management */
219 struct FvfToDecl *decls;
220 UINT numConvertedDecls, declArraySize;
221
222 /* Avoids recursion with nested ReleaseRef to 0 */
223 BOOL inDestruction;
224};
225
226/* ---------------- */
227/* IDirect3DVolume8 */
228/* ---------------- */
229
230/*****************************************************************************
231 * IDirect3DVolume8 implementation structure
232 */
233extern const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl;
234struct IDirect3DVolume8Impl
235{
236 /* IUnknown fields */
237 const IDirect3DVolume8Vtbl *lpVtbl;
238 LONG ref;
239
240 /* IDirect3DVolume8 fields */
241 IWineD3DVolume *wineD3DVolume;
242
243 /* The volume container */
244 IUnknown *container;
245
246 /* If set forward refcounting to this object */
247 IUnknown *forwardReference;
248};
249
250/* ------------------- */
251/* IDirect3DSwapChain8 */
252/* ------------------- */
253
254/*****************************************************************************
255 * Predeclare the interface implementation structures
256 */
257extern const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl;
258
259/*****************************************************************************
260 * IDirect3DSwapChain8 implementation structure
261 */
262struct IDirect3DSwapChain8Impl
263{
264 /* IUnknown fields */
265 const IDirect3DSwapChain8Vtbl *lpVtbl;
266 LONG ref;
267
268 /* IDirect3DSwapChain8 fields */
269 IWineD3DSwapChain *wineD3DSwapChain;
270
271 /* Parent reference */
272 LPDIRECT3DDEVICE8 parentDevice;
273};
274
275/* ----------------- */
276/* IDirect3DSurface8 */
277/* ----------------- */
278
279/*****************************************************************************
280 * Predeclare the interface implementation structures
281 */
282extern const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl;
283
284/*****************************************************************************
285 * IDirect3DSurface8 implementation structure
286 */
287struct IDirect3DSurface8Impl
288{
289 /* IUnknown fields */
290 const IDirect3DSurface8Vtbl *lpVtbl;
291 LONG ref;
292
293 /* IDirect3DSurface8 fields */
294 IWineD3DSurface *wineD3DSurface;
295
296 /* Parent reference */
297 LPDIRECT3DDEVICE8 parentDevice;
298
299 /* The surface container */
300 IUnknown *container;
301
302 /* If set forward refcounting to this object */
303 IUnknown *forwardReference;
304
305 /* Flags an implicit surface */
306 BOOL isImplicit;
307};
308
309/* ------------------ */
310/* IDirect3DResource8 */
311/* ------------------ */
312
313/*****************************************************************************
314 * Predeclare the interface implementation structures
315 */
316extern const IDirect3DResource8Vtbl Direct3DResource8_Vtbl;
317
318/*****************************************************************************
319 * IDirect3DResource8 implementation structure
320 */
321struct IDirect3DResource8Impl
322{
323 /* IUnknown fields */
324 const IDirect3DResource8Vtbl *lpVtbl;
325 LONG ref;
326
327 /* IDirect3DResource8 fields */
328 IWineD3DResource *wineD3DResource;
329};
330
331/* ---------------------- */
332/* IDirect3DVertexBuffer8 */
333/* ---------------------- */
334
335/*****************************************************************************
336 * Predeclare the interface implementation structures
337 */
338extern const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl;
339
340/*****************************************************************************
341 * IDirect3DVertexBuffer8 implementation structure
342 */
343struct IDirect3DVertexBuffer8Impl
344{
345 /* IUnknown fields */
346 const IDirect3DVertexBuffer8Vtbl *lpVtbl;
347 LONG ref;
348
349 /* IDirect3DResource8 fields */
350 IWineD3DBuffer *wineD3DVertexBuffer;
351
352 /* Parent reference */
353 LPDIRECT3DDEVICE8 parentDevice;
354
355 DWORD fvf;
356};
357
358/* --------------------- */
359/* IDirect3DIndexBuffer8 */
360/* --------------------- */
361
362/*****************************************************************************
363 * Predeclare the interface implementation structures
364 */
365extern const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl;
366
367/*****************************************************************************
368 * IDirect3DIndexBuffer8 implementation structure
369 */
370struct IDirect3DIndexBuffer8Impl
371{
372 /* IUnknown fields */
373 const IDirect3DIndexBuffer8Vtbl *lpVtbl;
374 LONG ref;
375
376 /* IDirect3DResource8 fields */
377 IWineD3DBuffer *wineD3DIndexBuffer;
378
379 /* Parent reference */
380 LPDIRECT3DDEVICE8 parentDevice;
381
382 WINED3DFORMAT format;
383};
384
385/* --------------------- */
386/* IDirect3DBaseTexture8 */
387/* --------------------- */
388
389/*****************************************************************************
390 * IDirect3DBaseTexture8 implementation structure
391 */
392struct IDirect3DBaseTexture8Impl
393{
394 /* IUnknown fields */
395 const IDirect3DBaseTexture8Vtbl *lpVtbl;
396 LONG ref;
397
398 /* IDirect3DResource8 fields */
399 IWineD3DBaseTexture *wineD3DBaseTexture;
400};
401
402/* --------------------- */
403/* IDirect3DCubeTexture8 */
404/* --------------------- */
405
406/*****************************************************************************
407 * Predeclare the interface implementation structures
408 */
409extern const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl;
410
411/*****************************************************************************
412 * IDirect3DCubeTexture8 implementation structure
413 */
414struct IDirect3DCubeTexture8Impl
415{
416 /* IUnknown fields */
417 const IDirect3DCubeTexture8Vtbl *lpVtbl;
418 LONG ref;
419
420 /* IDirect3DResource8 fields */
421 IWineD3DCubeTexture *wineD3DCubeTexture;
422
423 /* Parent reference */
424 LPDIRECT3DDEVICE8 parentDevice;
425};
426
427/* ----------------- */
428/* IDirect3DTexture8 */
429/* ----------------- */
430
431/*****************************************************************************
432 * Predeclare the interface implementation structures
433 */
434extern const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl;
435
436/*****************************************************************************
437 * IDirect3DTexture8 implementation structure
438 */
439struct IDirect3DTexture8Impl
440{
441 /* IUnknown fields */
442 const IDirect3DTexture8Vtbl *lpVtbl;
443 LONG ref;
444
445 /* IDirect3DResourc8 fields */
446 IWineD3DTexture *wineD3DTexture;
447
448 /* Parent reference */
449 LPDIRECT3DDEVICE8 parentDevice;
450};
451
452/* ----------------------- */
453/* IDirect3DVolumeTexture8 */
454/* ----------------------- */
455
456/*****************************************************************************
457 * Predeclare the interface implementation structures
458 */
459extern const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl;
460
461/*****************************************************************************
462 * IDirect3DVolumeTexture8 implementation structure
463 */
464struct IDirect3DVolumeTexture8Impl
465{
466 /* IUnknown fields */
467 const IDirect3DVolumeTexture8Vtbl *lpVtbl;
468 LONG ref;
469
470 /* IDirect3DResource8 fields */
471 IWineD3DVolumeTexture *wineD3DVolumeTexture;
472
473 /* Parent reference */
474 LPDIRECT3DDEVICE8 parentDevice;
475};
476
477/* ----------------------- */
478/* IDirect3DStateBlockImpl */
479/* ----------------------- */
480
481/* TODO: Generate a valid GUIDs */
482/* {83B073CE-6F30-11d9-C687-00046142C14F} */
483DEFINE_GUID(IID_IDirect3DStateBlock8,
4840x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
485
486DEFINE_GUID(IID_IDirect3DVertexDeclaration8,
4870x5dd7478d, 0xcbf3, 0x41a6, 0x8c, 0xfd, 0xfd, 0x19, 0x2b, 0x11, 0xc7, 0x90);
488
489DEFINE_GUID(IID_IDirect3DVertexShader8,
4900xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
491
492DEFINE_GUID(IID_IDirect3DPixelShader8,
4930x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89);
494
495
496/*****************************************************************************
497 * IDirect3DStateBlock8 interface
498 */
499#define INTERFACE IDirect3DStateBlock8
500DECLARE_INTERFACE_(IDirect3DStateBlock8, IUnknown)
501{
502 /*** IUnknown methods ***/
503 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
504 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
505 STDMETHOD_(ULONG,Release)(THIS) PURE;
506 /*** IDirect3DStateBlock9 methods ***/
507 STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
508 STDMETHOD(Capture)(THIS) PURE;
509 STDMETHOD(Apply)(THIS) PURE;
510};
511#undef INTERFACE
512
513/*** IUnknown methods ***/
514#define IDirect3DStateBlock8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
515#define IDirect3DStateBlock8_AddRef(p) (p)->lpVtbl->AddRef(p)
516#define IDirect3DStateBlock8_Release(p) (p)->lpVtbl->Release(p)
517/*** IDirect3DStateBlock9 methods ***/
518#define IDirect3DStateBlock8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
519#define IDirect3DStateBlock8_Capture(p) (p)->lpVtbl->Capture(p)
520#define IDirect3DStateBlock8_Apply(p) (p)->lpVtbl->Apply(p)
521
522/*****************************************************************************
523 * Predeclare the interface implementation structures
524 */
525extern const IDirect3DStateBlock8Vtbl Direct3DStateBlock8_Vtbl;
526
527/*****************************************************************************
528 * IDirect3DStateBlock implementation structure
529 */
530typedef struct IDirect3DStateBlock8Impl {
531 /* IUnknown fields */
532 const IDirect3DStateBlock8Vtbl *lpVtbl;
533 LONG ref;
534
535 /* IDirect3DResource8 fields */
536 IWineD3DStateBlock *wineD3DStateBlock;
537} IDirect3DStateBlock8Impl;
538
539/*****************************************************************************
540 * IDirect3DVertexDeclaration8 interface
541 */
542#define INTERFACE IDirect3DVertexDeclaration8
543DECLARE_INTERFACE_(IDirect3DVertexDeclaration8, IUnknown)
544{
545 /*** IUnknown methods ***/
546 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** obj_ptr) PURE;
547 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
548 STDMETHOD_(ULONG,Release)(THIS) PURE;
549};
550#undef INTERFACE
551
552/*** IUnknown methods ***/
553#define IDirect3DVertexDeclaration8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
554#define IDirect3DVertexDeclaration8_AddRef(p) (p)->lpVtbl->AddRef(p)
555#define IDirect3DVertexDeclaration8_Release(p) (p)->lpVtbl->Release(p)
556
557/*** Implementation ***/
558extern const IDirect3DVertexDeclaration8Vtbl Direct3DVertexDeclaration8_Vtbl;
559
560typedef struct {
561 const IDirect3DVertexDeclaration8Vtbl *lpVtbl;
562 LONG ref_count;
563
564 DWORD *elements;
565 DWORD elements_size; /* Size of elements, in bytes */
566
567 IWineD3DVertexDeclaration *wined3d_vertex_declaration;
568 DWORD shader_handle;
569} IDirect3DVertexDeclaration8Impl;
570
571
572/*****************************************************************************
573 * IDirect3DVertexShader8 interface
574 */
575#define INTERFACE IDirect3DVertexShader8
576DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown)
577{
578 /*** IUnknown methods ***/
579 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
580 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
581 STDMETHOD_(ULONG,Release)(THIS) PURE;
582};
583#undef INTERFACE
584
585/*** IUnknown methods ***/
586#define IDirect3DVertexShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
587#define IDirect3DVertexShader8_AddRef(p) (p)->lpVtbl->AddRef(p)
588#define IDirect3DVertexShader8_Release(p) (p)->lpVtbl->Release(p)
589
590/* ------------------------- */
591/* IDirect3DVertexShader8Impl */
592/* ------------------------- */
593
594/*****************************************************************************
595 * IDirect3DPixelShader8 interface
596 */
597#define INTERFACE IDirect3DPixelShader8
598DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown)
599{
600 /*** IUnknown methods ***/
601 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
602 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
603 STDMETHOD_(ULONG,Release)(THIS) PURE;
604};
605#undef INTERFACE
606
607/*** IUnknown methods ***/
608#define IDirect3DPixelShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
609#define IDirect3DPixelShader8_AddRef(p) (p)->lpVtbl->AddRef(p)
610#define IDirect3DPixelShader8_Release(p) (p)->lpVtbl->Release(p)
611
612/*****************************************************************************
613 * Predeclare the interface implementation structures
614 */
615extern const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl;
616
617/*****************************************************************************
618 * IDirect3DVertexShader implementation structure
619 */
620
621struct IDirect3DVertexShader8Impl {
622 const IDirect3DVertexShader8Vtbl *lpVtbl;
623 LONG ref;
624
625 IDirect3DVertexDeclaration8 *vertex_declaration;
626 IWineD3DVertexShader *wineD3DVertexShader;
627};
628
629#define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
630
631
632/* ------------------------ */
633/* IDirect3DPixelShaderImpl */
634/* ------------------------ */
635
636
637/*****************************************************************************
638 * Predeclare the interface implementation structures
639 */
640extern const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl;
641
642/*****************************************************************************
643 * IDirect3DPixelShader implementation structure
644 */
645typedef struct IDirect3DPixelShader8Impl {
646 const IDirect3DPixelShader8Vtbl *lpVtbl;
647 LONG ref;
648
649 DWORD handle;
650 IWineD3DPixelShader *wineD3DPixelShader;
651} IDirect3DPixelShader8Impl;
652
653/**
654 * Internals functions
655 *
656 * to see how not defined it here
657 */
658D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format);
659WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format);
660void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wined3d_vertex_shader);
661UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elements_size, WINED3DVERTEXELEMENT **wined3d_elements);
662size_t parse_token(const DWORD* pToken);
663
664/* Callbacks */
665extern ULONG WINAPI D3D8CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain);
666extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
667extern ULONG WINAPI D3D8CB_DestroyRenderTarget (IWineD3DSurface *pSurface);
668extern ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface);
669extern ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume);
670
671#endif /* __WINE_D3DX8_PRIVATE_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette