VirtualBox

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

Last change on this file since 16477 was 16477, checked in by vboxsync, 16 years ago

LGPL disclaimer by filemuncher

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

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