Implement NtAccessCheck.
[wine/gsoc-2012-control.git] / dlls / ddraw / d3ddevice / main.c
blob9d87fac1b93d0e3d04b7b861b3802b641d432392
1 /* Direct3D Device
2 * Copyright (c) 1998-2004 Lionel ULMER
3 * Copyright (c) 2002-2004 Christian Costa
5 * This file contains all the common stuff for D3D devices.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "config.h"
24 #include <stdarg.h>
25 #include <string.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winerror.h"
30 #include "objbase.h"
31 #include "wingdi.h"
32 #include "ddraw.h"
33 #include "d3d.h"
34 #include "wine/debug.h"
36 #include "d3d_private.h"
37 #include "main.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
41 DWORD InitRenderStateTab[] = {
42 D3DRENDERSTATE_TEXTUREHANDLE, (DWORD)NULL,
43 D3DRENDERSTATE_ANTIALIAS, D3DANTIALIAS_NONE,
44 /* FIXME: D3DRENDERSTATE_TEXTUREADDRESS */
45 D3DRENDERSTATE_TEXTUREPERSPECTIVE, TRUE,
46 /* FIXME: D3DRENDERSTATE_WRAPU */
47 /* FIXME: D3DRENDERSTATE_WRAPV */
48 D3DRENDERSTATE_ZENABLE, D3DZB_TRUE, /* This needs to be set differently according to the Z buffer status */
49 D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID,
50 D3DRENDERSTATE_SHADEMODE, D3DSHADE_GOURAUD,
51 D3DRENDERSTATE_LINEPATTERN, 0,
52 D3DRENDERSTATE_MONOENABLE, FALSE,
53 D3DRENDERSTATE_ROP2, R2_COPYPEN,
54 D3DRENDERSTATE_PLANEMASK, 0xFFFFFFFF,
55 D3DRENDERSTATE_ZWRITEENABLE, TRUE,
56 D3DRENDERSTATE_ALPHATESTENABLE, FALSE,
57 D3DRENDERSTATE_LASTPIXEL, TRUE,
58 D3DRENDERSTATE_TEXTUREMAG, D3DFILTER_NEAREST,
59 D3DRENDERSTATE_TEXTUREMIN, D3DFILTER_NEAREST,
60 D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE,
61 D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO,
62 D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE,
63 D3DRENDERSTATE_CULLMODE, D3DCULL_CCW,
64 D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL,
65 D3DRENDERSTATE_ALPHAREF, 0,
66 D3DRENDERSTATE_ALPHAFUNC, D3DCMP_ALWAYS,
67 D3DRENDERSTATE_DITHERENABLE, FALSE,
68 D3DRENDERSTATE_ALPHABLENDENABLE, FALSE,
69 D3DRENDERSTATE_FOGENABLE, FALSE,
70 D3DRENDERSTATE_SPECULARENABLE, FALSE,
71 D3DRENDERSTATE_ZVISIBLE, FALSE,
72 D3DRENDERSTATE_SUBPIXEL, FALSE,
73 D3DRENDERSTATE_SUBPIXELX, FALSE,
74 D3DRENDERSTATE_STIPPLEDALPHA, FALSE,
75 D3DRENDERSTATE_FOGCOLOR, D3DRGBA(0,0,0,0),
76 D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE,
77 /* FIXME: D3DRENDERSTATE_FOGTABLESTART (same as D3DRENDERSTATE_FOGSTART) */
78 /* FIXME: D3DRENDERSTATE_FOGTABLEEND (same as D3DRENDERSTATE_FOGEND) */
79 D3DRENDERSTATE_FOGTABLEDENSITY, 0x3F80000, /* 1.0f (same as D3DRENDERSTATE_FOGDENSITY) */
80 /* FIXME: D3DRENDERSTATE_STIPPLEENABLE */
81 D3DRENDERSTATE_EDGEANTIALIAS, FALSE,
82 D3DRENDERSTATE_COLORKEYENABLE, FALSE,
83 /* FIXME: D3DRENDERSTATE_BORDERCOLOR */
84 D3DRENDERSTATE_TEXTUREADDRESSU, D3DTADDRESS_WRAP,
85 D3DRENDERSTATE_TEXTUREADDRESSV, D3DTADDRESS_WRAP,
86 D3DRENDERSTATE_MIPMAPLODBIAS, 0x00000000, /* 0.0f */
87 D3DRENDERSTATE_ZBIAS, 0,
88 D3DRENDERSTATE_RANGEFOGENABLE, FALSE,
89 /* FIXME: D3DRENDERSTATE_ANISOTROPY */
90 /* FIXME: D3DRENDERSTATE_FLUSHBATCH */
91 /* FIXME: D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT */
92 D3DRENDERSTATE_STENCILENABLE, FALSE,
93 D3DRENDERSTATE_STENCILFAIL, D3DSTENCILOP_KEEP,
94 D3DRENDERSTATE_STENCILZFAIL, D3DSTENCILOP_KEEP,
95 D3DRENDERSTATE_STENCILPASS, D3DSTENCILOP_KEEP,
96 D3DRENDERSTATE_STENCILFUNC, D3DCMP_ALWAYS,
97 D3DRENDERSTATE_STENCILREF, 0,
98 D3DRENDERSTATE_STENCILMASK, 0xFFFFFFFF,
99 D3DRENDERSTATE_STENCILWRITEMASK, 0xFFFFFFFF,
100 /* FIXME: D3DRENDERSTATE_TEXTUREFACTOR */
101 /* FIXME: D3DRENDERSTATE_STIPPLEPATTERN00..31 */
102 D3DRENDERSTATE_WRAP0, 0,
103 D3DRENDERSTATE_WRAP1, 0,
104 D3DRENDERSTATE_WRAP2, 0,
105 D3DRENDERSTATE_WRAP3, 0,
106 D3DRENDERSTATE_WRAP4, 0,
107 D3DRENDERSTATE_WRAP5, 0,
108 D3DRENDERSTATE_WRAP6, 0,
109 D3DRENDERSTATE_WRAP7, 0,
110 D3DRENDERSTATE_CLIPPING, FALSE,
111 D3DRENDERSTATE_LIGHTING, TRUE,
112 D3DRENDERSTATE_EXTENTS, FALSE,
113 D3DRENDERSTATE_AMBIENT, D3DRGBA(0,0,0,0),
114 D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE,
115 D3DRENDERSTATE_COLORVERTEX, TRUE,
116 D3DRENDERSTATE_LOCALVIEWER, TRUE,
117 D3DRENDERSTATE_NORMALIZENORMALS, FALSE,
118 /* FIXME: D3DRENDER_STATE_COLORKEYBLENDENABLE */
119 D3DRENDERSTATE_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1,
120 D3DRENDERSTATE_SPECULARMATERIALSOURCE, D3DMCS_COLOR2,
121 D3DRENDERSTATE_AMBIENTMATERIALSOURCE, D3DMCS_COLOR2,
122 D3DRENDERSTATE_EMISSIVEMATERIALSOURCE, D3DMCS_MATERIAL,
123 D3DRENDERSTATE_VERTEXBLEND, D3DVBLEND_DISABLE,
124 D3DRENDERSTATE_CLIPPLANEENABLE, 0
127 DWORD InitLightStateTab[] = {
128 D3DLIGHTSTATE_MATERIAL, (DWORD)NULL,
129 D3DLIGHTSTATE_AMBIENT, D3DRGBA(0,0,0,0),
130 D3DLIGHTSTATE_COLORMODEL, D3DCOLOR_RGB,
131 D3DLIGHTSTATE_FOGMODE, D3DFOG_NONE,
132 D3DLIGHTSTATE_FOGSTART, 0x3F80000, /* 1.0f */
133 D3DLIGHTSTATE_FOGEND, 0x42C8000, /* 100.0f */
134 D3DLIGHTSTATE_FOGDENSITY, 0x3F80000 /* 1.0f */
135 /* FIXME: D3DLIGHTSTATE_COLORVERTEX */
138 DWORD InitTextureStageStateTab[] = {
139 D3DTSS_COLOROP, D3DTOP_DISABLE, /* Note, it's manually set for stage 0 */
140 D3DTSS_COLORARG1, D3DTA_TEXTURE,
141 D3DTSS_COLORARG2, D3DTA_CURRENT,
142 D3DTSS_ALPHAOP, D3DTOP_DISABLE, /* Note, it's manually set for stage 0 */
143 D3DTSS_ALPHAARG1, D3DTA_TEXTURE,
144 D3DTSS_ALPHAARG2, D3DTA_CURRENT,
145 /* FIXME: D3DTSS_BUMPENVMAT00,01,10,11 */
146 /* D3DTSS_TEXCOORDINDEX is set manually */
147 D3DTSS_ADDRESS, D3DTADDRESS_WRAP,
148 D3DTSS_ADDRESSU, D3DTADDRESS_WRAP,
149 D3DTSS_ADDRESSV, D3DTADDRESS_WRAP,
150 D3DTSS_BORDERCOLOR, 0x00000000,
151 D3DTSS_MAGFILTER, D3DTFG_POINT,
152 D3DTSS_MINFILTER, D3DTFN_POINT,
153 D3DTSS_MIPFILTER, D3DTFP_NONE,
154 D3DTSS_MIPMAPLODBIAS, 0x00000000, /* 0.0f */
155 D3DTSS_MAXMIPLEVEL, 0,
156 /* D3DTSS_MAXANISOTROPY, 1, */ /* This is to prevent warnings :-) */
157 /* FIXME: D3DTSS_BUMPENVLSCALE */
158 /* FIXME: D3DTSS_NUMPENVLOFFSET */
159 /* FIXME: D3DTSS_TEXTURETRANSFORMFLAGS */
163 void InitDefaultStateBlock(STATEBLOCK* lpStateBlock, int version)
165 unsigned int i, j;
166 TRACE("(%p,%d)\n", lpStateBlock, version);
167 memset(lpStateBlock, 0, sizeof(STATEBLOCK));
169 /* Initialize render states */
170 for (i = 0; i < sizeof(InitRenderStateTab) / sizeof(InitRenderStateTab[0]); i += 2)
172 lpStateBlock->render_state[InitRenderStateTab[i] - 1] = InitRenderStateTab[i + 1];
173 lpStateBlock->set_flags.render_state[InitRenderStateTab[i] - 1] = TRUE;
176 /* Initialize texture stages states */
177 for (i = 0; i < MAX_TEXTURES; i++)
179 for (j = 0; j < sizeof(InitTextureStageStateTab) / sizeof(InitTextureStageStateTab[0]); j += 2)
181 lpStateBlock->texture_stage_state[i][InitTextureStageStateTab[j] - 1] = InitTextureStageStateTab[j + 1];
182 lpStateBlock->set_flags.texture_stage_state[i][InitTextureStageStateTab[j] - 1] = TRUE;
184 /* Map texture coords 0 to stage 0, 1 to stage 1, etc... */
185 lpStateBlock->texture_stage_state[i][D3DTSS_TEXCOORDINDEX - 1] = i;
186 lpStateBlock->set_flags.texture_stage_state[i][D3DTSS_TEXCOORDINDEX - 1] = TRUE;
189 /* The first texture is particular, update it consequently */
190 lpStateBlock->texture_stage_state[0][D3DTSS_COLOROP - 1] = D3DTOP_MODULATE;
191 lpStateBlock->texture_stage_state[0][D3DTSS_ALPHAOP - 1] = D3DTOP_SELECTARG1;
192 lpStateBlock->texture_stage_state[0][D3DTSS_COLORARG2 - 1] = D3DTA_DIFFUSE;
193 lpStateBlock->texture_stage_state[0][D3DTSS_ALPHAARG2 - 1] = D3DTA_DIFFUSE;
195 /* Updates for particular versions */
196 if ((version == 1) || (version==2))
197 lpStateBlock->render_state[D3DRENDERSTATE_SPECULARENABLE - 1] = TRUE;
200 HRESULT WINAPI
201 Main_IDirect3DDeviceImpl_7_3T_2T_1T_QueryInterface(LPDIRECT3DDEVICE7 iface,
202 REFIID riid,
203 LPVOID* obp)
205 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
206 TRACE("(%p/%p)->(%s,%p)\n", This, iface, debugstr_guid(riid), obp);
208 *obp = NULL;
210 /* Note: We cannot get an interface whose version is higher than the
211 * Direct3D object that created the device */
213 if ( IsEqualGUID( &IID_IUnknown, riid ) ) {
214 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
215 *obp = iface;
216 TRACE(" Creating IUnknown interface at %p.\n", *obp);
217 return S_OK;
219 if ( IsEqualGUID( &IID_IDirect3DDevice, riid ) ) {
220 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
221 *obp = ICOM_INTERFACE(This, IDirect3DDevice);
222 TRACE(" Creating IDirect3DDevice interface %p\n", *obp);
223 return S_OK;
225 if ( IsEqualGUID( &IID_IDirect3DDevice2, riid ) && (This->version >= 2)) {
226 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
227 *obp = ICOM_INTERFACE(This, IDirect3DDevice2);
228 TRACE(" Creating IDirect3DDevice2 interface %p\n", *obp);
229 return S_OK;
231 if ( IsEqualGUID( &IID_IDirect3DDevice3, riid ) && (This->version >= 3)) {
232 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
233 *obp = ICOM_INTERFACE(This, IDirect3DDevice3);
234 TRACE(" Creating IDirect3DDevice3 interface %p\n", *obp);
235 return S_OK;
237 if ( IsEqualGUID( &IID_IDirect3DDevice7, riid ) && (This->version >= 7)) {
238 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
239 *obp = ICOM_INTERFACE(This, IDirect3DDevice7);
240 TRACE(" Creating IDirect3DDevice7 interface %p\n", *obp);
241 return S_OK;
243 if ( IsEqualGUID( &IID_IDirectDrawSurface, riid ) ||
244 IsEqualGUID( &IID_IDirectDrawSurface2, riid ) ||
245 IsEqualGUID( &IID_IDirectDrawSurface3, riid ) ) {
246 IDirectDrawSurface7_AddRef(ICOM_INTERFACE(This->surface, IDirectDrawSurface7));
247 *obp = ICOM_INTERFACE(This->surface, IDirectDrawSurface3);
248 TRACE(" Return IDirectDrawSurface3 interface %p\n", *obp);
249 return S_OK;
251 if ( IsEqualGUID( &IID_IDirectDrawSurface4, riid ) ||
252 IsEqualGUID( &IID_IDirectDrawSurface7, riid ) ) {
253 IDirectDrawSurface7_AddRef(ICOM_INTERFACE(This->surface, IDirectDrawSurface7));
254 *obp = ICOM_INTERFACE(This->surface, IDirectDrawSurface7);
255 TRACE(" Return IDirectDrawSurface7 interface %p\n", *obp);
256 return S_OK;
258 FIXME("(%p): interface for IID %s NOT found!\n", This, debugstr_guid(riid));
259 return OLE_E_ENUM_NOMORE;
262 ULONG WINAPI
263 Main_IDirect3DDeviceImpl_7_3T_2T_1T_AddRef(LPDIRECT3DDEVICE7 iface)
265 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
266 ULONG ref = InterlockedIncrement(&This->ref);
268 TRACE("(%p/%p)->() incrementing from %lu.\n", This, iface, ref - 1);
270 return ref;
273 ULONG WINAPI
274 Main_IDirect3DDeviceImpl_7_3T_2T_1T_Release(LPDIRECT3DDEVICE7 iface)
276 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
277 ULONG ref = InterlockedDecrement(&This->ref);
279 TRACE("(%p/%p)->() decrementing from %lu.\n", This, iface, ref + 1);
281 if (!ref) {
282 int i;
283 /* Release texture associated with the device */
284 for (i = 0; i < MAX_TEXTURES; i++) {
285 if (This->current_texture[i] != NULL)
286 IDirect3DTexture2_Release(ICOM_INTERFACE(This->current_texture[i], IDirect3DTexture2));
289 HeapFree(GetProcessHeap(), 0, This);
290 return 0;
292 return ref;
295 HRESULT WINAPI
296 Main_IDirect3DDeviceImpl_7_GetCaps(LPDIRECT3DDEVICE7 iface,
297 LPD3DDEVICEDESC7 lpD3DHELDevDesc)
299 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
300 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpD3DHELDevDesc);
301 return DD_OK;
304 HRESULT WINAPI
305 Main_IDirect3DDeviceImpl_7_3T_EnumTextureFormats(LPDIRECT3DDEVICE7 iface,
306 LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc,
307 LPVOID lpArg)
309 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
310 FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpD3DEnumPixelProc, lpArg);
311 return DD_OK;
314 HRESULT WINAPI
315 Main_IDirect3DDeviceImpl_7_3T_2T_1T_BeginScene(LPDIRECT3DDEVICE7 iface)
317 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
318 TRACE("(%p/%p)->()\n", This, iface);
319 /* Nothing to do */
320 return DD_OK;
323 HRESULT WINAPI
324 Main_IDirect3DDeviceImpl_7_3T_2T_1T_EndScene(LPDIRECT3DDEVICE7 iface)
326 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
327 TRACE("(%p/%p)->()\n", This, iface);
328 /* Nothing to do */
329 return DD_OK;
332 HRESULT WINAPI
333 Main_IDirect3DDeviceImpl_7_3T_2T_1T_GetDirect3D(LPDIRECT3DDEVICE7 iface,
334 LPDIRECT3D7* lplpDirect3D7)
336 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
337 TRACE("(%p/%p)->(%p)\n", This, iface, lplpDirect3D7);
339 *lplpDirect3D7 = ICOM_INTERFACE(This->d3d, IDirect3D7);
340 IDirect3D7_AddRef(ICOM_INTERFACE(This->d3d, IDirect3D7));
342 TRACE(" returning interface %p\n", *lplpDirect3D7);
343 return DD_OK;
346 HRESULT WINAPI
347 Main_IDirect3DDeviceImpl_7_3T_2T_SetRenderTarget(LPDIRECT3DDEVICE7 iface,
348 LPDIRECTDRAWSURFACE7 lpNewRenderTarget,
349 DWORD dwFlags)
351 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
352 IDirectDrawSurfaceImpl *target_impl = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, lpNewRenderTarget);
354 TRACE("(%p/%p)->(%p,%08lx)\n", This, iface, lpNewRenderTarget, dwFlags);
355 if (target_impl != This->surface) {
356 WARN(" Change of rendering target not handled yet !\n");
358 return DD_OK;
361 HRESULT WINAPI
362 Main_IDirect3DDeviceImpl_7_3T_2T_GetRenderTarget(LPDIRECT3DDEVICE7 iface,
363 LPDIRECTDRAWSURFACE7* lplpRenderTarget)
365 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
366 TRACE("(%p/%p)->(%p)\n", This, iface, lplpRenderTarget);
368 *lplpRenderTarget = ICOM_INTERFACE(This->surface, IDirectDrawSurface7);
369 IDirectDrawSurface7_AddRef(ICOM_INTERFACE(This->surface, IDirectDrawSurface7));
371 TRACE(" returning surface at %p.\n", *lplpRenderTarget);
373 return DD_OK;
376 HRESULT WINAPI
377 Main_IDirect3DDeviceImpl_7_Clear(LPDIRECT3DDEVICE7 iface,
378 DWORD dwCount,
379 LPD3DRECT lpRects,
380 DWORD dwFlags,
381 D3DCOLOR dwColor,
382 D3DVALUE dvZ,
383 DWORD dwStencil)
385 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
386 TRACE("(%p/%p)->(%08lx,%p,%08lx,%08lx,%f,%08lx)\n", This, iface, dwCount, lpRects, dwFlags, (DWORD) dwColor, dvZ, dwStencil);
387 return This->clear(This, dwCount, lpRects, dwFlags, dwColor, dvZ, dwStencil);
390 HRESULT WINAPI
391 Main_IDirect3DDeviceImpl_7_3T_2T_SetTransform(LPDIRECT3DDEVICE7 iface,
392 D3DTRANSFORMSTATETYPE dtstTransformStateType,
393 LPD3DMATRIX lpD3DMatrix)
395 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
396 DWORD matrix_changed = 0x00000000;
398 TRACE("(%p/%p)->(%08x,%p)\n", This, iface, dtstTransformStateType, lpD3DMatrix);
400 switch (dtstTransformStateType) {
401 case D3DTRANSFORMSTATE_WORLD: {
402 if (TRACE_ON(ddraw)) {
403 TRACE(" D3DTRANSFORMSTATE_WORLD :\n"); dump_D3DMATRIX(lpD3DMatrix);
405 memcpy(This->world_mat, lpD3DMatrix, 16 * sizeof(float));
406 matrix_changed = WORLDMAT_CHANGED;
407 } break;
409 case D3DTRANSFORMSTATE_VIEW: {
410 if (TRACE_ON(ddraw)) {
411 TRACE(" D3DTRANSFORMSTATE_VIEW :\n"); dump_D3DMATRIX(lpD3DMatrix);
413 memcpy(This->view_mat, lpD3DMatrix, 16 * sizeof(float));
414 matrix_changed = VIEWMAT_CHANGED;
415 } break;
417 case D3DTRANSFORMSTATE_PROJECTION: {
418 if (TRACE_ON(ddraw)) {
419 TRACE(" D3DTRANSFORMSTATE_PROJECTION :\n"); dump_D3DMATRIX(lpD3DMatrix);
421 memcpy(This->proj_mat, lpD3DMatrix, 16 * sizeof(float));
422 matrix_changed = PROJMAT_CHANGED;
423 } break;
425 case D3DTRANSFORMSTATE_TEXTURE0:
426 case D3DTRANSFORMSTATE_TEXTURE1:
427 case D3DTRANSFORMSTATE_TEXTURE2:
428 case D3DTRANSFORMSTATE_TEXTURE3:
429 case D3DTRANSFORMSTATE_TEXTURE4:
430 case D3DTRANSFORMSTATE_TEXTURE5:
431 case D3DTRANSFORMSTATE_TEXTURE6:
432 case D3DTRANSFORMSTATE_TEXTURE7: {
433 DWORD mat_num = dtstTransformStateType - D3DTRANSFORMSTATE_TEXTURE0;
434 if (TRACE_ON(ddraw)) {
435 TRACE(" D3DTRANSFORMSTATE_TEXTURE%ld :\n", mat_num); dump_D3DMATRIX(lpD3DMatrix);
437 memcpy(This->tex_mat[mat_num], lpD3DMatrix, 16 * sizeof(float));
438 matrix_changed = TEXMAT0_CHANGED << mat_num;
439 } break;
441 default:
442 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType);
443 break;
446 if (matrix_changed != 0x00000000) This->matrices_updated(This, matrix_changed);
448 return DD_OK;
451 HRESULT WINAPI
452 Main_IDirect3DDeviceImpl_7_3T_2T_GetTransform(LPDIRECT3DDEVICE7 iface,
453 D3DTRANSFORMSTATETYPE dtstTransformStateType,
454 LPD3DMATRIX lpD3DMatrix)
456 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
457 TRACE("(%p/%p)->(%08x,%p)\n", This, iface, dtstTransformStateType, lpD3DMatrix);
459 switch (dtstTransformStateType) {
460 case D3DTRANSFORMSTATE_WORLD: {
461 memcpy(lpD3DMatrix, This->world_mat, 16 * sizeof(D3DVALUE));
462 if (TRACE_ON(ddraw)) {
463 TRACE(" returning D3DTRANSFORMSTATE_WORLD :\n");
464 dump_D3DMATRIX(lpD3DMatrix);
466 } break;
468 case D3DTRANSFORMSTATE_VIEW: {
469 memcpy(lpD3DMatrix, This->view_mat, 16 * sizeof(D3DVALUE));
470 if (TRACE_ON(ddraw)) {
471 TRACE(" returning D3DTRANSFORMSTATE_VIEW :\n");
472 dump_D3DMATRIX(lpD3DMatrix);
474 } break;
476 case D3DTRANSFORMSTATE_PROJECTION: {
477 memcpy(lpD3DMatrix, This->proj_mat, 16 * sizeof(D3DVALUE));
478 if (TRACE_ON(ddraw)) {
479 TRACE(" returning D3DTRANSFORMSTATE_PROJECTION :\n");
480 dump_D3DMATRIX(lpD3DMatrix);
482 } break;
484 case D3DTRANSFORMSTATE_TEXTURE0:
485 case D3DTRANSFORMSTATE_TEXTURE1:
486 case D3DTRANSFORMSTATE_TEXTURE2:
487 case D3DTRANSFORMSTATE_TEXTURE3:
488 case D3DTRANSFORMSTATE_TEXTURE4:
489 case D3DTRANSFORMSTATE_TEXTURE5:
490 case D3DTRANSFORMSTATE_TEXTURE6:
491 case D3DTRANSFORMSTATE_TEXTURE7: {
492 DWORD mat_num = dtstTransformStateType - D3DTRANSFORMSTATE_TEXTURE0;
493 memcpy(lpD3DMatrix, This->tex_mat[mat_num], 16 * sizeof(D3DVALUE));
494 if (TRACE_ON(ddraw)) {
495 TRACE(" returning D3DTRANSFORMSTATE_TEXTURE%ld :\n", mat_num);
496 dump_D3DMATRIX(lpD3DMatrix);
498 } break;
500 default:
501 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType);
502 return DDERR_INVALIDPARAMS;
505 return DD_OK;
508 HRESULT WINAPI
509 Main_IDirect3DDeviceImpl_7_3T_2T_MultiplyTransform(LPDIRECT3DDEVICE7 iface,
510 D3DTRANSFORMSTATETYPE dtstTransformStateType,
511 LPD3DMATRIX lpD3DMatrix)
513 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
514 LPD3DMATRIX mat;
515 DWORD matrix_changed = 0x00000000;
517 TRACE("(%p/%p)->(%08x,%p)\n", This, iface, dtstTransformStateType, lpD3DMatrix);
519 if (TRACE_ON(ddraw)) {
520 TRACE(" Multiplying by :\n"); dump_D3DMATRIX(lpD3DMatrix);
523 switch (dtstTransformStateType) {
524 case D3DTRANSFORMSTATE_WORLD: {
525 if (TRACE_ON(ddraw)) {
526 TRACE(" Resulting D3DTRANSFORMSTATE_WORLD matrix is :\n");
528 mat = This->world_mat;
529 matrix_changed = WORLDMAT_CHANGED;
530 } break;
532 case D3DTRANSFORMSTATE_VIEW: {
533 if (TRACE_ON(ddraw)) {
534 TRACE(" Resulting D3DTRANSFORMSTATE_VIEW matrix is :\n");
536 mat = This->view_mat;
537 matrix_changed = VIEWMAT_CHANGED;
538 } break;
540 case D3DTRANSFORMSTATE_PROJECTION: {
541 if (TRACE_ON(ddraw)) {
542 TRACE(" Resulting D3DTRANSFORMSTATE_PROJECTION matrix is :\n");
544 mat = This->proj_mat;
545 matrix_changed = PROJMAT_CHANGED;
546 } break;
548 case D3DTRANSFORMSTATE_TEXTURE0:
549 case D3DTRANSFORMSTATE_TEXTURE1:
550 case D3DTRANSFORMSTATE_TEXTURE2:
551 case D3DTRANSFORMSTATE_TEXTURE3:
552 case D3DTRANSFORMSTATE_TEXTURE4:
553 case D3DTRANSFORMSTATE_TEXTURE5:
554 case D3DTRANSFORMSTATE_TEXTURE6:
555 case D3DTRANSFORMSTATE_TEXTURE7: {
556 DWORD mat_num = dtstTransformStateType - D3DTRANSFORMSTATE_TEXTURE0;
557 if (TRACE_ON(ddraw)) {
558 TRACE(" Resulting D3DTRANSFORMSTATE_TEXTURE%ld matrix is :\n", mat_num);
560 mat = This->tex_mat[mat_num];
561 matrix_changed = TEXMAT0_CHANGED << mat_num;
562 } break;
564 default:
565 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType);
566 return DDERR_INVALIDPARAMS;
569 multiply_matrix(mat,mat,lpD3DMatrix);
571 if (TRACE_ON(ddraw)) {
572 dump_D3DMATRIX(mat);
575 if (matrix_changed != 0x00000000) This->matrices_updated(This, matrix_changed);
577 return DD_OK;
580 HRESULT WINAPI
581 Main_IDirect3DDeviceImpl_7_GetViewport(LPDIRECT3DDEVICE7 iface,
582 LPD3DVIEWPORT7 lpData)
584 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
585 TRACE("(%p/%p)->(%p)\n", This, iface, lpData);
587 *lpData = This->active_viewport;
589 if (TRACE_ON(ddraw)) {
590 TRACE(" returning viewport : \n");
591 TRACE(" - dwX = %ld dwY = %ld\n",
592 lpData->dwX, lpData->dwY);
593 TRACE(" - dwWidth = %ld dwHeight = %ld\n",
594 lpData->dwWidth, lpData->dwHeight);
595 TRACE(" - dvMinZ = %f dvMaxZ = %f\n",
596 lpData->dvMinZ, lpData->dvMaxZ);
599 return DD_OK;
602 HRESULT WINAPI
603 Main_IDirect3DDeviceImpl_7_SetMaterial(LPDIRECT3DDEVICE7 iface,
604 LPD3DMATERIAL7 lpMat)
606 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
607 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpMat);
608 return DD_OK;
611 HRESULT WINAPI
612 Main_IDirect3DDeviceImpl_7_GetMaterial(LPDIRECT3DDEVICE7 iface,
613 LPD3DMATERIAL7 lpMat)
615 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
616 TRACE("(%p/%p)->(%p)\n", This, iface, lpMat);
618 *lpMat = This->current_material;
620 if (TRACE_ON(ddraw)) {
621 TRACE(" returning material : \n");
622 dump_D3DMATERIAL7(lpMat);
625 return DD_OK;
628 HRESULT WINAPI
629 Main_IDirect3DDeviceImpl_7_SetLight(LPDIRECT3DDEVICE7 iface,
630 DWORD dwLightIndex,
631 LPD3DLIGHT7 lpLight)
633 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
634 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwLightIndex, lpLight);
635 return DD_OK;
638 HRESULT WINAPI
639 Main_IDirect3DDeviceImpl_7_GetLight(LPDIRECT3DDEVICE7 iface,
640 DWORD dwLightIndex,
641 LPD3DLIGHT7 lpLight)
643 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
644 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwLightIndex, lpLight);
646 if (dwLightIndex > MAX_LIGHTS) return DDERR_INVALIDPARAMS;
647 *lpLight = This->light_parameters[dwLightIndex];
649 if (TRACE_ON(ddraw)) {
650 TRACE(" returning light : \n");
651 dump_D3DLIGHT7(lpLight);
654 return DD_OK;
657 HRESULT WINAPI
658 Main_IDirect3DDeviceImpl_7_3T_2T_SetRenderState(LPDIRECT3DDEVICE7 iface,
659 D3DRENDERSTATETYPE dwRenderStateType,
660 DWORD dwRenderState)
662 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
663 FIXME("(%p/%p)->(%08x,%08lx): stub!\n", This, iface, dwRenderStateType, dwRenderState);
664 return DD_OK;
667 HRESULT WINAPI
668 Main_IDirect3DDeviceImpl_7_3T_2T_GetRenderState(LPDIRECT3DDEVICE7 iface,
669 D3DRENDERSTATETYPE dwRenderStateType,
670 LPDWORD lpdwRenderState)
672 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
673 FIXME("(%p/%p)->(%08x,%p): stub!\n", This, iface, dwRenderStateType, lpdwRenderState);
674 return DD_OK;
677 HRESULT WINAPI
678 Main_IDirect3DDeviceImpl_7_BeginStateBlock(LPDIRECT3DDEVICE7 iface)
680 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
681 FIXME("(%p/%p)->(): stub!\n", This, iface);
682 return DD_OK;
685 HRESULT WINAPI
686 Main_IDirect3DDeviceImpl_7_EndStateBlock(LPDIRECT3DDEVICE7 iface,
687 LPDWORD lpdwBlockHandle)
689 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
690 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpdwBlockHandle);
691 return DD_OK;
694 HRESULT WINAPI
695 Main_IDirect3DDeviceImpl_7_PreLoad(LPDIRECT3DDEVICE7 iface,
696 LPDIRECTDRAWSURFACE7 lpddsTexture)
698 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
699 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpddsTexture);
700 return DD_OK;
703 HRESULT WINAPI
704 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitive(LPDIRECT3DDEVICE7 iface,
705 D3DPRIMITIVETYPE d3dptPrimitiveType,
706 DWORD d3dvtVertexType,
707 LPVOID lpvVertices,
708 DWORD dwVertexCount,
709 DWORD dwFlags)
711 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
712 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwFlags);
713 return DD_OK;
716 HRESULT WINAPI
717 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitive(LPDIRECT3DDEVICE7 iface,
718 D3DPRIMITIVETYPE d3dptPrimitiveType,
719 DWORD d3dvtVertexType,
720 LPVOID lpvVertices,
721 DWORD dwVertexCount,
722 LPWORD dwIndices,
723 DWORD dwIndexCount,
724 DWORD dwFlags)
726 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
727 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwIndices, dwIndexCount, dwFlags);
728 return DD_OK;
731 HRESULT WINAPI
732 Main_IDirect3DDeviceImpl_7_3T_2T_SetClipStatus(LPDIRECT3DDEVICE7 iface,
733 LPD3DCLIPSTATUS lpD3DClipStatus)
735 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
736 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpD3DClipStatus);
737 return DD_OK;
740 HRESULT WINAPI
741 Main_IDirect3DDeviceImpl_7_3T_2T_GetClipStatus(LPDIRECT3DDEVICE7 iface,
742 LPD3DCLIPSTATUS lpD3DClipStatus)
744 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
745 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpD3DClipStatus);
746 return DD_OK;
749 HRESULT WINAPI
750 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitiveStrided(LPDIRECT3DDEVICE7 iface,
751 D3DPRIMITIVETYPE d3dptPrimitiveType,
752 DWORD dwVertexType,
753 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,
754 DWORD dwVertexCount,
755 DWORD dwFlags)
757 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
758 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, dwVertexType, lpD3DDrawPrimStrideData, dwVertexCount, dwFlags);
759 return DD_OK;
762 HRESULT WINAPI
763 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitiveStrided(LPDIRECT3DDEVICE7 iface,
764 D3DPRIMITIVETYPE d3dptPrimitiveType,
765 DWORD dwVertexType,
766 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,
767 DWORD dwVertexCount,
768 LPWORD lpIndex,
769 DWORD dwIndexCount,
770 DWORD dwFlags)
772 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
773 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, dwVertexType, lpD3DDrawPrimStrideData, dwVertexCount, lpIndex, dwIndexCount, dwFlags);
774 return DD_OK;
777 HRESULT WINAPI
778 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitiveVB(LPDIRECT3DDEVICE7 iface,
779 D3DPRIMITIVETYPE d3dptPrimitiveType,
780 LPDIRECT3DVERTEXBUFFER7 lpD3DVertexBuf,
781 DWORD dwStartVertex,
782 DWORD dwNumVertices,
783 DWORD dwFlags)
785 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
786 FIXME("(%p/%p)->(%08x,%p,%08lx,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, lpD3DVertexBuf, dwStartVertex, dwNumVertices, dwFlags);
787 return DD_OK;
790 HRESULT WINAPI
791 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitiveVB(LPDIRECT3DDEVICE7 iface,
792 D3DPRIMITIVETYPE d3dptPrimitiveType,
793 LPDIRECT3DVERTEXBUFFER7 lpD3DVertexBuf,
794 DWORD dwStartVertex,
795 DWORD dwNumVertices,
796 LPWORD lpwIndices,
797 DWORD dwIndexCount,
798 DWORD dwFlags)
800 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
801 FIXME("(%p/%p)->(%08x,%p,%08lx,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, lpD3DVertexBuf, dwStartVertex, dwNumVertices, lpwIndices, dwIndexCount, dwFlags);
802 return DD_OK;
805 HRESULT WINAPI
806 Main_IDirect3DDeviceImpl_7_3T_ComputeSphereVisibility(LPDIRECT3DDEVICE7 iface,
807 LPD3DVECTOR lpCenters,
808 LPD3DVALUE lpRadii,
809 DWORD dwNumSpheres,
810 DWORD dwFlags,
811 LPDWORD lpdwReturnValues)
813 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
814 FIXME("(%p/%p)->(%p,%p,%08lx,%08lx,%p): stub!\n", This, iface, lpCenters, lpRadii, dwNumSpheres, dwFlags, lpdwReturnValues);
815 return DD_OK;
818 HRESULT WINAPI
819 Main_IDirect3DDeviceImpl_7_3T_GetTexture(LPDIRECT3DDEVICE7 iface,
820 DWORD dwStage,
821 LPDIRECTDRAWSURFACE7* lpTexture)
823 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
824 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwStage, lpTexture);
826 if (This->current_texture[dwStage] != NULL) {
827 *lpTexture = ICOM_INTERFACE(This->current_texture[dwStage], IDirectDrawSurface7);
828 IDirectDrawSurface7_AddRef(*lpTexture);
829 } else {
830 *lpTexture = NULL;
833 TRACE(" returning interface at %p (for implementation at %p).\n", *lpTexture, This->current_texture[dwStage]);
835 return DD_OK;
838 HRESULT WINAPI
839 Main_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
840 DWORD dwStage,
841 LPDIRECTDRAWSURFACE7 lpTexture)
843 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
844 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwStage, lpTexture);
845 return DD_OK;
848 HRESULT WINAPI
849 Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState(LPDIRECT3DDEVICE7 iface,
850 DWORD dwStage,
851 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,
852 LPDWORD lpdwState)
854 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
855 TRACE("(%p/%p)->(%08lx,%08x,%p)\n", This, iface, dwStage, d3dTexStageStateType, lpdwState);
856 if (lpdwState && (dwStage < 8) && d3dTexStageStateType && (d3dTexStageStateType <= HIGHEST_TEXTURE_STAGE_STATE) ) {
857 *lpdwState = This->state_block.texture_stage_state[dwStage][d3dTexStageStateType-1];
858 return DD_OK;
860 return DDERR_INVALIDPARAMS;
863 HRESULT WINAPI
864 Main_IDirect3DDeviceImpl_7_3T_SetTextureStageState(LPDIRECT3DDEVICE7 iface,
865 DWORD dwStage,
866 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,
867 DWORD dwState)
869 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
870 FIXME("(%p/%p)->(%08lx,%08x,%08lx): stub!\n", This, iface, dwStage, d3dTexStageStateType, dwState);
871 return DD_OK;
874 HRESULT WINAPI
875 Main_IDirect3DDeviceImpl_7_3T_ValidateDevice(LPDIRECT3DDEVICE7 iface,
876 LPDWORD lpdwPasses)
878 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
879 FIXME("(%p/%p)->(%p): semi-stub!\n", This, iface, lpdwPasses);
881 /* For the moment, we have a VERY good hardware which does everything in one pass :-) */
882 *lpdwPasses = 1;
884 return DD_OK;
887 HRESULT WINAPI
888 Main_IDirect3DDeviceImpl_7_ApplyStateBlock(LPDIRECT3DDEVICE7 iface,
889 DWORD dwBlockHandle)
891 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
892 FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwBlockHandle);
893 return DD_OK;
896 HRESULT WINAPI
897 Main_IDirect3DDeviceImpl_7_CaptureStateBlock(LPDIRECT3DDEVICE7 iface,
898 DWORD dwBlockHandle)
900 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
901 FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwBlockHandle);
902 return DD_OK;
905 HRESULT WINAPI
906 Main_IDirect3DDeviceImpl_7_DeleteStateBlock(LPDIRECT3DDEVICE7 iface,
907 DWORD dwBlockHandle)
909 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
910 FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwBlockHandle);
911 return DD_OK;
914 HRESULT WINAPI
915 Main_IDirect3DDeviceImpl_7_CreateStateBlock(LPDIRECT3DDEVICE7 iface,
916 D3DSTATEBLOCKTYPE d3dsbType,
917 LPDWORD lpdwBlockHandle)
919 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
920 FIXME("(%p/%p)->(%08x,%p): stub!\n", This, iface, d3dsbType, lpdwBlockHandle);
921 return DD_OK;
924 HRESULT WINAPI
925 Main_IDirect3DDeviceImpl_7_Load(LPDIRECT3DDEVICE7 iface,
926 LPDIRECTDRAWSURFACE7 lpDestTex,
927 LPPOINT lpDestPoint,
928 LPDIRECTDRAWSURFACE7 lpSrcTex,
929 LPRECT lprcSrcRect,
930 DWORD dwFlags)
932 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
933 FIXME("(%p/%p)->(%p,%p,%p,%p,%08lx): Partially Implemented!\n", This, iface, lpDestTex, lpDestPoint, lpSrcTex, lprcSrcRect, dwFlags);
934 IDirect3DTexture2_Load(COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirect3DTexture2, lpDestTex),
935 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirect3DTexture2, lpSrcTex));
936 return DD_OK;
939 HRESULT WINAPI
940 Main_IDirect3DDeviceImpl_7_LightEnable(LPDIRECT3DDEVICE7 iface,
941 DWORD dwLightIndex,
942 BOOL bEnable)
944 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
945 FIXME("(%p/%p)->(%08lx,%d): stub!\n", This, iface, dwLightIndex, bEnable);
946 return DD_OK;
949 HRESULT WINAPI
950 Main_IDirect3DDeviceImpl_7_GetLightEnable(LPDIRECT3DDEVICE7 iface,
951 DWORD dwLightIndex,
952 BOOL* pbEnable)
954 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
955 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwLightIndex, pbEnable);
957 if (dwLightIndex > MAX_LIGHTS) *pbEnable = 0;
958 else *pbEnable = ((0x00000001 << dwLightIndex) & This->active_lights) != 0;
960 TRACE(" returning %d.\n", *pbEnable);
962 return DD_OK;
965 HRESULT WINAPI
966 Main_IDirect3DDeviceImpl_7_SetClipPlane(LPDIRECT3DDEVICE7 iface,
967 DWORD dwIndex,
968 D3DVALUE* pPlaneEquation)
970 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
971 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwIndex, pPlaneEquation);
972 return DD_OK;
975 HRESULT WINAPI
976 Main_IDirect3DDeviceImpl_7_GetClipPlane(LPDIRECT3DDEVICE7 iface, DWORD dwIndex, D3DVALUE* pPlaneEquation)
978 IDirect3DDeviceImpl *This = (IDirect3DDeviceImpl *)iface;
980 TRACE("(%p)->(%ld,%p)\n", This, dwIndex, pPlaneEquation);
982 if (dwIndex>=This->max_clipping_planes) {
983 return DDERR_INVALIDPARAMS;
986 memcpy( pPlaneEquation, This->clipping_planes[dwIndex].plane, sizeof(D3DVALUE[4]));
988 return D3D_OK;
991 HRESULT WINAPI
992 Main_IDirect3DDeviceImpl_7_GetInfo(LPDIRECT3DDEVICE7 iface,
993 DWORD dwDevInfoID,
994 LPVOID pDevInfoStruct,
995 DWORD dwSize)
997 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
998 TRACE("(%p/%p)->(%08lx,%p,%08lx)\n", This, iface, dwDevInfoID, pDevInfoStruct, dwSize);
1000 if (TRACE_ON(ddraw)) {
1001 TRACE(" info requested : ");
1002 switch (dwDevInfoID) {
1003 case D3DDEVINFOID_TEXTUREMANAGER: TRACE("D3DDEVINFOID_TEXTUREMANAGER\n"); break;
1004 case D3DDEVINFOID_D3DTEXTUREMANAGER: TRACE("D3DDEVINFOID_D3DTEXTUREMANAGER\n"); break;
1005 case D3DDEVINFOID_TEXTURING: TRACE("D3DDEVINFOID_TEXTURING\n"); break;
1006 default: ERR(" invalid flag !!!\n"); return DDERR_INVALIDPARAMS;
1010 return S_FALSE; /* According to MSDN, this is valid for a non-debug driver */
1013 HRESULT WINAPI
1014 Main_IDirect3DDeviceImpl_3_2T_1T_GetCaps(LPDIRECT3DDEVICE3 iface,
1015 LPD3DDEVICEDESC lpD3DHWDevDesc,
1016 LPD3DDEVICEDESC lpD3DHELDevDesc)
1018 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1019 FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpD3DHWDevDesc, lpD3DHELDevDesc);
1020 return DD_OK;
1023 HRESULT WINAPI
1024 Main_IDirect3DDeviceImpl_3_2T_1T_GetStats(LPDIRECT3DDEVICE3 iface,
1025 LPD3DSTATS lpD3DStats)
1027 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1028 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpD3DStats);
1029 return DD_OK;
1032 HRESULT WINAPI
1033 Main_IDirect3DDeviceImpl_3_2T_1T_AddViewport(LPDIRECT3DDEVICE3 iface,
1034 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3)
1036 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1037 IDirect3DViewportImpl *lpDirect3DViewportImpl = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3);
1039 TRACE("(%p/%p)->(%p)\n", This, iface, lpDirect3DViewport3);
1041 lpDirect3DViewportImpl->next = This->viewport_list;
1042 This->viewport_list = lpDirect3DViewportImpl;
1044 return DD_OK;
1047 HRESULT WINAPI
1048 Main_IDirect3DDeviceImpl_3_2T_1T_DeleteViewport(LPDIRECT3DDEVICE3 iface,
1049 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3)
1051 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1052 IDirect3DViewportImpl *lpDirect3DViewportImpl = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3);
1053 IDirect3DViewportImpl *cur_viewport, *prev_viewport = NULL;
1055 TRACE("(%p/%p)->(%p)\n", This, iface, lpDirect3DViewport3);
1057 cur_viewport = This->viewport_list;
1058 while (cur_viewport != NULL) {
1059 if (cur_viewport == lpDirect3DViewportImpl) {
1060 if (prev_viewport == NULL) This->viewport_list = cur_viewport->next;
1061 else prev_viewport->next = cur_viewport->next;
1062 /* TODO : add desactivate of the viewport and all associated lights... */
1063 return DD_OK;
1065 prev_viewport = cur_viewport;
1066 cur_viewport = cur_viewport->next;
1069 return DDERR_INVALIDPARAMS;
1072 HRESULT WINAPI
1073 Main_IDirect3DDeviceImpl_3_2T_1T_NextViewport(LPDIRECT3DDEVICE3 iface,
1074 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3,
1075 LPDIRECT3DVIEWPORT3* lplpDirect3DViewport3,
1076 DWORD dwFlags)
1078 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1079 IDirect3DViewportImpl *res = NULL;
1081 TRACE("(%p/%p)->(%p,%p,%08lx)\n", This, iface, lpDirect3DViewport3, lplpDirect3DViewport3, dwFlags);
1083 switch (dwFlags) {
1084 case D3DNEXT_NEXT: {
1085 IDirect3DViewportImpl *lpDirect3DViewportImpl = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3);
1086 res = lpDirect3DViewportImpl->next;
1087 } break;
1088 case D3DNEXT_HEAD: {
1089 res = This->viewport_list;
1090 } break;
1091 case D3DNEXT_TAIL: {
1092 IDirect3DViewportImpl *cur_viewport = This->viewport_list;
1093 if (cur_viewport != NULL) {
1094 while (cur_viewport->next != NULL) cur_viewport = cur_viewport->next;
1096 res = cur_viewport;
1097 } break;
1098 default:
1099 *lplpDirect3DViewport3 = NULL;
1100 return DDERR_INVALIDPARAMS;
1102 *lplpDirect3DViewport3 = ICOM_INTERFACE(res, IDirect3DViewport3);
1103 return DD_OK;
1106 HRESULT WINAPI
1107 Main_IDirect3DDeviceImpl_3_2T_SetCurrentViewport(LPDIRECT3DDEVICE3 iface,
1108 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3)
1110 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1111 TRACE("(%p/%p)->(%p)\n", This, iface, lpDirect3DViewport3);
1113 /* Do nothing if the specified viewport is the same as the current one */
1114 if (This->current_viewport == ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3))
1115 return DD_OK;
1117 /* Should check if the viewport was added or not */
1119 /* Release previous viewport and AddRef the new one */
1120 if (This->current_viewport)
1121 IDirect3DViewport3_Release(ICOM_INTERFACE(This->current_viewport, IDirect3DViewport3));
1122 IDirect3DViewport3_AddRef(lpDirect3DViewport3);
1124 /* Set this viewport as the current viewport */
1125 This->current_viewport = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3);
1127 /* Activate this viewport */
1128 This->current_viewport->active_device = This;
1129 This->current_viewport->activate(This->current_viewport);
1131 return DD_OK;
1134 HRESULT WINAPI
1135 Main_IDirect3DDeviceImpl_3_2T_GetCurrentViewport(LPDIRECT3DDEVICE3 iface,
1136 LPDIRECT3DVIEWPORT3* lplpDirect3DViewport3)
1138 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1139 TRACE("(%p/%p)->(%p)\n", This, iface, lplpDirect3DViewport3);
1141 *lplpDirect3DViewport3 = ICOM_INTERFACE(This->current_viewport, IDirect3DViewport3);
1143 /* AddRef the returned viewport */
1144 IDirect3DViewport3_AddRef(*lplpDirect3DViewport3);
1146 TRACE(" returning interface %p\n", *lplpDirect3DViewport3);
1148 return DD_OK;
1151 HRESULT WINAPI
1152 Main_IDirect3DDeviceImpl_3_Begin(LPDIRECT3DDEVICE3 iface,
1153 D3DPRIMITIVETYPE d3dptPrimitiveType,
1154 DWORD dwVertexTypeDesc,
1155 DWORD dwFlags)
1157 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1158 FIXME("(%p/%p)->(%08x,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, dwVertexTypeDesc, dwFlags);
1159 return DD_OK;
1162 HRESULT WINAPI
1163 Main_IDirect3DDeviceImpl_3_BeginIndexed(LPDIRECT3DDEVICE3 iface,
1164 D3DPRIMITIVETYPE d3dptPrimitiveType,
1165 DWORD d3dvtVertexType,
1166 LPVOID lpvVertices,
1167 DWORD dwNumVertices,
1168 DWORD dwFlags)
1170 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1171 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwNumVertices, dwFlags);
1172 return DD_OK;
1175 HRESULT WINAPI
1176 Main_IDirect3DDeviceImpl_3_2T_Vertex(LPDIRECT3DDEVICE3 iface,
1177 LPVOID lpVertexType)
1179 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1180 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpVertexType);
1181 return DD_OK;
1184 HRESULT WINAPI
1185 Main_IDirect3DDeviceImpl_3_2T_Index(LPDIRECT3DDEVICE3 iface,
1186 WORD wVertexIndex)
1188 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1189 FIXME("(%p/%p)->(%04x): stub!\n", This, iface, wVertexIndex);
1190 return DD_OK;
1193 HRESULT WINAPI
1194 Main_IDirect3DDeviceImpl_3_2T_End(LPDIRECT3DDEVICE3 iface,
1195 DWORD dwFlags)
1197 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1198 FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwFlags);
1199 return DD_OK;
1202 HRESULT WINAPI
1203 Main_IDirect3DDeviceImpl_3_2T_GetLightState(LPDIRECT3DDEVICE3 iface,
1204 D3DLIGHTSTATETYPE dwLightStateType,
1205 LPDWORD lpdwLightState)
1207 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1208 FIXME("(%p/%p)->(%08x,%p): stub !\n", This, iface, dwLightStateType, lpdwLightState);
1209 return DD_OK;
1212 HRESULT WINAPI
1213 Main_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface,
1214 D3DLIGHTSTATETYPE dwLightStateType,
1215 DWORD dwLightState)
1217 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1218 FIXME("(%p/%p)->(%08x,%08lx): stub!\n", This, iface, dwLightStateType, dwLightState);
1219 return DD_OK;
1222 HRESULT WINAPI
1223 Main_IDirect3DDeviceImpl_2_1T_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
1224 LPDIRECT3DTEXTURE2 lpD3DTex1,
1225 LPDIRECT3DTEXTURE2 lpD3DTex2)
1227 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1228 IDirectDrawSurfaceImpl tmp,*surf1,*surf2;
1229 TRACE("(%p/%p)->(%p,%p):\n", This, iface, lpD3DTex1, lpD3DTex2);
1231 surf1 = ICOM_OBJECT(IDirectDrawSurfaceImpl,IDirect3DTexture2,lpD3DTex1);
1232 surf2 = ICOM_OBJECT(IDirectDrawSurfaceImpl,IDirect3DTexture2,lpD3DTex2);
1233 tmp = *surf1;
1234 *surf1 = *surf2;
1235 *surf2 = tmp;
1237 return DD_OK;
1240 HRESULT WINAPI
1241 Main_IDirect3DDeviceImpl_2_NextViewport(LPDIRECT3DDEVICE2 iface,
1242 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2,
1243 LPDIRECT3DVIEWPORT2* lplpDirect3DViewport2,
1244 DWORD dwFlags)
1246 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1247 FIXME("(%p/%p)->(%p,%p,%08lx): stub!\n", This, iface, lpDirect3DViewport2, lplpDirect3DViewport2, dwFlags);
1248 return DD_OK;
1251 HRESULT WINAPI
1252 Main_IDirect3DDeviceImpl_2_1T_EnumTextureFormats(LPDIRECT3DDEVICE2 iface,
1253 LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc,
1254 LPVOID lpArg)
1256 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1257 FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpD3DEnumTextureProc, lpArg);
1258 return DD_OK;
1261 HRESULT WINAPI
1262 Main_IDirect3DDeviceImpl_2_Begin(LPDIRECT3DDEVICE2 iface,
1263 D3DPRIMITIVETYPE d3dpt,
1264 D3DVERTEXTYPE dwVertexTypeDesc,
1265 DWORD dwFlags)
1267 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1268 FIXME("(%p/%p)->(%08x,%08x,%08lx): stub!\n", This, iface, d3dpt, dwVertexTypeDesc, dwFlags);
1269 return DD_OK;
1272 HRESULT WINAPI
1273 Main_IDirect3DDeviceImpl_2_BeginIndexed(LPDIRECT3DDEVICE2 iface,
1274 D3DPRIMITIVETYPE d3dptPrimitiveType,
1275 D3DVERTEXTYPE d3dvtVertexType,
1276 LPVOID lpvVertices,
1277 DWORD dwNumVertices,
1278 DWORD dwFlags)
1280 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1281 FIXME("(%p/%p)->(%08x,%08x,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwNumVertices, dwFlags);
1282 return DD_OK;
1285 HRESULT WINAPI
1286 Main_IDirect3DDeviceImpl_2_DrawPrimitive(LPDIRECT3DDEVICE2 iface,
1287 D3DPRIMITIVETYPE d3dptPrimitiveType,
1288 D3DVERTEXTYPE d3dvtVertexType,
1289 LPVOID lpvVertices,
1290 DWORD dwVertexCount,
1291 DWORD dwFlags)
1293 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1294 FIXME("(%p/%p)->(%08x,%08x,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwFlags);
1295 return DD_OK;
1298 HRESULT WINAPI
1299 Main_IDirect3DDeviceImpl_2_DrawIndexedPrimitive(LPDIRECT3DDEVICE2 iface,
1300 D3DPRIMITIVETYPE d3dptPrimitiveType,
1301 D3DVERTEXTYPE d3dvtVertexType,
1302 LPVOID lpvVertices,
1303 DWORD dwVertexCount,
1304 LPWORD dwIndices,
1305 DWORD dwIndexCount,
1306 DWORD dwFlags)
1308 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1309 FIXME("(%p/%p)->(%08x,%08x,%p,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwIndices, dwIndexCount, dwFlags);
1310 return DD_OK;
1313 HRESULT WINAPI
1314 Main_IDirect3DDeviceImpl_1_Initialize(LPDIRECT3DDEVICE iface,
1315 LPDIRECT3D lpDirect3D,
1316 LPGUID lpGUID,
1317 LPD3DDEVICEDESC lpD3DDVDesc)
1319 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1320 FIXME("(%p/%p)->(%p,%p,%p): stub!\n", This, iface, lpDirect3D, lpGUID, lpD3DDVDesc);
1321 return DD_OK;
1324 HRESULT WINAPI
1325 Main_IDirect3DDeviceImpl_1_CreateExecuteBuffer(LPDIRECT3DDEVICE iface,
1326 LPD3DEXECUTEBUFFERDESC lpDesc,
1327 LPDIRECT3DEXECUTEBUFFER* lplpDirect3DExecuteBuffer,
1328 IUnknown* pUnkOuter)
1330 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1331 FIXME("(%p/%p)->(%p,%p,%p): stub!\n", This, iface, lpDesc, lplpDirect3DExecuteBuffer, pUnkOuter);
1332 return DD_OK;
1335 HRESULT WINAPI
1336 Main_IDirect3DDeviceImpl_1_Execute(LPDIRECT3DDEVICE iface,
1337 LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer,
1338 LPDIRECT3DVIEWPORT lpDirect3DViewport,
1339 DWORD dwFlags)
1341 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1342 IDirect3DExecuteBufferImpl *lpDirect3DExecuteBufferImpl = ICOM_OBJECT(IDirect3DExecuteBufferImpl, IDirect3DExecuteBuffer, lpDirect3DExecuteBuffer);
1343 IDirect3DViewportImpl *lpDirect3DViewportImpl = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport);
1345 TRACE("(%p/%p)->(%p,%p,%08lx)\n", This, iface, lpDirect3DExecuteBuffer, lpDirect3DViewport, dwFlags);
1347 /* Put this as the default context */
1349 /* Execute... */
1350 lpDirect3DExecuteBufferImpl->execute(lpDirect3DExecuteBufferImpl, This, lpDirect3DViewportImpl);
1352 return DD_OK;
1355 HRESULT WINAPI
1356 Main_IDirect3DDeviceImpl_1_NextViewport(LPDIRECT3DDEVICE iface,
1357 LPDIRECT3DVIEWPORT lpDirect3DViewport,
1358 LPDIRECT3DVIEWPORT* lplpDirect3DViewport,
1359 DWORD dwFlags)
1361 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1362 FIXME("(%p/%p)->(%p,%p,%08lx): stub!\n", This, iface, lpDirect3DViewport, lplpDirect3DViewport, dwFlags);
1363 return DD_OK;
1366 HRESULT WINAPI
1367 Main_IDirect3DDeviceImpl_1_Pick(LPDIRECT3DDEVICE iface,
1368 LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer,
1369 LPDIRECT3DVIEWPORT lpDirect3DViewport,
1370 DWORD dwFlags,
1371 LPD3DRECT lpRect)
1373 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1374 FIXME("(%p/%p)->(%p,%p,%08lx,%p): stub!\n", This, iface, lpDirect3DExecuteBuffer, lpDirect3DViewport, dwFlags, lpRect);
1375 return DD_OK;
1378 HRESULT WINAPI
1379 Main_IDirect3DDeviceImpl_1_GetPickRecords(LPDIRECT3DDEVICE iface,
1380 LPDWORD lpCount,
1381 LPD3DPICKRECORD lpD3DPickRec)
1383 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1384 FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpCount, lpD3DPickRec);
1385 return DD_OK;
1388 HRESULT WINAPI
1389 Main_IDirect3DDeviceImpl_1_CreateMatrix(LPDIRECT3DDEVICE iface,
1390 LPD3DMATRIXHANDLE lpD3DMatHandle)
1392 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1393 TRACE("(%p/%p)->(%p)\n", This, iface, lpD3DMatHandle);
1395 *lpD3DMatHandle = (D3DMATRIXHANDLE) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(D3DMATRIX));
1396 TRACE(" returning matrix handle %p\n", (void *) *lpD3DMatHandle);
1398 return DD_OK;
1401 HRESULT WINAPI
1402 Main_IDirect3DDeviceImpl_1_SetMatrix(LPDIRECT3DDEVICE iface,
1403 D3DMATRIXHANDLE D3DMatHandle,
1404 LPD3DMATRIX lpD3DMatrix)
1406 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1407 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, (DWORD) D3DMatHandle, lpD3DMatrix);
1409 if (TRACE_ON(ddraw)) {
1410 dump_D3DMATRIX(lpD3DMatrix);
1412 *((D3DMATRIX *) D3DMatHandle) = *lpD3DMatrix;
1414 return DD_OK;
1417 HRESULT WINAPI
1418 Main_IDirect3DDeviceImpl_1_GetMatrix(LPDIRECT3DDEVICE iface,
1419 D3DMATRIXHANDLE D3DMatHandle,
1420 LPD3DMATRIX lpD3DMatrix)
1422 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1423 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, (DWORD) D3DMatHandle, lpD3DMatrix);
1425 *lpD3DMatrix = *((D3DMATRIX *) D3DMatHandle);
1427 return DD_OK;
1430 HRESULT WINAPI
1431 Main_IDirect3DDeviceImpl_1_DeleteMatrix(LPDIRECT3DDEVICE iface,
1432 D3DMATRIXHANDLE D3DMatHandle)
1434 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1435 TRACE("(%p/%p)->(%08lx)\n", This, iface, (DWORD) D3DMatHandle);
1437 HeapFree(GetProcessHeap(), 0, (void *) D3DMatHandle);
1439 return DD_OK;
1442 HRESULT WINAPI
1443 Thunk_IDirect3DDeviceImpl_3_QueryInterface(LPDIRECT3DDEVICE3 iface,
1444 REFIID riid,
1445 LPVOID* obp)
1447 TRACE("(%p)->(%s,%p) thunking to IDirect3DDevice7 interface.\n", iface, debugstr_guid(riid), obp);
1448 return IDirect3DDevice7_QueryInterface(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1449 riid,
1450 obp);
1453 HRESULT WINAPI
1454 Thunk_IDirect3DDeviceImpl_2_QueryInterface(LPDIRECT3DDEVICE2 iface,
1455 REFIID riid,
1456 LPVOID* obp)
1458 TRACE("(%p)->(%s,%p) thunking to IDirect3DDevice7 interface.\n", iface, debugstr_guid(riid), obp);
1459 return IDirect3DDevice7_QueryInterface(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1460 riid,
1461 obp);
1464 HRESULT WINAPI
1465 Thunk_IDirect3DDeviceImpl_1_QueryInterface(LPDIRECT3DDEVICE iface,
1466 REFIID riid,
1467 LPVOID* obp)
1469 TRACE("(%p)->(%s,%p) thunking to IDirect3DDevice7 interface.\n", iface, debugstr_guid(riid), obp);
1470 return IDirect3DDevice7_QueryInterface(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface),
1471 riid,
1472 obp);
1475 ULONG WINAPI
1476 Thunk_IDirect3DDeviceImpl_3_AddRef(LPDIRECT3DDEVICE3 iface)
1478 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1479 return IDirect3DDevice7_AddRef(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface));
1482 ULONG WINAPI
1483 Thunk_IDirect3DDeviceImpl_2_AddRef(LPDIRECT3DDEVICE2 iface)
1485 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1486 return IDirect3DDevice7_AddRef(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface));
1489 ULONG WINAPI
1490 Thunk_IDirect3DDeviceImpl_1_AddRef(LPDIRECT3DDEVICE iface)
1492 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1493 return IDirect3DDevice7_AddRef(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface));
1496 ULONG WINAPI
1497 Thunk_IDirect3DDeviceImpl_3_Release(LPDIRECT3DDEVICE3 iface)
1499 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1500 return IDirect3DDevice7_Release(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface));
1503 ULONG WINAPI
1504 Thunk_IDirect3DDeviceImpl_2_Release(LPDIRECT3DDEVICE2 iface)
1506 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1507 return IDirect3DDevice7_Release(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface));
1510 ULONG WINAPI
1511 Thunk_IDirect3DDeviceImpl_1_Release(LPDIRECT3DDEVICE iface)
1513 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1514 return IDirect3DDevice7_Release(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface));
1517 HRESULT WINAPI
1518 Thunk_IDirect3DDeviceImpl_2_AddViewport(LPDIRECT3DDEVICE2 iface,
1519 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2)
1521 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport2);
1522 return IDirect3DDevice3_AddViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1523 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */);
1526 HRESULT WINAPI
1527 Thunk_IDirect3DDeviceImpl_1_AddViewport(LPDIRECT3DDEVICE iface,
1528 LPDIRECT3DVIEWPORT lpDirect3DViewport)
1530 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport);
1531 return IDirect3DDevice3_AddViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
1532 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport /* No need to cast here as all interfaces are equivalent */);
1535 HRESULT WINAPI
1536 Thunk_IDirect3DDeviceImpl_2_DeleteViewport(LPDIRECT3DDEVICE2 iface,
1537 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2)
1539 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport2);
1540 return IDirect3DDevice3_DeleteViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1541 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */);
1544 HRESULT WINAPI
1545 Thunk_IDirect3DDeviceImpl_1_DeleteViewport(LPDIRECT3DDEVICE iface,
1546 LPDIRECT3DVIEWPORT lpDirect3DViewport)
1548 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport);
1549 return IDirect3DDevice3_DeleteViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
1550 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport /* No need to cast here as all interfaces are equivalent */);
1553 HRESULT WINAPI
1554 Thunk_IDirect3DDeviceImpl_2_NextViewport(LPDIRECT3DDEVICE3 iface,
1555 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2,
1556 LPDIRECT3DVIEWPORT2* lplpDirect3DViewport2,
1557 DWORD dwFlags)
1559 TRACE("(%p)->(%p,%p,%08lx) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport2, lplpDirect3DViewport2, dwFlags);
1560 return IDirect3DDevice3_NextViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1561 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */,
1562 (LPDIRECT3DVIEWPORT3*) lplpDirect3DViewport2,
1563 dwFlags);
1566 HRESULT WINAPI
1567 Thunk_IDirect3DDeviceImpl_1_NextViewport(LPDIRECT3DDEVICE3 iface,
1568 LPDIRECT3DVIEWPORT lpDirect3DViewport,
1569 LPDIRECT3DVIEWPORT* lplpDirect3DViewport,
1570 DWORD dwFlags)
1572 TRACE("(%p)->(%p,%p,%08lx) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport, lplpDirect3DViewport, dwFlags);
1573 return IDirect3DDevice3_NextViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
1574 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport /* No need to cast here as all interfaces are equivalent */,
1575 (LPDIRECT3DVIEWPORT3*) lplpDirect3DViewport,
1576 dwFlags);
1579 HRESULT WINAPI
1580 Thunk_IDirect3DDeviceImpl_3_GetDirect3D(LPDIRECT3DDEVICE3 iface,
1581 LPDIRECT3D3* lplpDirect3D3)
1583 HRESULT ret;
1584 LPDIRECT3D7 ret_ptr;
1586 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpDirect3D3);
1587 ret = IDirect3DDevice7_GetDirect3D(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1588 &ret_ptr);
1589 *lplpDirect3D3 = COM_INTERFACE_CAST(IDirectDrawImpl, IDirect3D7, IDirect3D3, ret_ptr);
1590 TRACE(" returning interface %p\n", *lplpDirect3D3);
1591 return ret;
1594 HRESULT WINAPI
1595 Thunk_IDirect3DDeviceImpl_2_GetDirect3D(LPDIRECT3DDEVICE2 iface,
1596 LPDIRECT3D2* lplpDirect3D2)
1598 HRESULT ret;
1599 LPDIRECT3D7 ret_ptr;
1601 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpDirect3D2);
1602 ret = IDirect3DDevice7_GetDirect3D(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1603 &ret_ptr);
1604 *lplpDirect3D2 = COM_INTERFACE_CAST(IDirectDrawImpl, IDirect3D7, IDirect3D2, ret_ptr);
1605 TRACE(" returning interface %p\n", *lplpDirect3D2);
1606 return ret;
1609 HRESULT WINAPI
1610 Thunk_IDirect3DDeviceImpl_1_GetDirect3D(LPDIRECT3DDEVICE iface,
1611 LPDIRECT3D* lplpDirect3D)
1613 HRESULT ret;
1614 LPDIRECT3D7 ret_ptr;
1616 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpDirect3D);
1617 ret = IDirect3DDevice7_GetDirect3D(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface),
1618 &ret_ptr);
1619 *lplpDirect3D = COM_INTERFACE_CAST(IDirectDrawImpl, IDirect3D7, IDirect3D, ret_ptr);
1620 TRACE(" returning interface %p\n", *lplpDirect3D);
1621 return ret;
1624 HRESULT WINAPI
1625 Thunk_IDirect3DDeviceImpl_2_SetCurrentViewport(LPDIRECT3DDEVICE2 iface,
1626 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2)
1628 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport2);
1629 return IDirect3DDevice3_SetCurrentViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1630 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */);
1633 HRESULT WINAPI
1634 Thunk_IDirect3DDeviceImpl_2_GetCurrentViewport(LPDIRECT3DDEVICE2 iface,
1635 LPDIRECT3DVIEWPORT2* lplpDirect3DViewport2)
1637 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lplpDirect3DViewport2);
1638 return IDirect3DDevice3_GetCurrentViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1639 (LPDIRECT3DVIEWPORT3*) lplpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */);
1642 HRESULT WINAPI
1643 Thunk_IDirect3DDeviceImpl_3_EnumTextureFormats(LPDIRECT3DDEVICE3 iface,
1644 LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc,
1645 LPVOID lpArg)
1647 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DEnumPixelProc, lpArg);
1648 return IDirect3DDevice7_EnumTextureFormats(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1649 lpD3DEnumPixelProc,
1650 lpArg);
1653 HRESULT WINAPI
1654 Thunk_IDirect3DDeviceImpl_3_BeginScene(LPDIRECT3DDEVICE3 iface)
1656 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1657 return IDirect3DDevice7_BeginScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface));
1660 HRESULT WINAPI
1661 Thunk_IDirect3DDeviceImpl_2_BeginScene(LPDIRECT3DDEVICE2 iface)
1663 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1664 return IDirect3DDevice7_BeginScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface));
1667 HRESULT WINAPI
1668 Thunk_IDirect3DDeviceImpl_1_BeginScene(LPDIRECT3DDEVICE iface)
1670 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1671 return IDirect3DDevice7_BeginScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface));
1674 HRESULT WINAPI
1675 Thunk_IDirect3DDeviceImpl_3_EndScene(LPDIRECT3DDEVICE3 iface)
1677 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1678 return IDirect3DDevice7_EndScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface));
1681 HRESULT WINAPI
1682 Thunk_IDirect3DDeviceImpl_2_EndScene(LPDIRECT3DDEVICE2 iface)
1684 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1685 return IDirect3DDevice7_EndScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface));
1688 HRESULT WINAPI
1689 Thunk_IDirect3DDeviceImpl_1_EndScene(LPDIRECT3DDEVICE iface)
1691 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1692 return IDirect3DDevice7_EndScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface));
1695 HRESULT WINAPI
1696 Thunk_IDirect3DDeviceImpl_3_SetTransform(LPDIRECT3DDEVICE3 iface,
1697 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1698 LPD3DMATRIX lpD3DMatrix)
1700 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1701 return IDirect3DDevice7_SetTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1702 dtstTransformStateType,
1703 lpD3DMatrix);
1706 HRESULT WINAPI
1707 Thunk_IDirect3DDeviceImpl_2_SetTransform(LPDIRECT3DDEVICE2 iface,
1708 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1709 LPD3DMATRIX lpD3DMatrix)
1711 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1712 return IDirect3DDevice7_SetTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1713 dtstTransformStateType,
1714 lpD3DMatrix);
1717 HRESULT WINAPI
1718 Thunk_IDirect3DDeviceImpl_3_GetTransform(LPDIRECT3DDEVICE3 iface,
1719 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1720 LPD3DMATRIX lpD3DMatrix)
1722 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1723 return IDirect3DDevice7_GetTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1724 dtstTransformStateType,
1725 lpD3DMatrix);
1728 HRESULT WINAPI
1729 Thunk_IDirect3DDeviceImpl_2_GetTransform(LPDIRECT3DDEVICE2 iface,
1730 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1731 LPD3DMATRIX lpD3DMatrix)
1733 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1734 return IDirect3DDevice7_GetTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1735 dtstTransformStateType,
1736 lpD3DMatrix);
1739 HRESULT WINAPI
1740 Thunk_IDirect3DDeviceImpl_3_MultiplyTransform(LPDIRECT3DDEVICE3 iface,
1741 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1742 LPD3DMATRIX lpD3DMatrix)
1744 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1745 return IDirect3DDevice7_MultiplyTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1746 dtstTransformStateType,
1747 lpD3DMatrix);
1750 HRESULT WINAPI
1751 Thunk_IDirect3DDeviceImpl_2_MultiplyTransform(LPDIRECT3DDEVICE2 iface,
1752 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1753 LPD3DMATRIX lpD3DMatrix)
1755 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1756 return IDirect3DDevice7_MultiplyTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1757 dtstTransformStateType,
1758 lpD3DMatrix);
1761 HRESULT WINAPI
1762 Thunk_IDirect3DDeviceImpl_3_SetRenderState(LPDIRECT3DDEVICE3 iface,
1763 D3DRENDERSTATETYPE dwRenderStateType,
1764 DWORD dwRenderState)
1766 TRACE("(%p)->(%08x,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, dwRenderStateType, dwRenderState);
1767 return IDirect3DDevice7_SetRenderState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1768 dwRenderStateType,
1769 dwRenderState);
1772 HRESULT WINAPI
1773 Thunk_IDirect3DDeviceImpl_2_SetRenderState(LPDIRECT3DDEVICE2 iface,
1774 D3DRENDERSTATETYPE dwRenderStateType,
1775 DWORD dwRenderState)
1777 TRACE("(%p)->(%08x,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, dwRenderStateType, dwRenderState);
1778 return IDirect3DDevice7_SetRenderState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1779 dwRenderStateType,
1780 dwRenderState);
1783 HRESULT WINAPI
1784 Thunk_IDirect3DDeviceImpl_3_GetRenderState(LPDIRECT3DDEVICE3 iface,
1785 D3DRENDERSTATETYPE dwRenderStateType,
1786 LPDWORD lpdwRenderState)
1788 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwRenderStateType, lpdwRenderState);
1789 return IDirect3DDevice7_GetRenderState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1790 dwRenderStateType,
1791 lpdwRenderState);
1794 HRESULT WINAPI
1795 Thunk_IDirect3DDeviceImpl_2_GetRenderState(LPDIRECT3DDEVICE2 iface,
1796 D3DRENDERSTATETYPE dwRenderStateType,
1797 LPDWORD lpdwRenderState)
1799 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwRenderStateType, lpdwRenderState);
1800 return IDirect3DDevice7_GetRenderState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1801 dwRenderStateType,
1802 lpdwRenderState);
1805 HRESULT WINAPI
1806 Thunk_IDirect3DDeviceImpl_3_DrawPrimitive(LPDIRECT3DDEVICE3 iface,
1807 D3DPRIMITIVETYPE d3dptPrimitiveType,
1808 DWORD d3dvtVertexType,
1809 LPVOID lpvVertices,
1810 DWORD dwVertexCount,
1811 DWORD dwFlags)
1813 TRACE("(%p)->(%08x,%08lx,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwFlags);
1814 return IDirect3DDevice7_DrawPrimitive(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1815 d3dptPrimitiveType,
1816 d3dvtVertexType,
1817 lpvVertices,
1818 dwVertexCount,
1819 dwFlags);
1822 HRESULT WINAPI
1823 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitive(LPDIRECT3DDEVICE3 iface,
1824 D3DPRIMITIVETYPE d3dptPrimitiveType,
1825 DWORD d3dvtVertexType,
1826 LPVOID lpvVertices,
1827 DWORD dwVertexCount,
1828 LPWORD dwIndices,
1829 DWORD dwIndexCount,
1830 DWORD dwFlags)
1832 TRACE("(%p)->(%08x,%08lx,%p,%08lx,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwIndices, dwIndexCount, dwFlags);
1833 return IDirect3DDevice7_DrawIndexedPrimitive(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1834 d3dptPrimitiveType,
1835 d3dvtVertexType,
1836 lpvVertices,
1837 dwVertexCount,
1838 dwIndices,
1839 dwIndexCount,
1840 dwFlags);
1843 HRESULT WINAPI
1844 Thunk_IDirect3DDeviceImpl_3_SetClipStatus(LPDIRECT3DDEVICE3 iface,
1845 LPD3DCLIPSTATUS lpD3DClipStatus)
1847 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DClipStatus);
1848 return IDirect3DDevice7_SetClipStatus(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1849 lpD3DClipStatus);
1852 HRESULT WINAPI
1853 Thunk_IDirect3DDeviceImpl_2_SetClipStatus(LPDIRECT3DDEVICE2 iface,
1854 LPD3DCLIPSTATUS lpD3DClipStatus)
1856 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DClipStatus);
1857 return IDirect3DDevice7_SetClipStatus(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1858 lpD3DClipStatus);
1861 HRESULT WINAPI
1862 Thunk_IDirect3DDeviceImpl_3_GetClipStatus(LPDIRECT3DDEVICE3 iface,
1863 LPD3DCLIPSTATUS lpD3DClipStatus)
1865 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DClipStatus);
1866 return IDirect3DDevice7_GetClipStatus(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1867 lpD3DClipStatus);
1870 HRESULT WINAPI
1871 Thunk_IDirect3DDeviceImpl_2_GetClipStatus(LPDIRECT3DDEVICE2 iface,
1872 LPD3DCLIPSTATUS lpD3DClipStatus)
1874 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DClipStatus);
1875 return IDirect3DDevice7_GetClipStatus(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1876 lpD3DClipStatus);
1879 HRESULT WINAPI
1880 Thunk_IDirect3DDeviceImpl_3_DrawPrimitiveStrided(LPDIRECT3DDEVICE3 iface,
1881 D3DPRIMITIVETYPE d3dptPrimitiveType,
1882 DWORD dwVertexType,
1883 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,
1884 DWORD dwVertexCount,
1885 DWORD dwFlags)
1887 TRACE("(%p)->(%08x,%08lx,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, d3dptPrimitiveType, dwVertexType, lpD3DDrawPrimStrideData, dwVertexCount, dwFlags);
1888 return IDirect3DDevice7_DrawPrimitiveStrided(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1889 d3dptPrimitiveType,
1890 dwVertexType,
1891 lpD3DDrawPrimStrideData,
1892 dwVertexCount,
1893 dwFlags);
1896 HRESULT WINAPI
1897 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveStrided(LPDIRECT3DDEVICE3 iface,
1898 D3DPRIMITIVETYPE d3dptPrimitiveType,
1899 DWORD dwVertexType,
1900 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,
1901 DWORD dwVertexCount,
1902 LPWORD lpIndex,
1903 DWORD dwIndexCount,
1904 DWORD dwFlags)
1906 TRACE("(%p)->(%08x,%08lx,%p,%08lx,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, d3dptPrimitiveType, dwVertexType, lpD3DDrawPrimStrideData, dwVertexCount, lpIndex, dwIndexCount, dwFlags);
1907 return IDirect3DDevice7_DrawIndexedPrimitiveStrided(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1908 d3dptPrimitiveType,
1909 dwVertexType,
1910 lpD3DDrawPrimStrideData,
1911 dwVertexCount,
1912 lpIndex,
1913 dwIndexCount,
1914 dwFlags);
1917 HRESULT WINAPI
1918 Thunk_IDirect3DDeviceImpl_3_ComputeSphereVisibility(LPDIRECT3DDEVICE3 iface,
1919 LPD3DVECTOR lpCenters,
1920 LPD3DVALUE lpRadii,
1921 DWORD dwNumSpheres,
1922 DWORD dwFlags,
1923 LPDWORD lpdwReturnValues)
1925 TRACE("(%p)->(%p,%p,%08lx,%08lx,%p) thunking to IDirect3DDevice7 interface.\n", iface, lpCenters, lpRadii, dwNumSpheres, dwFlags, lpdwReturnValues);
1926 return IDirect3DDevice7_ComputeSphereVisibility(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1927 lpCenters,
1928 lpRadii,
1929 dwNumSpheres,
1930 dwFlags,
1931 lpdwReturnValues);
1934 HRESULT WINAPI
1935 Thunk_IDirect3DDeviceImpl_3_GetTextureStageState(LPDIRECT3DDEVICE3 iface,
1936 DWORD dwStage,
1937 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,
1938 LPDWORD lpdwState)
1940 TRACE("(%p)->(%08lx,%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, d3dTexStageStateType, lpdwState);
1941 return IDirect3DDevice7_GetTextureStageState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1942 dwStage,
1943 d3dTexStageStateType,
1944 lpdwState);
1947 HRESULT WINAPI
1948 Thunk_IDirect3DDeviceImpl_3_SetTextureStageState(LPDIRECT3DDEVICE3 iface,
1949 DWORD dwStage,
1950 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,
1951 DWORD dwState)
1953 TRACE("(%p)->(%08lx,%08x,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, d3dTexStageStateType, dwState);
1954 return IDirect3DDevice7_SetTextureStageState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1955 dwStage,
1956 d3dTexStageStateType,
1957 dwState);
1960 HRESULT WINAPI
1961 Thunk_IDirect3DDeviceImpl_3_ValidateDevice(LPDIRECT3DDEVICE3 iface,
1962 LPDWORD lpdwPasses)
1964 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpdwPasses);
1965 return IDirect3DDevice7_ValidateDevice(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1966 lpdwPasses);
1969 HRESULT WINAPI
1970 Thunk_IDirect3DDeviceImpl_2_GetCaps(LPDIRECT3DDEVICE2 iface,
1971 LPD3DDEVICEDESC lpD3DHWDevDesc,
1972 LPD3DDEVICEDESC lpD3DHELDevDesc)
1974 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice3 interface.\n", iface, lpD3DHWDevDesc, lpD3DHELDevDesc);
1975 return IDirect3DDevice3_GetCaps(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1976 lpD3DHWDevDesc,
1977 lpD3DHELDevDesc);
1980 HRESULT WINAPI
1981 Thunk_IDirect3DDeviceImpl_1_GetCaps(LPDIRECT3DDEVICE iface,
1982 LPD3DDEVICEDESC lpD3DHWDevDesc,
1983 LPD3DDEVICEDESC lpD3DHELDevDesc)
1985 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice3 interface.\n", iface, lpD3DHWDevDesc, lpD3DHELDevDesc);
1986 return IDirect3DDevice3_GetCaps(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
1987 lpD3DHWDevDesc,
1988 lpD3DHELDevDesc);
1991 HRESULT WINAPI
1992 Thunk_IDirect3DDeviceImpl_1_SwapTextureHandles(LPDIRECT3DDEVICE iface,
1993 LPDIRECT3DTEXTURE lpD3DTex1,
1994 LPDIRECT3DTEXTURE lpD3DTex2)
1996 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice2 interface.\n", iface, lpD3DTex1, lpD3DTex2);
1997 return IDirect3DDevice2_SwapTextureHandles(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice2, iface),
1998 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture, IDirect3DTexture2, lpD3DTex1),
1999 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture, IDirect3DTexture2, lpD3DTex2));
2002 HRESULT WINAPI
2003 Thunk_IDirect3DDeviceImpl_2_GetStats(LPDIRECT3DDEVICE2 iface,
2004 LPD3DSTATS lpD3DStats)
2006 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpD3DStats);
2007 return IDirect3DDevice3_GetStats(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2008 lpD3DStats);
2011 HRESULT WINAPI
2012 Thunk_IDirect3DDeviceImpl_1_GetStats(LPDIRECT3DDEVICE iface,
2013 LPD3DSTATS lpD3DStats)
2015 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpD3DStats);
2016 return IDirect3DDevice3_GetStats(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
2017 lpD3DStats);
2020 HRESULT WINAPI
2021 Thunk_IDirect3DDeviceImpl_3_SetRenderTarget(LPDIRECT3DDEVICE3 iface,
2022 LPDIRECTDRAWSURFACE4 lpNewRenderTarget,
2023 DWORD dwFlags)
2025 TRACE("(%p)->(%p,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, lpNewRenderTarget, dwFlags);
2026 return IDirect3DDevice7_SetRenderTarget(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2027 (LPDIRECTDRAWSURFACE7) lpNewRenderTarget /* No cast needed as DSurf4 == DSurf7 */,
2028 dwFlags);
2031 HRESULT WINAPI
2032 Thunk_IDirect3DDeviceImpl_3_GetRenderTarget(LPDIRECT3DDEVICE3 iface,
2033 LPDIRECTDRAWSURFACE4* lplpRenderTarget)
2035 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpRenderTarget);
2036 return IDirect3DDevice7_GetRenderTarget(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2037 (LPDIRECTDRAWSURFACE7*) lplpRenderTarget /* No cast needed as DSurf4 == DSurf7 */);
2040 HRESULT WINAPI
2041 Thunk_IDirect3DDeviceImpl_2_SetRenderTarget(LPDIRECT3DDEVICE2 iface,
2042 LPDIRECTDRAWSURFACE lpNewRenderTarget,
2043 DWORD dwFlags)
2045 TRACE("(%p)->(%p,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, lpNewRenderTarget, dwFlags);
2046 return IDirect3DDevice7_SetRenderTarget(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
2047 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface3, IDirectDrawSurface7, lpNewRenderTarget),
2048 dwFlags);
2051 HRESULT WINAPI
2052 Thunk_IDirect3DDeviceImpl_2_GetRenderTarget(LPDIRECT3DDEVICE2 iface,
2053 LPDIRECTDRAWSURFACE* lplpRenderTarget)
2055 HRESULT ret;
2056 LPDIRECTDRAWSURFACE7 ret_val;
2058 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpRenderTarget);
2059 ret = IDirect3DDevice7_GetRenderTarget(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
2060 &ret_val);
2061 *lplpRenderTarget = (LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirectDrawSurface3, ret_val);
2062 TRACE(" returning interface %p\n", *lplpRenderTarget);
2063 return ret;
2066 HRESULT WINAPI
2067 Thunk_IDirect3DDeviceImpl_2_Vertex(LPDIRECT3DDEVICE2 iface,
2068 LPVOID lpVertexType)
2070 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpVertexType);
2071 return IDirect3DDevice3_Vertex(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2072 lpVertexType);
2075 HRESULT WINAPI
2076 Thunk_IDirect3DDeviceImpl_2_Index(LPDIRECT3DDEVICE2 iface,
2077 WORD wVertexIndex)
2079 TRACE("(%p)->(%04x) thunking to IDirect3DDevice3 interface.\n", iface, wVertexIndex);
2080 return IDirect3DDevice3_Index(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2081 wVertexIndex);
2084 HRESULT WINAPI
2085 Thunk_IDirect3DDeviceImpl_2_End(LPDIRECT3DDEVICE2 iface,
2086 DWORD dwFlags)
2088 TRACE("(%p)->(%08lx) thunking to IDirect3DDevice3 interface.\n", iface, dwFlags);
2089 return IDirect3DDevice3_End(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2090 dwFlags);
2093 HRESULT WINAPI
2094 Thunk_IDirect3DDeviceImpl_2_GetLightState(LPDIRECT3DDEVICE2 iface,
2095 D3DLIGHTSTATETYPE dwLightStateType,
2096 LPDWORD lpdwLightState)
2098 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice3 interface.\n", iface, dwLightStateType, lpdwLightState);
2099 return IDirect3DDevice3_GetLightState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2100 dwLightStateType,
2101 lpdwLightState);
2104 HRESULT WINAPI
2105 Thunk_IDirect3DDeviceImpl_2_SetLightState(LPDIRECT3DDEVICE2 iface,
2106 D3DLIGHTSTATETYPE dwLightStateType,
2107 DWORD dwLightState)
2109 TRACE("(%p)->(%08x,%08lx) thunking to IDirect3DDevice3 interface.\n", iface, dwLightStateType, dwLightState);
2110 return IDirect3DDevice3_SetLightState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2111 dwLightStateType,
2112 dwLightState);
2115 HRESULT WINAPI
2116 Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface,
2117 LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc,
2118 LPVOID lpArg)
2120 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice2 interface.\n", iface, lpD3DEnumTextureProc, lpArg);
2121 return IDirect3DDevice2_EnumTextureFormats(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice2, iface),
2122 lpD3DEnumTextureProc,
2123 lpArg);
2126 HRESULT WINAPI
2127 Thunk_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
2128 DWORD dwStage,
2129 LPDIRECT3DTEXTURE2 lpTexture2)
2131 TRACE("(%p)->(%ld,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, lpTexture2);
2132 return IDirect3DDevice7_SetTexture(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2133 dwStage,
2134 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture2, IDirectDrawSurface7, lpTexture2));
2137 HRESULT WINAPI
2138 Thunk_IDirect3DDeviceImpl_3_DrawPrimitiveVB(LPDIRECT3DDEVICE3 iface,
2139 D3DPRIMITIVETYPE d3dptPrimitiveType,
2140 LPDIRECT3DVERTEXBUFFER lpD3DVertexBuf,
2141 DWORD dwStartVertex,
2142 DWORD dwNumVertices,
2143 DWORD dwFlags)
2145 TRACE("(%p)->(%08x,%p,%08lx,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface,
2146 d3dptPrimitiveType, lpD3DVertexBuf, dwStartVertex, dwNumVertices, dwFlags);
2147 return IDirect3DDevice7_DrawPrimitiveVB(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2148 d3dptPrimitiveType,
2149 COM_INTERFACE_CAST(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, IDirect3DVertexBuffer7, lpD3DVertexBuf),
2150 dwStartVertex,
2151 dwNumVertices,
2152 dwFlags);
2155 HRESULT WINAPI
2156 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveVB(LPDIRECT3DDEVICE3 iface,
2157 D3DPRIMITIVETYPE d3dptPrimitiveType,
2158 LPDIRECT3DVERTEXBUFFER lpD3DVertexBuf,
2159 LPWORD lpwIndices,
2160 DWORD dwIndexCount,
2161 DWORD dwFlags)
2163 TRACE("(%p)->(%08x,%p,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface,
2164 d3dptPrimitiveType, lpD3DVertexBuf, lpwIndices, dwIndexCount, dwFlags);
2165 return IDirect3DDevice7_DrawIndexedPrimitiveVB(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2166 d3dptPrimitiveType,
2167 COM_INTERFACE_CAST(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, IDirect3DVertexBuffer7, lpD3DVertexBuf),
2169 dwIndexCount,
2170 lpwIndices,
2171 dwIndexCount,
2172 dwFlags);
2175 HRESULT WINAPI
2176 Thunk_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
2177 DWORD dwStage,
2178 LPDIRECT3DTEXTURE2* lplpTexture2)
2180 HRESULT ret;
2181 LPDIRECTDRAWSURFACE7 ret_val;
2183 TRACE("(%p)->(%ld,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, lplpTexture2);
2184 ret = IDirect3DDevice7_GetTexture(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2185 dwStage,
2186 &ret_val);
2188 *lplpTexture2 = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirect3DTexture2, ret_val);
2190 TRACE(" returning interface %p.\n", *lplpTexture2);
2192 return ret;