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 |
|
---|
109 | void fixup_caps(WINED3DCAPS *pWineCaps) DECLSPEC_HIDDEN;
|
---|
110 |
|
---|
111 | /* Direct3D8 Interfaces: */
|
---|
112 | typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
|
---|
113 | typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
|
---|
114 | typedef struct IDirect3D8Impl IDirect3D8Impl;
|
---|
115 | typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
|
---|
116 | typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
|
---|
117 | typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
|
---|
118 | typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
|
---|
119 | typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
|
---|
120 | typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
|
---|
121 | typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
|
---|
122 | typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
|
---|
123 | typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
|
---|
124 | typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
|
---|
125 |
|
---|
126 | /* ===========================================================================
|
---|
127 | The interfaces themselves
|
---|
128 | =========================================================================== */
|
---|
129 |
|
---|
130 | /* ---------- */
|
---|
131 | /* IDirect3D8 */
|
---|
132 | /* ---------- */
|
---|
133 |
|
---|
134 | /*****************************************************************************
|
---|
135 | * Predeclare the interface implementation structures
|
---|
136 | */
|
---|
137 | extern const IDirect3D8Vtbl Direct3D8_Vtbl DECLSPEC_HIDDEN;
|
---|
138 |
|
---|
139 | /*****************************************************************************
|
---|
140 | * IDirect3D implementation structure
|
---|
141 | */
|
---|
142 | struct IDirect3D8Impl
|
---|
143 | {
|
---|
144 | /* IUnknown fields */
|
---|
145 | const IDirect3D8Vtbl *lpVtbl;
|
---|
146 | LONG ref;
|
---|
147 |
|
---|
148 | /* The WineD3D device */
|
---|
149 | IWineD3D *WineD3D;
|
---|
150 | };
|
---|
151 |
|
---|
152 | /*****************************************************************************
|
---|
153 | * IDirect3DDevice8 implementation structure
|
---|
154 | */
|
---|
155 |
|
---|
156 | #define D3D8_INITIAL_HANDLE_TABLE_SIZE 64
|
---|
157 | #define D3D8_INVALID_HANDLE ~0U
|
---|
158 |
|
---|
159 | enum d3d8_handle_type
|
---|
160 | {
|
---|
161 | D3D8_HANDLE_FREE,
|
---|
162 | D3D8_HANDLE_VS,
|
---|
163 | D3D8_HANDLE_PS,
|
---|
164 | D3D8_HANDLE_SB,
|
---|
165 | };
|
---|
166 |
|
---|
167 | struct d3d8_handle_entry
|
---|
168 | {
|
---|
169 | void *object;
|
---|
170 | enum d3d8_handle_type type;
|
---|
171 | };
|
---|
172 |
|
---|
173 | struct d3d8_handle_table
|
---|
174 | {
|
---|
175 | struct d3d8_handle_entry *entries;
|
---|
176 | struct d3d8_handle_entry *free_entries;
|
---|
177 | UINT table_size;
|
---|
178 | UINT entry_count;
|
---|
179 | };
|
---|
180 |
|
---|
181 | struct FvfToDecl
|
---|
182 | {
|
---|
183 | DWORD fvf;
|
---|
184 | struct IDirect3DVertexDeclaration8 *decl;
|
---|
185 | };
|
---|
186 |
|
---|
187 | struct IDirect3DDevice8Impl
|
---|
188 | {
|
---|
189 | /* IUnknown fields */
|
---|
190 | const IDirect3DDevice8Vtbl *lpVtbl;
|
---|
191 | const IWineD3DDeviceParentVtbl *device_parent_vtbl;
|
---|
192 | LONG ref;
|
---|
193 | /* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
|
---|
194 | IWineD3DDevice *WineD3DDevice;
|
---|
195 | struct d3d8_handle_table handle_table;
|
---|
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 | HRESULT device_init(IDirect3DDevice8Impl *device, IWineD3D *wined3d, UINT adapter,
|
---|
206 | D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN;
|
---|
207 |
|
---|
208 | /* ---------------- */
|
---|
209 | /* IDirect3DVolume8 */
|
---|
210 | /* ---------------- */
|
---|
211 |
|
---|
212 | /*****************************************************************************
|
---|
213 | * IDirect3DVolume8 implementation structure
|
---|
214 | */
|
---|
215 | struct IDirect3DVolume8Impl
|
---|
216 | {
|
---|
217 | /* IUnknown fields */
|
---|
218 | const IDirect3DVolume8Vtbl *lpVtbl;
|
---|
219 | LONG ref;
|
---|
220 |
|
---|
221 | /* IDirect3DVolume8 fields */
|
---|
222 | IWineD3DVolume *wineD3DVolume;
|
---|
223 |
|
---|
224 | /* The volume container */
|
---|
225 | IUnknown *container;
|
---|
226 |
|
---|
227 | /* If set forward refcounting to this object */
|
---|
228 | IUnknown *forwardReference;
|
---|
229 | };
|
---|
230 |
|
---|
231 | HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device, UINT width, UINT height,
|
---|
232 | UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool) DECLSPEC_HIDDEN;
|
---|
233 |
|
---|
234 | /* ------------------- */
|
---|
235 | /* IDirect3DSwapChain8 */
|
---|
236 | /* ------------------- */
|
---|
237 |
|
---|
238 | /*****************************************************************************
|
---|
239 | * IDirect3DSwapChain8 implementation structure
|
---|
240 | */
|
---|
241 | struct IDirect3DSwapChain8Impl
|
---|
242 | {
|
---|
243 | /* IUnknown fields */
|
---|
244 | const IDirect3DSwapChain8Vtbl *lpVtbl;
|
---|
245 | LONG ref;
|
---|
246 |
|
---|
247 | /* IDirect3DSwapChain8 fields */
|
---|
248 | IWineD3DSwapChain *wineD3DSwapChain;
|
---|
249 |
|
---|
250 | /* Parent reference */
|
---|
251 | LPDIRECT3DDEVICE8 parentDevice;
|
---|
252 | };
|
---|
253 |
|
---|
254 | HRESULT swapchain_init(IDirect3DSwapChain8Impl *swapchain, IDirect3DDevice8Impl *device,
|
---|
255 | D3DPRESENT_PARAMETERS *present_parameters) DECLSPEC_HIDDEN;
|
---|
256 |
|
---|
257 | /* ----------------- */
|
---|
258 | /* IDirect3DSurface8 */
|
---|
259 | /* ----------------- */
|
---|
260 |
|
---|
261 | /*****************************************************************************
|
---|
262 | * IDirect3DSurface8 implementation structure
|
---|
263 | */
|
---|
264 | struct IDirect3DSurface8Impl
|
---|
265 | {
|
---|
266 | /* IUnknown fields */
|
---|
267 | const IDirect3DSurface8Vtbl *lpVtbl;
|
---|
268 | LONG ref;
|
---|
269 |
|
---|
270 | /* IDirect3DSurface8 fields */
|
---|
271 | IWineD3DSurface *wineD3DSurface;
|
---|
272 |
|
---|
273 | /* Parent reference */
|
---|
274 | LPDIRECT3DDEVICE8 parentDevice;
|
---|
275 |
|
---|
276 | /* The surface container */
|
---|
277 | IUnknown *container;
|
---|
278 |
|
---|
279 | /* If set forward refcounting to this object */
|
---|
280 | IUnknown *forwardReference;
|
---|
281 | };
|
---|
282 |
|
---|
283 | HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *device,
|
---|
284 | UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
|
---|
285 | DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN;
|
---|
286 |
|
---|
287 | struct IDirect3DResource8Impl
|
---|
288 | {
|
---|
289 | /* IUnknown fields */
|
---|
290 | const IDirect3DResource8Vtbl *lpVtbl;
|
---|
291 | LONG ref;
|
---|
292 |
|
---|
293 | /* IDirect3DResource8 fields */
|
---|
294 | IWineD3DResource *wineD3DResource;
|
---|
295 | };
|
---|
296 |
|
---|
297 | /* ---------------------- */
|
---|
298 | /* IDirect3DVertexBuffer8 */
|
---|
299 | /* ---------------------- */
|
---|
300 |
|
---|
301 | /*****************************************************************************
|
---|
302 | * IDirect3DVertexBuffer8 implementation structure
|
---|
303 | */
|
---|
304 | struct IDirect3DVertexBuffer8Impl
|
---|
305 | {
|
---|
306 | /* IUnknown fields */
|
---|
307 | const IDirect3DVertexBuffer8Vtbl *lpVtbl;
|
---|
308 | LONG ref;
|
---|
309 |
|
---|
310 | /* IDirect3DResource8 fields */
|
---|
311 | IWineD3DBuffer *wineD3DVertexBuffer;
|
---|
312 |
|
---|
313 | /* Parent reference */
|
---|
314 | LPDIRECT3DDEVICE8 parentDevice;
|
---|
315 |
|
---|
316 | DWORD fvf;
|
---|
317 | };
|
---|
318 |
|
---|
319 | HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Impl *device,
|
---|
320 | UINT size, DWORD usage, DWORD fvf, D3DPOOL pool) DECLSPEC_HIDDEN;
|
---|
321 |
|
---|
322 | /* --------------------- */
|
---|
323 | /* IDirect3DIndexBuffer8 */
|
---|
324 | /* --------------------- */
|
---|
325 |
|
---|
326 | /*****************************************************************************
|
---|
327 | * IDirect3DIndexBuffer8 implementation structure
|
---|
328 | */
|
---|
329 | struct IDirect3DIndexBuffer8Impl
|
---|
330 | {
|
---|
331 | /* IUnknown fields */
|
---|
332 | const IDirect3DIndexBuffer8Vtbl *lpVtbl;
|
---|
333 | LONG ref;
|
---|
334 |
|
---|
335 | /* IDirect3DResource8 fields */
|
---|
336 | IWineD3DBuffer *wineD3DIndexBuffer;
|
---|
337 |
|
---|
338 | /* Parent reference */
|
---|
339 | LPDIRECT3DDEVICE8 parentDevice;
|
---|
340 |
|
---|
341 | WINED3DFORMAT format;
|
---|
342 | };
|
---|
343 |
|
---|
344 | HRESULT indexbuffer_init(IDirect3DIndexBuffer8Impl *buffer, IDirect3DDevice8Impl *device,
|
---|
345 | UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
---|
346 |
|
---|
347 | /* --------------------- */
|
---|
348 | /* IDirect3DBaseTexture8 */
|
---|
349 | /* --------------------- */
|
---|
350 |
|
---|
351 | /*****************************************************************************
|
---|
352 | * IDirect3DBaseTexture8 implementation structure
|
---|
353 | */
|
---|
354 | struct IDirect3DBaseTexture8Impl
|
---|
355 | {
|
---|
356 | /* IUnknown fields */
|
---|
357 | const IDirect3DBaseTexture8Vtbl *lpVtbl;
|
---|
358 | LONG ref;
|
---|
359 |
|
---|
360 | /* IDirect3DResource8 fields */
|
---|
361 | IWineD3DBaseTexture *wineD3DBaseTexture;
|
---|
362 | };
|
---|
363 |
|
---|
364 | /* --------------------- */
|
---|
365 | /* IDirect3DCubeTexture8 */
|
---|
366 | /* --------------------- */
|
---|
367 |
|
---|
368 | /*****************************************************************************
|
---|
369 | * IDirect3DCubeTexture8 implementation structure
|
---|
370 | */
|
---|
371 | struct IDirect3DCubeTexture8Impl
|
---|
372 | {
|
---|
373 | /* IUnknown fields */
|
---|
374 | const IDirect3DCubeTexture8Vtbl *lpVtbl;
|
---|
375 | LONG ref;
|
---|
376 |
|
---|
377 | /* IDirect3DResource8 fields */
|
---|
378 | IWineD3DCubeTexture *wineD3DCubeTexture;
|
---|
379 |
|
---|
380 | /* Parent reference */
|
---|
381 | LPDIRECT3DDEVICE8 parentDevice;
|
---|
382 | };
|
---|
383 |
|
---|
384 | HRESULT cubetexture_init(IDirect3DCubeTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
---|
385 | UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
---|
386 |
|
---|
387 | /* ----------------- */
|
---|
388 | /* IDirect3DTexture8 */
|
---|
389 | /* ----------------- */
|
---|
390 |
|
---|
391 | /*****************************************************************************
|
---|
392 | * IDirect3DTexture8 implementation structure
|
---|
393 | */
|
---|
394 | struct IDirect3DTexture8Impl
|
---|
395 | {
|
---|
396 | /* IUnknown fields */
|
---|
397 | const IDirect3DTexture8Vtbl *lpVtbl;
|
---|
398 | LONG ref;
|
---|
399 |
|
---|
400 | /* IDirect3DResourc8 fields */
|
---|
401 | IWineD3DTexture *wineD3DTexture;
|
---|
402 |
|
---|
403 | /* Parent reference */
|
---|
404 | LPDIRECT3DDEVICE8 parentDevice;
|
---|
405 | };
|
---|
406 |
|
---|
407 | HRESULT texture_init(IDirect3DTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
---|
408 | UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
---|
409 |
|
---|
410 | /* ----------------------- */
|
---|
411 | /* IDirect3DVolumeTexture8 */
|
---|
412 | /* ----------------------- */
|
---|
413 |
|
---|
414 | /*****************************************************************************
|
---|
415 | * IDirect3DVolumeTexture8 implementation structure
|
---|
416 | */
|
---|
417 | struct IDirect3DVolumeTexture8Impl
|
---|
418 | {
|
---|
419 | /* IUnknown fields */
|
---|
420 | const IDirect3DVolumeTexture8Vtbl *lpVtbl;
|
---|
421 | LONG ref;
|
---|
422 |
|
---|
423 | /* IDirect3DResource8 fields */
|
---|
424 | IWineD3DVolumeTexture *wineD3DVolumeTexture;
|
---|
425 |
|
---|
426 | /* Parent reference */
|
---|
427 | LPDIRECT3DDEVICE8 parentDevice;
|
---|
428 | };
|
---|
429 |
|
---|
430 | HRESULT volumetexture_init(IDirect3DVolumeTexture8Impl *texture, IDirect3DDevice8Impl *device,
|
---|
431 | UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
---|
432 |
|
---|
433 | DEFINE_GUID(IID_IDirect3DVertexDeclaration8,
|
---|
434 | 0x5dd7478d, 0xcbf3, 0x41a6, 0x8c, 0xfd, 0xfd, 0x19, 0x2b, 0x11, 0xc7, 0x90);
|
---|
435 |
|
---|
436 | DEFINE_GUID(IID_IDirect3DVertexShader8,
|
---|
437 | 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
|
---|
438 |
|
---|
439 | DEFINE_GUID(IID_IDirect3DPixelShader8,
|
---|
440 | 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89);
|
---|
441 |
|
---|
442 | /*****************************************************************************
|
---|
443 | * IDirect3DVertexDeclaration8 interface
|
---|
444 | */
|
---|
445 | #define INTERFACE IDirect3DVertexDeclaration8
|
---|
446 | DECLARE_INTERFACE_(IDirect3DVertexDeclaration8, IUnknown)
|
---|
447 | {
|
---|
448 | /*** IUnknown methods ***/
|
---|
449 | STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** obj_ptr) PURE;
|
---|
450 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
451 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
452 | };
|
---|
453 | #undef INTERFACE
|
---|
454 |
|
---|
455 | /*** IUnknown methods ***/
|
---|
456 | #define IDirect3DVertexDeclaration8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
---|
457 | #define IDirect3DVertexDeclaration8_AddRef(p) (p)->lpVtbl->AddRef(p)
|
---|
458 | #define IDirect3DVertexDeclaration8_Release(p) (p)->lpVtbl->Release(p)
|
---|
459 |
|
---|
460 | typedef struct {
|
---|
461 | const IDirect3DVertexDeclaration8Vtbl *lpVtbl;
|
---|
462 | LONG ref_count;
|
---|
463 |
|
---|
464 | DWORD *elements;
|
---|
465 | DWORD elements_size; /* Size of elements, in bytes */
|
---|
466 |
|
---|
467 | IWineD3DVertexDeclaration *wined3d_vertex_declaration;
|
---|
468 | DWORD shader_handle;
|
---|
469 | } IDirect3DVertexDeclaration8Impl;
|
---|
470 |
|
---|
471 | HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration8Impl *declaration,
|
---|
472 | IDirect3DDevice8Impl *device, const DWORD *elements, DWORD shader_handle) DECLSPEC_HIDDEN;
|
---|
473 | HRESULT vertexdeclaration_init_fvf(IDirect3DVertexDeclaration8Impl *declaration,
|
---|
474 | IDirect3DDevice8Impl *device, DWORD fvf) DECLSPEC_HIDDEN;
|
---|
475 |
|
---|
476 | /*****************************************************************************
|
---|
477 | * IDirect3DVertexShader8 interface
|
---|
478 | */
|
---|
479 | #define INTERFACE IDirect3DVertexShader8
|
---|
480 | DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown)
|
---|
481 | {
|
---|
482 | /*** IUnknown methods ***/
|
---|
483 | STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
---|
484 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
485 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
486 | };
|
---|
487 | #undef INTERFACE
|
---|
488 |
|
---|
489 | /*** IUnknown methods ***/
|
---|
490 | #define IDirect3DVertexShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
---|
491 | #define IDirect3DVertexShader8_AddRef(p) (p)->lpVtbl->AddRef(p)
|
---|
492 | #define IDirect3DVertexShader8_Release(p) (p)->lpVtbl->Release(p)
|
---|
493 |
|
---|
494 | /* ------------------------- */
|
---|
495 | /* IDirect3DVertexShader8Impl */
|
---|
496 | /* ------------------------- */
|
---|
497 |
|
---|
498 | /*****************************************************************************
|
---|
499 | * IDirect3DPixelShader8 interface
|
---|
500 | */
|
---|
501 | #define INTERFACE IDirect3DPixelShader8
|
---|
502 | DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown)
|
---|
503 | {
|
---|
504 | /*** IUnknown methods ***/
|
---|
505 | STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
---|
506 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
507 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
508 | };
|
---|
509 | #undef INTERFACE
|
---|
510 |
|
---|
511 | /*** IUnknown methods ***/
|
---|
512 | #define IDirect3DPixelShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
---|
513 | #define IDirect3DPixelShader8_AddRef(p) (p)->lpVtbl->AddRef(p)
|
---|
514 | #define IDirect3DPixelShader8_Release(p) (p)->lpVtbl->Release(p)
|
---|
515 |
|
---|
516 | /*****************************************************************************
|
---|
517 | * IDirect3DVertexShader implementation structure
|
---|
518 | */
|
---|
519 |
|
---|
520 | struct IDirect3DVertexShader8Impl {
|
---|
521 | const IDirect3DVertexShader8Vtbl *lpVtbl;
|
---|
522 | LONG ref;
|
---|
523 |
|
---|
524 | IDirect3DVertexDeclaration8 *vertex_declaration;
|
---|
525 | IWineD3DVertexShader *wineD3DVertexShader;
|
---|
526 | };
|
---|
527 |
|
---|
528 | HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Impl *device,
|
---|
529 | const DWORD *declaration, const DWORD *byte_code, DWORD shader_handle, DWORD usage) DECLSPEC_HIDDEN;
|
---|
530 |
|
---|
531 | #define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
|
---|
532 |
|
---|
533 | /*****************************************************************************
|
---|
534 | * IDirect3DPixelShader implementation structure
|
---|
535 | */
|
---|
536 | typedef struct IDirect3DPixelShader8Impl {
|
---|
537 | const IDirect3DPixelShader8Vtbl *lpVtbl;
|
---|
538 | LONG ref;
|
---|
539 |
|
---|
540 | DWORD handle;
|
---|
541 | IWineD3DPixelShader *wineD3DPixelShader;
|
---|
542 | } IDirect3DPixelShader8Impl;
|
---|
543 |
|
---|
544 | HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl *device,
|
---|
545 | const DWORD *byte_code, DWORD shader_handle) DECLSPEC_HIDDEN;
|
---|
546 |
|
---|
547 | /**
|
---|
548 | * Internals functions
|
---|
549 | *
|
---|
550 | * to see how not defined it here
|
---|
551 | */
|
---|
552 | D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format) DECLSPEC_HIDDEN;
|
---|
553 | WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN;
|
---|
554 | void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wined3d_vertex_shader) DECLSPEC_HIDDEN;
|
---|
555 | size_t parse_token(const DWORD *pToken) DECLSPEC_HIDDEN;
|
---|
556 |
|
---|
557 | #endif /* __WINE_D3DX8_PRIVATE_H */
|
---|