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
34 #include "wine/debug.h"
36 #include "d3d_private.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
40 DWORD InitRenderStateTab[] = {
41 D3DRENDERSTATE_TEXTUREHANDLE, (DWORD)NULL,
42 D3DRENDERSTATE_ANTIALIAS, D3DANTIALIAS_NONE,
43 /* FIXME: D3DRENDERSTATE_TEXTUREADDRESS */
44 D3DRENDERSTATE_TEXTUREPERSPECTIVE, TRUE,
45 /* FIXME: D3DRENDERSTATE_WRAPU */
46 /* FIXME: D3DRENDERSTATE_WRAPV */
47 D3DRENDERSTATE_ZENABLE, D3DZB_TRUE, /* This needs to be set differently according to the Z buffer status */
48 D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID,
49 D3DRENDERSTATE_SHADEMODE, D3DSHADE_GOURAUD,
50 D3DRENDERSTATE_LINEPATTERN, 0,
51 D3DRENDERSTATE_MONOENABLE, FALSE,
52 D3DRENDERSTATE_ROP2, R2_COPYPEN,
53 D3DRENDERSTATE_PLANEMASK, 0xFFFFFFFF,
54 D3DRENDERSTATE_ZWRITEENABLE, TRUE,
55 D3DRENDERSTATE_ALPHATESTENABLE, FALSE,
56 D3DRENDERSTATE_LASTPIXEL, TRUE,
57 D3DRENDERSTATE_TEXTUREMAG, D3DFILTER_NEAREST,
58 D3DRENDERSTATE_TEXTUREMIN, D3DFILTER_NEAREST,
59 D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE,
60 D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO,
61 D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE,
62 D3DRENDERSTATE_CULLMODE, D3DCULL_CCW,
63 D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL,
64 D3DRENDERSTATE_ALPHAREF, 0,
65 D3DRENDERSTATE_ALPHAFUNC, D3DCMP_ALWAYS,
66 D3DRENDERSTATE_DITHERENABLE, FALSE,
67 D3DRENDERSTATE_ALPHABLENDENABLE, FALSE,
68 D3DRENDERSTATE_FOGENABLE, FALSE,
69 D3DRENDERSTATE_SPECULARENABLE, FALSE,
70 D3DRENDERSTATE_ZVISIBLE, FALSE,
71 D3DRENDERSTATE_SUBPIXEL, FALSE,
72 D3DRENDERSTATE_SUBPIXELX, FALSE,
73 D3DRENDERSTATE_STIPPLEDALPHA, FALSE,
74 D3DRENDERSTATE_FOGCOLOR, D3DRGBA(0,0,0,0),
75 D3DRENDERSTATE_FOGTABLEMODE, D3DFOG_NONE,
76 /* FIXME: D3DRENDERSTATE_FOGTABLESTART (same as D3DRENDERSTATE_FOGSTART) */
77 /* FIXME: D3DRENDERSTATE_FOGTABLEEND (same as D3DRENDERSTATE_FOGEND) */
78 D3DRENDERSTATE_FOGTABLEDENSITY, 0x3F80000, /* 1.0f (same as D3DRENDERSTATE_FOGDENSITY) */
79 /* FIXME: D3DRENDERSTATE_STIPPLEENABLE */
80 D3DRENDERSTATE_EDGEANTIALIAS, FALSE,
81 D3DRENDERSTATE_COLORKEYENABLE, FALSE,
82 /* FIXME: D3DRENDERSTATE_BORDERCOLOR */
83 D3DRENDERSTATE_TEXTUREADDRESSU, D3DTADDRESS_WRAP,
84 D3DRENDERSTATE_TEXTUREADDRESSV, D3DTADDRESS_WRAP,
85 D3DRENDERSTATE_MIPMAPLODBIAS, 0x00000000, /* 0.0f */
86 D3DRENDERSTATE_ZBIAS, 0,
87 D3DRENDERSTATE_RANGEFOGENABLE, FALSE,
88 /* FIXME: D3DRENDERSTATE_ANISOTROPY */
89 /* FIXME: D3DRENDERSTATE_FLUSHBATCH */
90 /* FIXME: D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT */
91 D3DRENDERSTATE_STENCILENABLE, FALSE,
92 D3DRENDERSTATE_STENCILFAIL, D3DSTENCILOP_KEEP,
93 D3DRENDERSTATE_STENCILZFAIL, D3DSTENCILOP_KEEP,
94 D3DRENDERSTATE_STENCILPASS, D3DSTENCILOP_KEEP,
95 D3DRENDERSTATE_STENCILFUNC, D3DCMP_ALWAYS,
96 D3DRENDERSTATE_STENCILREF, 0,
97 D3DRENDERSTATE_STENCILMASK, 0xFFFFFFFF,
98 D3DRENDERSTATE_STENCILWRITEMASK, 0xFFFFFFFF,
99 /* FIXME: D3DRENDERSTATE_TEXTUREFACTOR */
100 /* FIXME: D3DRENDERSTATE_STIPPLEPATTERN00..31 */
101 D3DRENDERSTATE_WRAP0, 0,
102 D3DRENDERSTATE_WRAP1, 0,
103 D3DRENDERSTATE_WRAP2, 0,
104 D3DRENDERSTATE_WRAP3, 0,
105 D3DRENDERSTATE_WRAP4, 0,
106 D3DRENDERSTATE_WRAP5, 0,
107 D3DRENDERSTATE_WRAP6, 0,
108 D3DRENDERSTATE_WRAP7, 0,
109 D3DRENDERSTATE_CLIPPING, FALSE,
110 D3DRENDERSTATE_LIGHTING, TRUE,
111 D3DRENDERSTATE_EXTENTS, FALSE,
112 D3DRENDERSTATE_AMBIENT, D3DRGBA(0,0,0,0),
113 D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_NONE,
114 D3DRENDERSTATE_COLORVERTEX, TRUE,
115 D3DRENDERSTATE_LOCALVIEWER, TRUE,
116 D3DRENDERSTATE_NORMALIZENORMALS, FALSE,
117 /* FIXME: D3DRENDER_STATE_COLORKEYBLENDENABLE */
118 D3DRENDERSTATE_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1,
119 D3DRENDERSTATE_SPECULARMATERIALSOURCE, D3DMCS_COLOR2,
120 D3DRENDERSTATE_AMBIENTMATERIALSOURCE, D3DMCS_COLOR2,
121 D3DRENDERSTATE_EMISSIVEMATERIALSOURCE, D3DMCS_MATERIAL,
122 D3DRENDERSTATE_VERTEXBLEND, D3DVBLEND_DISABLE,
123 D3DRENDERSTATE_CLIPPLANEENABLE, 0
126 DWORD InitLightStateTab[] = {
127 D3DLIGHTSTATE_MATERIAL, (DWORD)NULL,
128 D3DLIGHTSTATE_AMBIENT, D3DRGBA(0,0,0,0),
129 D3DLIGHTSTATE_COLORMODEL, D3DCOLOR_RGB,
130 D3DLIGHTSTATE_FOGMODE, D3DFOG_NONE,
131 D3DLIGHTSTATE_FOGSTART, 0x3F80000, /* 1.0f */
132 D3DLIGHTSTATE_FOGEND, 0x42C8000, /* 100.0f */
133 D3DLIGHTSTATE_FOGDENSITY, 0x3F80000 /* 1.0f */
134 /* FIXME: D3DLIGHTSTATE_COLORVERTEX */
137 DWORD InitTextureStageStateTab[] = {
138 D3DTSS_COLOROP, D3DTOP_DISABLE, /* Note, it's manually set for stage 0 */
139 D3DTSS_COLORARG1, D3DTA_TEXTURE,
140 D3DTSS_COLORARG2, D3DTA_CURRENT,
141 D3DTSS_ALPHAOP, D3DTOP_DISABLE, /* Note, it's manually set for stage 0 */
142 D3DTSS_ALPHAARG1, D3DTA_TEXTURE,
143 D3DTSS_ALPHAARG2, D3DTA_CURRENT,
144 /* FIXME: D3DTSS_BUMPENVMAT00,01,10,11 */
145 /* D3DTSS_TEXCOORDINDEX is set manually */
146 D3DTSS_ADDRESS, D3DTADDRESS_WRAP,
147 D3DTSS_ADDRESSU, D3DTADDRESS_WRAP,
148 D3DTSS_ADDRESSV, D3DTADDRESS_WRAP,
149 D3DTSS_BORDERCOLOR, 0x00000000,
150 D3DTSS_MAGFILTER, D3DTFG_POINT,
151 D3DTSS_MINFILTER, D3DTFN_POINT,
152 D3DTSS_MIPFILTER, D3DTFP_NONE,
153 D3DTSS_MIPMAPLODBIAS, 0x00000000, /* 0.0f */
154 D3DTSS_MAXMIPLEVEL, 0,
155 /* D3DTSS_MAXANISOTROPY, 1, */ /* This is to prevent warnings :-) */
156 /* FIXME: D3DTSS_BUMPENVLSCALE */
157 /* FIXME: D3DTSS_NUMPENVLOFFSET */
158 /* FIXME: D3DTSS_TEXTURETRANSFORMFLAGS */
162 void InitDefaultStateBlock(STATEBLOCK* lpStateBlock, int version)
165 TRACE("(%p,%d)\n", lpStateBlock, version);
166 memset(lpStateBlock, 0, sizeof(STATEBLOCK));
168 /* Initialize render states */
169 for (i = 0; i < sizeof(InitRenderStateTab) / sizeof(InitRenderStateTab[0]); i += 2)
171 lpStateBlock->render_state[InitRenderStateTab[i] - 1] = InitRenderStateTab[i + 1];
172 lpStateBlock->set_flags.render_state[InitRenderStateTab[i] - 1] = TRUE;
175 /* Initialize texture stages states */
176 for (i = 0; i < MAX_TEXTURES; i++)
178 for (j = 0; j < sizeof(InitTextureStageStateTab) / sizeof(InitTextureStageStateTab[0]); j += 2)
180 lpStateBlock->texture_stage_state[i][InitTextureStageStateTab[j] - 1] = InitTextureStageStateTab[j + 1];
181 lpStateBlock->set_flags.texture_stage_state[i][InitTextureStageStateTab[j] - 1] = TRUE;
183 /* Map texture coords 0 to stage 0, 1 to stage 1, etc... */
184 lpStateBlock->texture_stage_state[i][D3DTSS_TEXCOORDINDEX - 1] = i;
185 lpStateBlock->set_flags.texture_stage_state[i][D3DTSS_TEXCOORDINDEX - 1] = TRUE;
188 /* The first texture is particular, update it consequently */
189 lpStateBlock->texture_stage_state[0][D3DTSS_COLOROP - 1] = D3DTOP_MODULATE;
190 lpStateBlock->texture_stage_state[0][D3DTSS_ALPHAOP - 1] = D3DTOP_SELECTARG1;
191 lpStateBlock->texture_stage_state[0][D3DTSS_COLORARG2 - 1] = D3DTA_DIFFUSE;
192 lpStateBlock->texture_stage_state[0][D3DTSS_ALPHAARG2 - 1] = D3DTA_DIFFUSE;
194 /* Updates for particular versions */
195 if ((version == 1) || (version==2))
196 lpStateBlock->render_state[D3DRENDERSTATE_SPECULARENABLE - 1] = TRUE;
200 Main_IDirect3DDeviceImpl_7_3T_2T_1T_QueryInterface(LPDIRECT3DDEVICE7 iface,
204 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
205 TRACE("(%p/%p)->(%s,%p)\n", This, iface, debugstr_guid(riid), obp);
209 /* Note: We cannot get an interface whose version is higher than the
210 * Direct3D object that created the device */
212 if ( IsEqualGUID( &IID_IUnknown, riid ) ) {
213 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
215 TRACE(" Creating IUnknown interface at %p.\n", *obp);
218 if ( IsEqualGUID( &IID_IDirect3DDevice, riid ) ) {
219 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
220 *obp = ICOM_INTERFACE(This, IDirect3DDevice);
221 TRACE(" Creating IDirect3DDevice interface %p\n", *obp);
224 if ( IsEqualGUID( &IID_IDirect3DDevice2, riid ) && (This->version >= 2)) {
225 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
226 *obp = ICOM_INTERFACE(This, IDirect3DDevice2);
227 TRACE(" Creating IDirect3DDevice2 interface %p\n", *obp);
230 if ( IsEqualGUID( &IID_IDirect3DDevice3, riid ) && (This->version >= 3)) {
231 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
232 *obp = ICOM_INTERFACE(This, IDirect3DDevice3);
233 TRACE(" Creating IDirect3DDevice3 interface %p\n", *obp);
236 if ( IsEqualGUID( &IID_IDirect3DDevice7, riid ) && (This->version >= 7)) {
237 IDirect3DDevice7_AddRef(ICOM_INTERFACE(This, IDirect3DDevice7));
238 *obp = ICOM_INTERFACE(This, IDirect3DDevice7);
239 TRACE(" Creating IDirect3DDevice7 interface %p\n", *obp);
242 if ( IsEqualGUID( &IID_IDirectDrawSurface, riid ) ||
243 IsEqualGUID( &IID_IDirectDrawSurface2, riid ) ||
244 IsEqualGUID( &IID_IDirectDrawSurface3, riid ) ) {
245 IDirectDrawSurface7_AddRef(ICOM_INTERFACE(This->surface, IDirectDrawSurface7));
246 *obp = ICOM_INTERFACE(This->surface, IDirectDrawSurface3);
247 TRACE(" Return IDirectDrawSurface3 interface %p\n", *obp);
250 if ( IsEqualGUID( &IID_IDirectDrawSurface4, riid ) ||
251 IsEqualGUID( &IID_IDirectDrawSurface7, riid ) ) {
252 IDirectDrawSurface7_AddRef(ICOM_INTERFACE(This->surface, IDirectDrawSurface7));
253 *obp = ICOM_INTERFACE(This->surface, IDirectDrawSurface7);
254 TRACE(" Return IDirectDrawSurface7 interface %p\n", *obp);
257 FIXME("(%p): interface for IID %s NOT found!\n", This, debugstr_guid(riid));
258 return OLE_E_ENUM_NOMORE;
262 Main_IDirect3DDeviceImpl_7_3T_2T_1T_AddRef(LPDIRECT3DDEVICE7 iface)
264 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
265 ULONG ref = InterlockedIncrement(&This->ref);
267 TRACE("(%p/%p)->() incrementing from %lu.\n", This, iface, ref - 1);
273 Main_IDirect3DDeviceImpl_7_3T_2T_1T_Release(LPDIRECT3DDEVICE7 iface)
275 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
276 ULONG ref = InterlockedDecrement(&This->ref);
278 TRACE("(%p/%p)->() decrementing from %lu.\n", This, iface, ref + 1);
282 /* Release texture associated with the device */
283 for (i = 0; i < MAX_TEXTURES; i++) {
284 if (This->current_texture[i] != NULL)
285 IDirect3DTexture2_Release(ICOM_INTERFACE(This->current_texture[i], IDirect3DTexture2));
288 HeapFree(GetProcessHeap(), 0, This);
295 Main_IDirect3DDeviceImpl_7_GetCaps(LPDIRECT3DDEVICE7 iface,
296 LPD3DDEVICEDESC7 lpD3DHELDevDesc)
298 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
299 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpD3DHELDevDesc);
304 Main_IDirect3DDeviceImpl_7_3T_EnumTextureFormats(LPDIRECT3DDEVICE7 iface,
305 LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc,
308 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
309 FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpD3DEnumPixelProc, lpArg);
314 Main_IDirect3DDeviceImpl_7_3T_2T_1T_BeginScene(LPDIRECT3DDEVICE7 iface)
316 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
317 TRACE("(%p/%p)->()\n", This, iface);
323 Main_IDirect3DDeviceImpl_7_3T_2T_1T_EndScene(LPDIRECT3DDEVICE7 iface)
325 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
326 TRACE("(%p/%p)->()\n", This, iface);
332 Main_IDirect3DDeviceImpl_7_3T_2T_1T_GetDirect3D(LPDIRECT3DDEVICE7 iface,
333 LPDIRECT3D7* lplpDirect3D7)
335 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
336 TRACE("(%p/%p)->(%p)\n", This, iface, lplpDirect3D7);
338 *lplpDirect3D7 = ICOM_INTERFACE(This->d3d, IDirect3D7);
339 IDirect3D7_AddRef(ICOM_INTERFACE(This->d3d, IDirect3D7));
341 TRACE(" returning interface %p\n", *lplpDirect3D7);
346 Main_IDirect3DDeviceImpl_7_3T_2T_SetRenderTarget(LPDIRECT3DDEVICE7 iface,
347 LPDIRECTDRAWSURFACE7 lpNewRenderTarget,
350 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
351 IDirectDrawSurfaceImpl *target_impl = ICOM_OBJECT(IDirectDrawSurfaceImpl, IDirectDrawSurface7, lpNewRenderTarget);
353 TRACE("(%p/%p)->(%p,%08lx)\n", This, iface, lpNewRenderTarget, dwFlags);
354 if (target_impl != This->surface) {
355 WARN(" Change of rendering target not handled yet !\n");
361 Main_IDirect3DDeviceImpl_7_3T_2T_GetRenderTarget(LPDIRECT3DDEVICE7 iface,
362 LPDIRECTDRAWSURFACE7* lplpRenderTarget)
364 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
365 TRACE("(%p/%p)->(%p)\n", This, iface, lplpRenderTarget);
367 *lplpRenderTarget = ICOM_INTERFACE(This->surface, IDirectDrawSurface7);
368 IDirectDrawSurface7_AddRef(ICOM_INTERFACE(This->surface, IDirectDrawSurface7));
370 TRACE(" returning surface at %p.\n", *lplpRenderTarget);
376 Main_IDirect3DDeviceImpl_7_Clear(LPDIRECT3DDEVICE7 iface,
384 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
385 TRACE("(%p/%p)->(%08lx,%p,%08lx,%08lx,%f,%08lx)\n", This, iface, dwCount, lpRects, dwFlags, (DWORD) dwColor, dvZ, dwStencil);
386 return This->clear(This, dwCount, lpRects, dwFlags, dwColor, dvZ, dwStencil);
390 Main_IDirect3DDeviceImpl_7_3T_2T_SetTransform(LPDIRECT3DDEVICE7 iface,
391 D3DTRANSFORMSTATETYPE dtstTransformStateType,
392 LPD3DMATRIX lpD3DMatrix)
394 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
395 DWORD matrix_changed = 0x00000000;
397 TRACE("(%p/%p)->(%08x,%p)\n", This, iface, dtstTransformStateType, lpD3DMatrix);
399 switch (dtstTransformStateType) {
400 case D3DTRANSFORMSTATE_WORLD: {
401 if (TRACE_ON(ddraw)) {
402 TRACE(" D3DTRANSFORMSTATE_WORLD :\n"); dump_D3DMATRIX(lpD3DMatrix);
404 memcpy(This->world_mat, lpD3DMatrix, 16 * sizeof(float));
405 matrix_changed = WORLDMAT_CHANGED;
408 case D3DTRANSFORMSTATE_VIEW: {
409 if (TRACE_ON(ddraw)) {
410 TRACE(" D3DTRANSFORMSTATE_VIEW :\n"); dump_D3DMATRIX(lpD3DMatrix);
412 memcpy(This->view_mat, lpD3DMatrix, 16 * sizeof(float));
413 matrix_changed = VIEWMAT_CHANGED;
416 case D3DTRANSFORMSTATE_PROJECTION: {
417 if (TRACE_ON(ddraw)) {
418 TRACE(" D3DTRANSFORMSTATE_PROJECTION :\n"); dump_D3DMATRIX(lpD3DMatrix);
420 memcpy(This->proj_mat, lpD3DMatrix, 16 * sizeof(float));
421 matrix_changed = PROJMAT_CHANGED;
424 case D3DTRANSFORMSTATE_TEXTURE0:
425 case D3DTRANSFORMSTATE_TEXTURE1:
426 case D3DTRANSFORMSTATE_TEXTURE2:
427 case D3DTRANSFORMSTATE_TEXTURE3:
428 case D3DTRANSFORMSTATE_TEXTURE4:
429 case D3DTRANSFORMSTATE_TEXTURE5:
430 case D3DTRANSFORMSTATE_TEXTURE6:
431 case D3DTRANSFORMSTATE_TEXTURE7: {
432 DWORD mat_num = dtstTransformStateType - D3DTRANSFORMSTATE_TEXTURE0;
433 if (TRACE_ON(ddraw)) {
434 TRACE(" D3DTRANSFORMSTATE_TEXTURE%ld :\n", mat_num); dump_D3DMATRIX(lpD3DMatrix);
436 memcpy(This->tex_mat[mat_num], lpD3DMatrix, 16 * sizeof(float));
437 matrix_changed = TEXMAT0_CHANGED << mat_num;
441 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType);
445 if (matrix_changed != 0x00000000) This->matrices_updated(This, matrix_changed);
451 Main_IDirect3DDeviceImpl_7_3T_2T_GetTransform(LPDIRECT3DDEVICE7 iface,
452 D3DTRANSFORMSTATETYPE dtstTransformStateType,
453 LPD3DMATRIX lpD3DMatrix)
455 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
456 TRACE("(%p/%p)->(%08x,%p)\n", This, iface, dtstTransformStateType, lpD3DMatrix);
458 switch (dtstTransformStateType) {
459 case D3DTRANSFORMSTATE_WORLD: {
460 memcpy(lpD3DMatrix, This->world_mat, 16 * sizeof(D3DVALUE));
461 if (TRACE_ON(ddraw)) {
462 TRACE(" returning D3DTRANSFORMSTATE_WORLD :\n");
463 dump_D3DMATRIX(lpD3DMatrix);
467 case D3DTRANSFORMSTATE_VIEW: {
468 memcpy(lpD3DMatrix, This->view_mat, 16 * sizeof(D3DVALUE));
469 if (TRACE_ON(ddraw)) {
470 TRACE(" returning D3DTRANSFORMSTATE_VIEW :\n");
471 dump_D3DMATRIX(lpD3DMatrix);
475 case D3DTRANSFORMSTATE_PROJECTION: {
476 memcpy(lpD3DMatrix, This->proj_mat, 16 * sizeof(D3DVALUE));
477 if (TRACE_ON(ddraw)) {
478 TRACE(" returning D3DTRANSFORMSTATE_PROJECTION :\n");
479 dump_D3DMATRIX(lpD3DMatrix);
483 case D3DTRANSFORMSTATE_TEXTURE0:
484 case D3DTRANSFORMSTATE_TEXTURE1:
485 case D3DTRANSFORMSTATE_TEXTURE2:
486 case D3DTRANSFORMSTATE_TEXTURE3:
487 case D3DTRANSFORMSTATE_TEXTURE4:
488 case D3DTRANSFORMSTATE_TEXTURE5:
489 case D3DTRANSFORMSTATE_TEXTURE6:
490 case D3DTRANSFORMSTATE_TEXTURE7: {
491 DWORD mat_num = dtstTransformStateType - D3DTRANSFORMSTATE_TEXTURE0;
492 memcpy(lpD3DMatrix, This->tex_mat[mat_num], 16 * sizeof(D3DVALUE));
493 if (TRACE_ON(ddraw)) {
494 TRACE(" returning D3DTRANSFORMSTATE_TEXTURE%ld :\n", mat_num);
495 dump_D3DMATRIX(lpD3DMatrix);
500 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType);
501 return DDERR_INVALIDPARAMS;
508 Main_IDirect3DDeviceImpl_7_3T_2T_MultiplyTransform(LPDIRECT3DDEVICE7 iface,
509 D3DTRANSFORMSTATETYPE dtstTransformStateType,
510 LPD3DMATRIX lpD3DMatrix)
512 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
514 DWORD matrix_changed = 0x00000000;
516 TRACE("(%p/%p)->(%08x,%p)\n", This, iface, dtstTransformStateType, lpD3DMatrix);
518 if (TRACE_ON(ddraw)) {
519 TRACE(" Multiplying by :\n"); dump_D3DMATRIX(lpD3DMatrix);
522 switch (dtstTransformStateType) {
523 case D3DTRANSFORMSTATE_WORLD: {
524 if (TRACE_ON(ddraw)) {
525 TRACE(" Resulting D3DTRANSFORMSTATE_WORLD matrix is :\n");
527 mat = This->world_mat;
528 matrix_changed = WORLDMAT_CHANGED;
531 case D3DTRANSFORMSTATE_VIEW: {
532 if (TRACE_ON(ddraw)) {
533 TRACE(" Resulting D3DTRANSFORMSTATE_VIEW matrix is :\n");
535 mat = This->view_mat;
536 matrix_changed = VIEWMAT_CHANGED;
539 case D3DTRANSFORMSTATE_PROJECTION: {
540 if (TRACE_ON(ddraw)) {
541 TRACE(" Resulting D3DTRANSFORMSTATE_PROJECTION matrix is :\n");
543 mat = This->proj_mat;
544 matrix_changed = PROJMAT_CHANGED;
547 case D3DTRANSFORMSTATE_TEXTURE0:
548 case D3DTRANSFORMSTATE_TEXTURE1:
549 case D3DTRANSFORMSTATE_TEXTURE2:
550 case D3DTRANSFORMSTATE_TEXTURE3:
551 case D3DTRANSFORMSTATE_TEXTURE4:
552 case D3DTRANSFORMSTATE_TEXTURE5:
553 case D3DTRANSFORMSTATE_TEXTURE6:
554 case D3DTRANSFORMSTATE_TEXTURE7: {
555 DWORD mat_num = dtstTransformStateType - D3DTRANSFORMSTATE_TEXTURE0;
556 if (TRACE_ON(ddraw)) {
557 TRACE(" Resulting D3DTRANSFORMSTATE_TEXTURE%ld matrix is :\n", mat_num);
559 mat = This->tex_mat[mat_num];
560 matrix_changed = TEXMAT0_CHANGED << mat_num;
564 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType);
565 return DDERR_INVALIDPARAMS;
568 multiply_matrix(mat,mat,lpD3DMatrix);
570 if (TRACE_ON(ddraw)) {
574 if (matrix_changed != 0x00000000) This->matrices_updated(This, matrix_changed);
580 Main_IDirect3DDeviceImpl_7_GetViewport(LPDIRECT3DDEVICE7 iface,
581 LPD3DVIEWPORT7 lpData)
583 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
584 TRACE("(%p/%p)->(%p)\n", This, iface, lpData);
586 *lpData = This->active_viewport;
588 if (TRACE_ON(ddraw)) {
589 TRACE(" returning viewport : \n");
590 TRACE(" - dwX = %ld dwY = %ld\n",
591 lpData->dwX, lpData->dwY);
592 TRACE(" - dwWidth = %ld dwHeight = %ld\n",
593 lpData->dwWidth, lpData->dwHeight);
594 TRACE(" - dvMinZ = %f dvMaxZ = %f\n",
595 lpData->dvMinZ, lpData->dvMaxZ);
602 Main_IDirect3DDeviceImpl_7_SetMaterial(LPDIRECT3DDEVICE7 iface,
603 LPD3DMATERIAL7 lpMat)
605 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
606 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpMat);
611 Main_IDirect3DDeviceImpl_7_GetMaterial(LPDIRECT3DDEVICE7 iface,
612 LPD3DMATERIAL7 lpMat)
614 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
615 TRACE("(%p/%p)->(%p)\n", This, iface, lpMat);
617 *lpMat = This->current_material;
619 if (TRACE_ON(ddraw)) {
620 TRACE(" returning material : \n");
621 dump_D3DMATERIAL7(lpMat);
628 Main_IDirect3DDeviceImpl_7_SetLight(LPDIRECT3DDEVICE7 iface,
632 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
633 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwLightIndex, lpLight);
638 Main_IDirect3DDeviceImpl_7_GetLight(LPDIRECT3DDEVICE7 iface,
642 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
643 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwLightIndex, lpLight);
645 if (dwLightIndex >= This->num_set_lights)
646 return DDERR_INVALIDPARAMS;
648 *lpLight = This->light_parameters[dwLightIndex];
650 /* If dltType is zero, then this light has never been set, either
651 by calling SetLight or implicitely by calling EnableLight without
652 calling SetLight first. */
653 if (lpLight->dltType == 0)
654 return DDERR_INVALIDPARAMS;
656 if (TRACE_ON(ddraw)) {
657 TRACE(" returning light : \n");
658 dump_D3DLIGHT7(lpLight);
665 Main_IDirect3DDeviceImpl_7_3T_2T_SetRenderState(LPDIRECT3DDEVICE7 iface,
666 D3DRENDERSTATETYPE dwRenderStateType,
669 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
670 FIXME("(%p/%p)->(%08x,%08lx): stub!\n", This, iface, dwRenderStateType, dwRenderState);
675 Main_IDirect3DDeviceImpl_7_3T_2T_GetRenderState(LPDIRECT3DDEVICE7 iface,
676 D3DRENDERSTATETYPE dwRenderStateType,
677 LPDWORD lpdwRenderState)
679 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
680 FIXME("(%p/%p)->(%08x,%p): stub!\n", This, iface, dwRenderStateType, lpdwRenderState);
685 Main_IDirect3DDeviceImpl_7_BeginStateBlock(LPDIRECT3DDEVICE7 iface)
687 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
688 FIXME("(%p/%p)->(): stub!\n", This, iface);
693 Main_IDirect3DDeviceImpl_7_EndStateBlock(LPDIRECT3DDEVICE7 iface,
694 LPDWORD lpdwBlockHandle)
696 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
697 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpdwBlockHandle);
702 Main_IDirect3DDeviceImpl_7_PreLoad(LPDIRECT3DDEVICE7 iface,
703 LPDIRECTDRAWSURFACE7 lpddsTexture)
705 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
706 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpddsTexture);
711 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitive(LPDIRECT3DDEVICE7 iface,
712 D3DPRIMITIVETYPE d3dptPrimitiveType,
713 DWORD d3dvtVertexType,
718 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
719 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwFlags);
724 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitive(LPDIRECT3DDEVICE7 iface,
725 D3DPRIMITIVETYPE d3dptPrimitiveType,
726 DWORD d3dvtVertexType,
733 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
734 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwIndices, dwIndexCount, dwFlags);
739 Main_IDirect3DDeviceImpl_7_3T_2T_SetClipStatus(LPDIRECT3DDEVICE7 iface,
740 LPD3DCLIPSTATUS lpD3DClipStatus)
742 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
743 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpD3DClipStatus);
748 Main_IDirect3DDeviceImpl_7_3T_2T_GetClipStatus(LPDIRECT3DDEVICE7 iface,
749 LPD3DCLIPSTATUS lpD3DClipStatus)
751 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
752 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpD3DClipStatus);
757 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitiveStrided(LPDIRECT3DDEVICE7 iface,
758 D3DPRIMITIVETYPE d3dptPrimitiveType,
760 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,
764 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
765 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, dwVertexType, lpD3DDrawPrimStrideData, dwVertexCount, dwFlags);
770 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitiveStrided(LPDIRECT3DDEVICE7 iface,
771 D3DPRIMITIVETYPE d3dptPrimitiveType,
773 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,
779 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
780 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, dwVertexType, lpD3DDrawPrimStrideData, dwVertexCount, lpIndex, dwIndexCount, dwFlags);
785 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitiveVB(LPDIRECT3DDEVICE7 iface,
786 D3DPRIMITIVETYPE d3dptPrimitiveType,
787 LPDIRECT3DVERTEXBUFFER7 lpD3DVertexBuf,
792 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
793 FIXME("(%p/%p)->(%08x,%p,%08lx,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, lpD3DVertexBuf, dwStartVertex, dwNumVertices, dwFlags);
798 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitiveVB(LPDIRECT3DDEVICE7 iface,
799 D3DPRIMITIVETYPE d3dptPrimitiveType,
800 LPDIRECT3DVERTEXBUFFER7 lpD3DVertexBuf,
807 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
808 FIXME("(%p/%p)->(%08x,%p,%08lx,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, lpD3DVertexBuf, dwStartVertex, dwNumVertices, lpwIndices, dwIndexCount, dwFlags);
813 Main_IDirect3DDeviceImpl_7_3T_ComputeSphereVisibility(LPDIRECT3DDEVICE7 iface,
814 LPD3DVECTOR lpCenters,
818 LPDWORD lpdwReturnValues)
820 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
821 FIXME("(%p/%p)->(%p,%p,%08lx,%08lx,%p): stub!\n", This, iface, lpCenters, lpRadii, dwNumSpheres, dwFlags, lpdwReturnValues);
826 Main_IDirect3DDeviceImpl_7_3T_GetTexture(LPDIRECT3DDEVICE7 iface,
828 LPDIRECTDRAWSURFACE7* lpTexture)
830 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
831 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwStage, lpTexture);
833 if (This->current_texture[dwStage] != NULL) {
834 *lpTexture = ICOM_INTERFACE(This->current_texture[dwStage], IDirectDrawSurface7);
835 IDirectDrawSurface7_AddRef(*lpTexture);
840 TRACE(" returning interface at %p (for implementation at %p).\n", *lpTexture, This->current_texture[dwStage]);
846 Main_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface,
848 LPDIRECTDRAWSURFACE7 lpTexture)
850 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
851 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwStage, lpTexture);
856 Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState(LPDIRECT3DDEVICE7 iface,
858 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,
861 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
862 TRACE("(%p/%p)->(%08lx,%08x,%p)\n", This, iface, dwStage, d3dTexStageStateType, lpdwState);
863 if (lpdwState && (dwStage < 8) && d3dTexStageStateType && (d3dTexStageStateType <= HIGHEST_TEXTURE_STAGE_STATE) ) {
864 *lpdwState = This->state_block.texture_stage_state[dwStage][d3dTexStageStateType-1];
867 return DDERR_INVALIDPARAMS;
871 Main_IDirect3DDeviceImpl_7_3T_SetTextureStageState(LPDIRECT3DDEVICE7 iface,
873 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,
876 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
877 FIXME("(%p/%p)->(%08lx,%08x,%08lx): stub!\n", This, iface, dwStage, d3dTexStageStateType, dwState);
882 Main_IDirect3DDeviceImpl_7_3T_ValidateDevice(LPDIRECT3DDEVICE7 iface,
885 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
886 FIXME("(%p/%p)->(%p): semi-stub!\n", This, iface, lpdwPasses);
888 /* For the moment, we have a VERY good hardware which does everything in one pass :-) */
895 Main_IDirect3DDeviceImpl_7_ApplyStateBlock(LPDIRECT3DDEVICE7 iface,
898 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
899 FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwBlockHandle);
904 Main_IDirect3DDeviceImpl_7_CaptureStateBlock(LPDIRECT3DDEVICE7 iface,
907 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
908 FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwBlockHandle);
913 Main_IDirect3DDeviceImpl_7_DeleteStateBlock(LPDIRECT3DDEVICE7 iface,
916 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
917 FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwBlockHandle);
922 Main_IDirect3DDeviceImpl_7_CreateStateBlock(LPDIRECT3DDEVICE7 iface,
923 D3DSTATEBLOCKTYPE d3dsbType,
924 LPDWORD lpdwBlockHandle)
926 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
927 FIXME("(%p/%p)->(%08x,%p): stub!\n", This, iface, d3dsbType, lpdwBlockHandle);
932 Main_IDirect3DDeviceImpl_7_Load(LPDIRECT3DDEVICE7 iface,
933 LPDIRECTDRAWSURFACE7 lpDestTex,
935 LPDIRECTDRAWSURFACE7 lpSrcTex,
939 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
940 FIXME("(%p/%p)->(%p,%p,%p,%p,%08lx): Partially Implemented!\n", This, iface, lpDestTex, lpDestPoint, lpSrcTex, lprcSrcRect, dwFlags);
941 IDirect3DTexture2_Load(COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirect3DTexture2, lpDestTex),
942 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirect3DTexture2, lpSrcTex));
947 Main_IDirect3DDeviceImpl_7_LightEnable(LPDIRECT3DDEVICE7 iface,
951 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
952 FIXME("(%p/%p)->(%08lx,%d): stub!\n", This, iface, dwLightIndex, bEnable);
957 Main_IDirect3DDeviceImpl_7_GetLightEnable(LPDIRECT3DDEVICE7 iface,
963 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
964 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, dwLightIndex, pbEnable);
967 if (dwLightIndex >= This->num_set_lights)
968 return DDERR_INVALIDPARAMS;
970 /* If dltType is zero, then this light has never been set, either
971 by calling SetLight or implicitely by calling EnableLight without
972 calling SetLight first. */
973 if (This->light_parameters[dwLightIndex].dltType == 0)
974 return DDERR_INVALIDPARAMS;
976 for (i = 0; i < This->max_active_lights; i++)
977 if (This->active_lights[i] == dwLightIndex)
980 TRACE(" returning %d.\n", *pbEnable);
986 Main_IDirect3DDeviceImpl_7_SetClipPlane(LPDIRECT3DDEVICE7 iface,
988 D3DVALUE* pPlaneEquation)
990 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
991 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This, iface, dwIndex, pPlaneEquation);
996 Main_IDirect3DDeviceImpl_7_GetClipPlane(LPDIRECT3DDEVICE7 iface, DWORD dwIndex, D3DVALUE* pPlaneEquation)
998 IDirect3DDeviceImpl *This = (IDirect3DDeviceImpl *)iface;
1000 TRACE("(%p)->(%ld,%p)\n", This, dwIndex, pPlaneEquation);
1002 if (dwIndex>=This->max_clipping_planes) {
1003 return DDERR_INVALIDPARAMS;
1006 memcpy( pPlaneEquation, This->clipping_planes[dwIndex].plane, sizeof(D3DVALUE[4]));
1012 Main_IDirect3DDeviceImpl_7_GetInfo(LPDIRECT3DDEVICE7 iface,
1014 LPVOID pDevInfoStruct,
1017 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
1018 TRACE("(%p/%p)->(%08lx,%p,%08lx)\n", This, iface, dwDevInfoID, pDevInfoStruct, dwSize);
1020 if (TRACE_ON(ddraw)) {
1021 TRACE(" info requested : ");
1022 switch (dwDevInfoID) {
1023 case D3DDEVINFOID_TEXTUREMANAGER: TRACE("D3DDEVINFOID_TEXTUREMANAGER\n"); break;
1024 case D3DDEVINFOID_D3DTEXTUREMANAGER: TRACE("D3DDEVINFOID_D3DTEXTUREMANAGER\n"); break;
1025 case D3DDEVINFOID_TEXTURING: TRACE("D3DDEVINFOID_TEXTURING\n"); break;
1026 default: ERR(" invalid flag !!!\n"); return DDERR_INVALIDPARAMS;
1030 return S_FALSE; /* According to MSDN, this is valid for a non-debug driver */
1034 Main_IDirect3DDeviceImpl_3_2T_1T_GetCaps(LPDIRECT3DDEVICE3 iface,
1035 LPD3DDEVICEDESC lpD3DHWDevDesc,
1036 LPD3DDEVICEDESC lpD3DHELDevDesc)
1038 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1039 FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpD3DHWDevDesc, lpD3DHELDevDesc);
1044 Main_IDirect3DDeviceImpl_3_2T_1T_GetStats(LPDIRECT3DDEVICE3 iface,
1045 LPD3DSTATS lpD3DStats)
1047 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1048 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpD3DStats);
1053 Main_IDirect3DDeviceImpl_3_2T_1T_AddViewport(LPDIRECT3DDEVICE3 iface,
1054 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3)
1056 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1057 IDirect3DViewportImpl *lpDirect3DViewportImpl = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3);
1059 TRACE("(%p/%p)->(%p)\n", This, iface, lpDirect3DViewport3);
1061 lpDirect3DViewportImpl->next = This->viewport_list;
1062 This->viewport_list = lpDirect3DViewportImpl;
1068 Main_IDirect3DDeviceImpl_3_2T_1T_DeleteViewport(LPDIRECT3DDEVICE3 iface,
1069 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3)
1071 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1072 IDirect3DViewportImpl *lpDirect3DViewportImpl = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3);
1073 IDirect3DViewportImpl *cur_viewport, *prev_viewport = NULL;
1075 TRACE("(%p/%p)->(%p)\n", This, iface, lpDirect3DViewport3);
1077 cur_viewport = This->viewport_list;
1078 while (cur_viewport != NULL) {
1079 if (cur_viewport == lpDirect3DViewportImpl) {
1080 if (prev_viewport == NULL) This->viewport_list = cur_viewport->next;
1081 else prev_viewport->next = cur_viewport->next;
1082 /* TODO : add desactivate of the viewport and all associated lights... */
1085 prev_viewport = cur_viewport;
1086 cur_viewport = cur_viewport->next;
1089 return DDERR_INVALIDPARAMS;
1093 Main_IDirect3DDeviceImpl_3_2T_1T_NextViewport(LPDIRECT3DDEVICE3 iface,
1094 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3,
1095 LPDIRECT3DVIEWPORT3* lplpDirect3DViewport3,
1098 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1099 IDirect3DViewportImpl *res = NULL;
1101 TRACE("(%p/%p)->(%p,%p,%08lx)\n", This, iface, lpDirect3DViewport3, lplpDirect3DViewport3, dwFlags);
1104 case D3DNEXT_NEXT: {
1105 IDirect3DViewportImpl *lpDirect3DViewportImpl = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3);
1106 res = lpDirect3DViewportImpl->next;
1108 case D3DNEXT_HEAD: {
1109 res = This->viewport_list;
1111 case D3DNEXT_TAIL: {
1112 IDirect3DViewportImpl *cur_viewport = This->viewport_list;
1113 if (cur_viewport != NULL) {
1114 while (cur_viewport->next != NULL) cur_viewport = cur_viewport->next;
1119 *lplpDirect3DViewport3 = NULL;
1120 return DDERR_INVALIDPARAMS;
1122 *lplpDirect3DViewport3 = ICOM_INTERFACE(res, IDirect3DViewport3);
1127 Main_IDirect3DDeviceImpl_3_2T_SetCurrentViewport(LPDIRECT3DDEVICE3 iface,
1128 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3)
1130 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1131 TRACE("(%p/%p)->(%p)\n", This, iface, lpDirect3DViewport3);
1133 /* Do nothing if the specified viewport is the same as the current one */
1134 if (This->current_viewport == ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3))
1137 /* Should check if the viewport was added or not */
1139 /* Release previous viewport and AddRef the new one */
1140 if (This->current_viewport)
1141 IDirect3DViewport3_Release(ICOM_INTERFACE(This->current_viewport, IDirect3DViewport3));
1142 IDirect3DViewport3_AddRef(lpDirect3DViewport3);
1144 /* Set this viewport as the current viewport */
1145 This->current_viewport = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport3);
1147 /* Activate this viewport */
1148 This->current_viewport->active_device = This;
1149 This->current_viewport->activate(This->current_viewport);
1155 Main_IDirect3DDeviceImpl_3_2T_GetCurrentViewport(LPDIRECT3DDEVICE3 iface,
1156 LPDIRECT3DVIEWPORT3* lplpDirect3DViewport3)
1158 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1159 TRACE("(%p/%p)->(%p)\n", This, iface, lplpDirect3DViewport3);
1161 *lplpDirect3DViewport3 = ICOM_INTERFACE(This->current_viewport, IDirect3DViewport3);
1163 /* AddRef the returned viewport */
1164 IDirect3DViewport3_AddRef(*lplpDirect3DViewport3);
1166 TRACE(" returning interface %p\n", *lplpDirect3DViewport3);
1172 Main_IDirect3DDeviceImpl_3_Begin(LPDIRECT3DDEVICE3 iface,
1173 D3DPRIMITIVETYPE d3dptPrimitiveType,
1174 DWORD dwVertexTypeDesc,
1177 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1178 FIXME("(%p/%p)->(%08x,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, dwVertexTypeDesc, dwFlags);
1183 Main_IDirect3DDeviceImpl_3_BeginIndexed(LPDIRECT3DDEVICE3 iface,
1184 D3DPRIMITIVETYPE d3dptPrimitiveType,
1185 DWORD d3dvtVertexType,
1187 DWORD dwNumVertices,
1190 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1191 FIXME("(%p/%p)->(%08x,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwNumVertices, dwFlags);
1196 Main_IDirect3DDeviceImpl_3_2T_Vertex(LPDIRECT3DDEVICE3 iface,
1197 LPVOID lpVertexType)
1199 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1200 FIXME("(%p/%p)->(%p): stub!\n", This, iface, lpVertexType);
1205 Main_IDirect3DDeviceImpl_3_2T_Index(LPDIRECT3DDEVICE3 iface,
1208 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1209 FIXME("(%p/%p)->(%04x): stub!\n", This, iface, wVertexIndex);
1214 Main_IDirect3DDeviceImpl_3_2T_End(LPDIRECT3DDEVICE3 iface,
1217 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1218 FIXME("(%p/%p)->(%08lx): stub!\n", This, iface, dwFlags);
1223 Main_IDirect3DDeviceImpl_3_2T_GetLightState(LPDIRECT3DDEVICE3 iface,
1224 D3DLIGHTSTATETYPE dwLightStateType,
1225 LPDWORD lpdwLightState)
1227 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1228 FIXME("(%p/%p)->(%08x,%p): stub !\n", This, iface, dwLightStateType, lpdwLightState);
1233 Main_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface,
1234 D3DLIGHTSTATETYPE dwLightStateType,
1237 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface);
1238 FIXME("(%p/%p)->(%08x,%08lx): stub!\n", This, iface, dwLightStateType, dwLightState);
1243 Main_IDirect3DDeviceImpl_2_1T_SwapTextureHandles(LPDIRECT3DDEVICE2 iface,
1244 LPDIRECT3DTEXTURE2 lpD3DTex1,
1245 LPDIRECT3DTEXTURE2 lpD3DTex2)
1247 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1248 IDirectDrawSurfaceImpl tmp,*surf1,*surf2;
1249 TRACE("(%p/%p)->(%p,%p):\n", This, iface, lpD3DTex1, lpD3DTex2);
1251 surf1 = ICOM_OBJECT(IDirectDrawSurfaceImpl,IDirect3DTexture2,lpD3DTex1);
1252 surf2 = ICOM_OBJECT(IDirectDrawSurfaceImpl,IDirect3DTexture2,lpD3DTex2);
1261 Main_IDirect3DDeviceImpl_2_NextViewport(LPDIRECT3DDEVICE2 iface,
1262 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2,
1263 LPDIRECT3DVIEWPORT2* lplpDirect3DViewport2,
1266 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1267 FIXME("(%p/%p)->(%p,%p,%08lx): stub!\n", This, iface, lpDirect3DViewport2, lplpDirect3DViewport2, dwFlags);
1272 Main_IDirect3DDeviceImpl_2_1T_EnumTextureFormats(LPDIRECT3DDEVICE2 iface,
1273 LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc,
1276 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1277 FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpD3DEnumTextureProc, lpArg);
1282 Main_IDirect3DDeviceImpl_2_Begin(LPDIRECT3DDEVICE2 iface,
1283 D3DPRIMITIVETYPE d3dpt,
1284 D3DVERTEXTYPE dwVertexTypeDesc,
1287 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1288 FIXME("(%p/%p)->(%08x,%08x,%08lx): stub!\n", This, iface, d3dpt, dwVertexTypeDesc, dwFlags);
1293 Main_IDirect3DDeviceImpl_2_BeginIndexed(LPDIRECT3DDEVICE2 iface,
1294 D3DPRIMITIVETYPE d3dptPrimitiveType,
1295 D3DVERTEXTYPE d3dvtVertexType,
1297 DWORD dwNumVertices,
1300 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1301 FIXME("(%p/%p)->(%08x,%08x,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwNumVertices, dwFlags);
1306 Main_IDirect3DDeviceImpl_2_DrawPrimitive(LPDIRECT3DDEVICE2 iface,
1307 D3DPRIMITIVETYPE d3dptPrimitiveType,
1308 D3DVERTEXTYPE d3dvtVertexType,
1310 DWORD dwVertexCount,
1313 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1314 FIXME("(%p/%p)->(%08x,%08x,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwFlags);
1319 Main_IDirect3DDeviceImpl_2_DrawIndexedPrimitive(LPDIRECT3DDEVICE2 iface,
1320 D3DPRIMITIVETYPE d3dptPrimitiveType,
1321 D3DVERTEXTYPE d3dvtVertexType,
1323 DWORD dwVertexCount,
1328 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
1329 FIXME("(%p/%p)->(%08x,%08x,%p,%08lx,%p,%08lx,%08lx): stub!\n", This, iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwIndices, dwIndexCount, dwFlags);
1334 Main_IDirect3DDeviceImpl_1_Initialize(LPDIRECT3DDEVICE iface,
1335 LPDIRECT3D lpDirect3D,
1337 LPD3DDEVICEDESC lpD3DDVDesc)
1339 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1340 FIXME("(%p/%p)->(%p,%p,%p): stub!\n", This, iface, lpDirect3D, lpGUID, lpD3DDVDesc);
1345 Main_IDirect3DDeviceImpl_1_CreateExecuteBuffer(LPDIRECT3DDEVICE iface,
1346 LPD3DEXECUTEBUFFERDESC lpDesc,
1347 LPDIRECT3DEXECUTEBUFFER* lplpDirect3DExecuteBuffer,
1348 IUnknown* pUnkOuter)
1350 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1351 FIXME("(%p/%p)->(%p,%p,%p): stub!\n", This, iface, lpDesc, lplpDirect3DExecuteBuffer, pUnkOuter);
1356 Main_IDirect3DDeviceImpl_1_Execute(LPDIRECT3DDEVICE iface,
1357 LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer,
1358 LPDIRECT3DVIEWPORT lpDirect3DViewport,
1361 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1362 IDirect3DExecuteBufferImpl *lpDirect3DExecuteBufferImpl = ICOM_OBJECT(IDirect3DExecuteBufferImpl, IDirect3DExecuteBuffer, lpDirect3DExecuteBuffer);
1363 IDirect3DViewportImpl *lpDirect3DViewportImpl = ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, lpDirect3DViewport);
1365 TRACE("(%p/%p)->(%p,%p,%08lx)\n", This, iface, lpDirect3DExecuteBuffer, lpDirect3DViewport, dwFlags);
1367 /* Put this as the default context */
1370 lpDirect3DExecuteBufferImpl->execute(lpDirect3DExecuteBufferImpl, This, lpDirect3DViewportImpl);
1376 Main_IDirect3DDeviceImpl_1_NextViewport(LPDIRECT3DDEVICE iface,
1377 LPDIRECT3DVIEWPORT lpDirect3DViewport,
1378 LPDIRECT3DVIEWPORT* lplpDirect3DViewport,
1381 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1382 FIXME("(%p/%p)->(%p,%p,%08lx): stub!\n", This, iface, lpDirect3DViewport, lplpDirect3DViewport, dwFlags);
1387 Main_IDirect3DDeviceImpl_1_Pick(LPDIRECT3DDEVICE iface,
1388 LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer,
1389 LPDIRECT3DVIEWPORT lpDirect3DViewport,
1393 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1394 FIXME("(%p/%p)->(%p,%p,%08lx,%p): stub!\n", This, iface, lpDirect3DExecuteBuffer, lpDirect3DViewport, dwFlags, lpRect);
1399 Main_IDirect3DDeviceImpl_1_GetPickRecords(LPDIRECT3DDEVICE iface,
1401 LPD3DPICKRECORD lpD3DPickRec)
1403 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1404 FIXME("(%p/%p)->(%p,%p): stub!\n", This, iface, lpCount, lpD3DPickRec);
1409 Main_IDirect3DDeviceImpl_1_CreateMatrix(LPDIRECT3DDEVICE iface,
1410 LPD3DMATRIXHANDLE lpD3DMatHandle)
1412 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1413 TRACE("(%p/%p)->(%p)\n", This, iface, lpD3DMatHandle);
1415 *lpD3DMatHandle = (D3DMATRIXHANDLE) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(D3DMATRIX));
1416 TRACE(" returning matrix handle %p\n", (void *) *lpD3DMatHandle);
1422 Main_IDirect3DDeviceImpl_1_SetMatrix(LPDIRECT3DDEVICE iface,
1423 D3DMATRIXHANDLE D3DMatHandle,
1424 LPD3DMATRIX lpD3DMatrix)
1426 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1427 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, (DWORD) D3DMatHandle, lpD3DMatrix);
1429 if (TRACE_ON(ddraw)) {
1430 dump_D3DMATRIX(lpD3DMatrix);
1432 *((D3DMATRIX *) D3DMatHandle) = *lpD3DMatrix;
1438 Main_IDirect3DDeviceImpl_1_GetMatrix(LPDIRECT3DDEVICE iface,
1439 D3DMATRIXHANDLE D3DMatHandle,
1440 LPD3DMATRIX lpD3DMatrix)
1442 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1443 TRACE("(%p/%p)->(%08lx,%p)\n", This, iface, (DWORD) D3DMatHandle, lpD3DMatrix);
1445 *lpD3DMatrix = *((D3DMATRIX *) D3DMatHandle);
1451 Main_IDirect3DDeviceImpl_1_DeleteMatrix(LPDIRECT3DDEVICE iface,
1452 D3DMATRIXHANDLE D3DMatHandle)
1454 ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice, iface);
1455 TRACE("(%p/%p)->(%08lx)\n", This, iface, (DWORD) D3DMatHandle);
1457 HeapFree(GetProcessHeap(), 0, (void *) D3DMatHandle);
1463 Thunk_IDirect3DDeviceImpl_3_QueryInterface(LPDIRECT3DDEVICE3 iface,
1467 TRACE("(%p)->(%s,%p) thunking to IDirect3DDevice7 interface.\n", iface, debugstr_guid(riid), obp);
1468 return IDirect3DDevice7_QueryInterface(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1474 Thunk_IDirect3DDeviceImpl_2_QueryInterface(LPDIRECT3DDEVICE2 iface,
1478 TRACE("(%p)->(%s,%p) thunking to IDirect3DDevice7 interface.\n", iface, debugstr_guid(riid), obp);
1479 return IDirect3DDevice7_QueryInterface(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1485 Thunk_IDirect3DDeviceImpl_1_QueryInterface(LPDIRECT3DDEVICE iface,
1489 TRACE("(%p)->(%s,%p) thunking to IDirect3DDevice7 interface.\n", iface, debugstr_guid(riid), obp);
1490 return IDirect3DDevice7_QueryInterface(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface),
1496 Thunk_IDirect3DDeviceImpl_3_AddRef(LPDIRECT3DDEVICE3 iface)
1498 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1499 return IDirect3DDevice7_AddRef(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface));
1503 Thunk_IDirect3DDeviceImpl_2_AddRef(LPDIRECT3DDEVICE2 iface)
1505 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1506 return IDirect3DDevice7_AddRef(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface));
1510 Thunk_IDirect3DDeviceImpl_1_AddRef(LPDIRECT3DDEVICE iface)
1512 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1513 return IDirect3DDevice7_AddRef(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface));
1517 Thunk_IDirect3DDeviceImpl_3_Release(LPDIRECT3DDEVICE3 iface)
1519 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1520 return IDirect3DDevice7_Release(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface));
1524 Thunk_IDirect3DDeviceImpl_2_Release(LPDIRECT3DDEVICE2 iface)
1526 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1527 return IDirect3DDevice7_Release(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface));
1531 Thunk_IDirect3DDeviceImpl_1_Release(LPDIRECT3DDEVICE iface)
1533 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1534 return IDirect3DDevice7_Release(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface));
1538 Thunk_IDirect3DDeviceImpl_2_AddViewport(LPDIRECT3DDEVICE2 iface,
1539 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2)
1541 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport2);
1542 return IDirect3DDevice3_AddViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1543 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */);
1547 Thunk_IDirect3DDeviceImpl_1_AddViewport(LPDIRECT3DDEVICE iface,
1548 LPDIRECT3DVIEWPORT lpDirect3DViewport)
1550 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport);
1551 return IDirect3DDevice3_AddViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
1552 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport /* No need to cast here as all interfaces are equivalent */);
1556 Thunk_IDirect3DDeviceImpl_2_DeleteViewport(LPDIRECT3DDEVICE2 iface,
1557 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2)
1559 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport2);
1560 return IDirect3DDevice3_DeleteViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1561 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */);
1565 Thunk_IDirect3DDeviceImpl_1_DeleteViewport(LPDIRECT3DDEVICE iface,
1566 LPDIRECT3DVIEWPORT lpDirect3DViewport)
1568 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport);
1569 return IDirect3DDevice3_DeleteViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
1570 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport /* No need to cast here as all interfaces are equivalent */);
1574 Thunk_IDirect3DDeviceImpl_2_NextViewport(LPDIRECT3DDEVICE3 iface,
1575 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2,
1576 LPDIRECT3DVIEWPORT2* lplpDirect3DViewport2,
1579 TRACE("(%p)->(%p,%p,%08lx) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport2, lplpDirect3DViewport2, dwFlags);
1580 return IDirect3DDevice3_NextViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1581 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */,
1582 (LPDIRECT3DVIEWPORT3*) lplpDirect3DViewport2,
1587 Thunk_IDirect3DDeviceImpl_1_NextViewport(LPDIRECT3DDEVICE3 iface,
1588 LPDIRECT3DVIEWPORT lpDirect3DViewport,
1589 LPDIRECT3DVIEWPORT* lplpDirect3DViewport,
1592 TRACE("(%p)->(%p,%p,%08lx) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport, lplpDirect3DViewport, dwFlags);
1593 return IDirect3DDevice3_NextViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
1594 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport /* No need to cast here as all interfaces are equivalent */,
1595 (LPDIRECT3DVIEWPORT3*) lplpDirect3DViewport,
1600 Thunk_IDirect3DDeviceImpl_3_GetDirect3D(LPDIRECT3DDEVICE3 iface,
1601 LPDIRECT3D3* lplpDirect3D3)
1604 LPDIRECT3D7 ret_ptr;
1606 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpDirect3D3);
1607 ret = IDirect3DDevice7_GetDirect3D(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1609 *lplpDirect3D3 = COM_INTERFACE_CAST(IDirectDrawImpl, IDirect3D7, IDirect3D3, ret_ptr);
1610 TRACE(" returning interface %p\n", *lplpDirect3D3);
1615 Thunk_IDirect3DDeviceImpl_2_GetDirect3D(LPDIRECT3DDEVICE2 iface,
1616 LPDIRECT3D2* lplpDirect3D2)
1619 LPDIRECT3D7 ret_ptr;
1621 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpDirect3D2);
1622 ret = IDirect3DDevice7_GetDirect3D(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1624 *lplpDirect3D2 = COM_INTERFACE_CAST(IDirectDrawImpl, IDirect3D7, IDirect3D2, ret_ptr);
1625 TRACE(" returning interface %p\n", *lplpDirect3D2);
1630 Thunk_IDirect3DDeviceImpl_1_GetDirect3D(LPDIRECT3DDEVICE iface,
1631 LPDIRECT3D* lplpDirect3D)
1634 LPDIRECT3D7 ret_ptr;
1636 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpDirect3D);
1637 ret = IDirect3DDevice7_GetDirect3D(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface),
1639 *lplpDirect3D = COM_INTERFACE_CAST(IDirectDrawImpl, IDirect3D7, IDirect3D, ret_ptr);
1640 TRACE(" returning interface %p\n", *lplpDirect3D);
1645 Thunk_IDirect3DDeviceImpl_2_SetCurrentViewport(LPDIRECT3DDEVICE2 iface,
1646 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2)
1648 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpDirect3DViewport2);
1649 return IDirect3DDevice3_SetCurrentViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1650 (LPDIRECT3DVIEWPORT3) lpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */);
1654 Thunk_IDirect3DDeviceImpl_2_GetCurrentViewport(LPDIRECT3DDEVICE2 iface,
1655 LPDIRECT3DVIEWPORT2* lplpDirect3DViewport2)
1657 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lplpDirect3DViewport2);
1658 return IDirect3DDevice3_GetCurrentViewport(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
1659 (LPDIRECT3DVIEWPORT3*) lplpDirect3DViewport2 /* No need to cast here as all interfaces are equivalent */);
1663 Thunk_IDirect3DDeviceImpl_3_EnumTextureFormats(LPDIRECT3DDEVICE3 iface,
1664 LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc,
1667 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DEnumPixelProc, lpArg);
1668 return IDirect3DDevice7_EnumTextureFormats(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1674 Thunk_IDirect3DDeviceImpl_3_BeginScene(LPDIRECT3DDEVICE3 iface)
1676 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1677 return IDirect3DDevice7_BeginScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface));
1681 Thunk_IDirect3DDeviceImpl_2_BeginScene(LPDIRECT3DDEVICE2 iface)
1683 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1684 return IDirect3DDevice7_BeginScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface));
1688 Thunk_IDirect3DDeviceImpl_1_BeginScene(LPDIRECT3DDEVICE iface)
1690 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1691 return IDirect3DDevice7_BeginScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface));
1695 Thunk_IDirect3DDeviceImpl_3_EndScene(LPDIRECT3DDEVICE3 iface)
1697 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1698 return IDirect3DDevice7_EndScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface));
1702 Thunk_IDirect3DDeviceImpl_2_EndScene(LPDIRECT3DDEVICE2 iface)
1704 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1705 return IDirect3DDevice7_EndScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface));
1709 Thunk_IDirect3DDeviceImpl_1_EndScene(LPDIRECT3DDEVICE iface)
1711 TRACE("(%p)->() thunking to IDirect3DDevice7 interface.\n", iface);
1712 return IDirect3DDevice7_EndScene(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice7, iface));
1716 Thunk_IDirect3DDeviceImpl_3_SetTransform(LPDIRECT3DDEVICE3 iface,
1717 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1718 LPD3DMATRIX lpD3DMatrix)
1720 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1721 return IDirect3DDevice7_SetTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1722 dtstTransformStateType,
1727 Thunk_IDirect3DDeviceImpl_2_SetTransform(LPDIRECT3DDEVICE2 iface,
1728 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1729 LPD3DMATRIX lpD3DMatrix)
1731 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1732 return IDirect3DDevice7_SetTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1733 dtstTransformStateType,
1738 Thunk_IDirect3DDeviceImpl_3_GetTransform(LPDIRECT3DDEVICE3 iface,
1739 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1740 LPD3DMATRIX lpD3DMatrix)
1742 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1743 return IDirect3DDevice7_GetTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1744 dtstTransformStateType,
1749 Thunk_IDirect3DDeviceImpl_2_GetTransform(LPDIRECT3DDEVICE2 iface,
1750 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1751 LPD3DMATRIX lpD3DMatrix)
1753 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1754 return IDirect3DDevice7_GetTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1755 dtstTransformStateType,
1760 Thunk_IDirect3DDeviceImpl_3_MultiplyTransform(LPDIRECT3DDEVICE3 iface,
1761 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1762 LPD3DMATRIX lpD3DMatrix)
1764 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1765 return IDirect3DDevice7_MultiplyTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1766 dtstTransformStateType,
1771 Thunk_IDirect3DDeviceImpl_2_MultiplyTransform(LPDIRECT3DDEVICE2 iface,
1772 D3DTRANSFORMSTATETYPE dtstTransformStateType,
1773 LPD3DMATRIX lpD3DMatrix)
1775 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dtstTransformStateType, lpD3DMatrix);
1776 return IDirect3DDevice7_MultiplyTransform(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1777 dtstTransformStateType,
1782 Thunk_IDirect3DDeviceImpl_3_SetRenderState(LPDIRECT3DDEVICE3 iface,
1783 D3DRENDERSTATETYPE dwRenderStateType,
1784 DWORD dwRenderState)
1786 TRACE("(%p)->(%08x,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, dwRenderStateType, dwRenderState);
1787 return IDirect3DDevice7_SetRenderState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1793 Thunk_IDirect3DDeviceImpl_2_SetRenderState(LPDIRECT3DDEVICE2 iface,
1794 D3DRENDERSTATETYPE dwRenderStateType,
1795 DWORD dwRenderState)
1797 TRACE("(%p)->(%08x,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, dwRenderStateType, dwRenderState);
1798 return IDirect3DDevice7_SetRenderState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1804 Thunk_IDirect3DDeviceImpl_3_GetRenderState(LPDIRECT3DDEVICE3 iface,
1805 D3DRENDERSTATETYPE dwRenderStateType,
1806 LPDWORD lpdwRenderState)
1808 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwRenderStateType, lpdwRenderState);
1809 return IDirect3DDevice7_GetRenderState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1815 Thunk_IDirect3DDeviceImpl_2_GetRenderState(LPDIRECT3DDEVICE2 iface,
1816 D3DRENDERSTATETYPE dwRenderStateType,
1817 LPDWORD lpdwRenderState)
1819 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwRenderStateType, lpdwRenderState);
1820 return IDirect3DDevice7_GetRenderState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1826 Thunk_IDirect3DDeviceImpl_3_DrawPrimitive(LPDIRECT3DDEVICE3 iface,
1827 D3DPRIMITIVETYPE d3dptPrimitiveType,
1828 DWORD d3dvtVertexType,
1830 DWORD dwVertexCount,
1833 TRACE("(%p)->(%08x,%08lx,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwFlags);
1834 return IDirect3DDevice7_DrawPrimitive(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1843 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitive(LPDIRECT3DDEVICE3 iface,
1844 D3DPRIMITIVETYPE d3dptPrimitiveType,
1845 DWORD d3dvtVertexType,
1847 DWORD dwVertexCount,
1852 TRACE("(%p)->(%08x,%08lx,%p,%08lx,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, d3dptPrimitiveType, d3dvtVertexType, lpvVertices, dwVertexCount, dwIndices, dwIndexCount, dwFlags);
1853 return IDirect3DDevice7_DrawIndexedPrimitive(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1864 Thunk_IDirect3DDeviceImpl_3_SetClipStatus(LPDIRECT3DDEVICE3 iface,
1865 LPD3DCLIPSTATUS lpD3DClipStatus)
1867 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DClipStatus);
1868 return IDirect3DDevice7_SetClipStatus(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1873 Thunk_IDirect3DDeviceImpl_2_SetClipStatus(LPDIRECT3DDEVICE2 iface,
1874 LPD3DCLIPSTATUS lpD3DClipStatus)
1876 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DClipStatus);
1877 return IDirect3DDevice7_SetClipStatus(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1882 Thunk_IDirect3DDeviceImpl_3_GetClipStatus(LPDIRECT3DDEVICE3 iface,
1883 LPD3DCLIPSTATUS lpD3DClipStatus)
1885 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DClipStatus);
1886 return IDirect3DDevice7_GetClipStatus(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1891 Thunk_IDirect3DDeviceImpl_2_GetClipStatus(LPDIRECT3DDEVICE2 iface,
1892 LPD3DCLIPSTATUS lpD3DClipStatus)
1894 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpD3DClipStatus);
1895 return IDirect3DDevice7_GetClipStatus(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
1900 Thunk_IDirect3DDeviceImpl_3_DrawPrimitiveStrided(LPDIRECT3DDEVICE3 iface,
1901 D3DPRIMITIVETYPE d3dptPrimitiveType,
1903 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,
1904 DWORD dwVertexCount,
1907 TRACE("(%p)->(%08x,%08lx,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, d3dptPrimitiveType, dwVertexType, lpD3DDrawPrimStrideData, dwVertexCount, dwFlags);
1908 return IDirect3DDevice7_DrawPrimitiveStrided(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1911 lpD3DDrawPrimStrideData,
1917 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveStrided(LPDIRECT3DDEVICE3 iface,
1918 D3DPRIMITIVETYPE d3dptPrimitiveType,
1920 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,
1921 DWORD dwVertexCount,
1926 TRACE("(%p)->(%08x,%08lx,%p,%08lx,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, d3dptPrimitiveType, dwVertexType, lpD3DDrawPrimStrideData, dwVertexCount, lpIndex, dwIndexCount, dwFlags);
1927 return IDirect3DDevice7_DrawIndexedPrimitiveStrided(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1930 lpD3DDrawPrimStrideData,
1938 Thunk_IDirect3DDeviceImpl_3_ComputeSphereVisibility(LPDIRECT3DDEVICE3 iface,
1939 LPD3DVECTOR lpCenters,
1943 LPDWORD lpdwReturnValues)
1945 TRACE("(%p)->(%p,%p,%08lx,%08lx,%p) thunking to IDirect3DDevice7 interface.\n", iface, lpCenters, lpRadii, dwNumSpheres, dwFlags, lpdwReturnValues);
1946 return IDirect3DDevice7_ComputeSphereVisibility(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1955 Thunk_IDirect3DDeviceImpl_3_GetTextureStageState(LPDIRECT3DDEVICE3 iface,
1957 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,
1960 TRACE("(%p)->(%08lx,%08x,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, d3dTexStageStateType, lpdwState);
1961 return IDirect3DDevice7_GetTextureStageState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1963 d3dTexStageStateType,
1968 Thunk_IDirect3DDeviceImpl_3_SetTextureStageState(LPDIRECT3DDEVICE3 iface,
1970 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,
1973 TRACE("(%p)->(%08lx,%08x,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, d3dTexStageStateType, dwState);
1974 return IDirect3DDevice7_SetTextureStageState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1976 d3dTexStageStateType,
1981 Thunk_IDirect3DDeviceImpl_3_ValidateDevice(LPDIRECT3DDEVICE3 iface,
1984 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lpdwPasses);
1985 return IDirect3DDevice7_ValidateDevice(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
1990 Thunk_IDirect3DDeviceImpl_2_GetCaps(LPDIRECT3DDEVICE2 iface,
1991 LPD3DDEVICEDESC lpD3DHWDevDesc,
1992 LPD3DDEVICEDESC lpD3DHELDevDesc)
1994 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice3 interface.\n", iface, lpD3DHWDevDesc, lpD3DHELDevDesc);
1995 return IDirect3DDevice3_GetCaps(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2001 Thunk_IDirect3DDeviceImpl_1_GetCaps(LPDIRECT3DDEVICE iface,
2002 LPD3DDEVICEDESC lpD3DHWDevDesc,
2003 LPD3DDEVICEDESC lpD3DHELDevDesc)
2005 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice3 interface.\n", iface, lpD3DHWDevDesc, lpD3DHELDevDesc);
2006 return IDirect3DDevice3_GetCaps(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
2012 Thunk_IDirect3DDeviceImpl_1_SwapTextureHandles(LPDIRECT3DDEVICE iface,
2013 LPDIRECT3DTEXTURE lpD3DTex1,
2014 LPDIRECT3DTEXTURE lpD3DTex2)
2016 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice2 interface.\n", iface, lpD3DTex1, lpD3DTex2);
2017 return IDirect3DDevice2_SwapTextureHandles(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice2, iface),
2018 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture, IDirect3DTexture2, lpD3DTex1),
2019 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture, IDirect3DTexture2, lpD3DTex2));
2023 Thunk_IDirect3DDeviceImpl_2_GetStats(LPDIRECT3DDEVICE2 iface,
2024 LPD3DSTATS lpD3DStats)
2026 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpD3DStats);
2027 return IDirect3DDevice3_GetStats(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2032 Thunk_IDirect3DDeviceImpl_1_GetStats(LPDIRECT3DDEVICE iface,
2033 LPD3DSTATS lpD3DStats)
2035 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpD3DStats);
2036 return IDirect3DDevice3_GetStats(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice3, iface),
2041 Thunk_IDirect3DDeviceImpl_3_SetRenderTarget(LPDIRECT3DDEVICE3 iface,
2042 LPDIRECTDRAWSURFACE4 lpNewRenderTarget,
2045 TRACE("(%p)->(%p,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, lpNewRenderTarget, dwFlags);
2046 return IDirect3DDevice7_SetRenderTarget(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2047 (LPDIRECTDRAWSURFACE7) lpNewRenderTarget /* No cast needed as DSurf4 == DSurf7 */,
2052 Thunk_IDirect3DDeviceImpl_3_GetRenderTarget(LPDIRECT3DDEVICE3 iface,
2053 LPDIRECTDRAWSURFACE4* lplpRenderTarget)
2055 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpRenderTarget);
2056 return IDirect3DDevice7_GetRenderTarget(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2057 (LPDIRECTDRAWSURFACE7*) lplpRenderTarget /* No cast needed as DSurf4 == DSurf7 */);
2061 Thunk_IDirect3DDeviceImpl_2_SetRenderTarget(LPDIRECT3DDEVICE2 iface,
2062 LPDIRECTDRAWSURFACE lpNewRenderTarget,
2065 TRACE("(%p)->(%p,%08lx) thunking to IDirect3DDevice7 interface.\n", iface, lpNewRenderTarget, dwFlags);
2066 return IDirect3DDevice7_SetRenderTarget(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
2067 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface3, IDirectDrawSurface7, lpNewRenderTarget),
2072 Thunk_IDirect3DDeviceImpl_2_GetRenderTarget(LPDIRECT3DDEVICE2 iface,
2073 LPDIRECTDRAWSURFACE* lplpRenderTarget)
2076 LPDIRECTDRAWSURFACE7 ret_val;
2078 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface, lplpRenderTarget);
2079 ret = IDirect3DDevice7_GetRenderTarget(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice7, iface),
2081 *lplpRenderTarget = (LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirectDrawSurface3, ret_val);
2082 TRACE(" returning interface %p\n", *lplpRenderTarget);
2087 Thunk_IDirect3DDeviceImpl_2_Vertex(LPDIRECT3DDEVICE2 iface,
2088 LPVOID lpVertexType)
2090 TRACE("(%p)->(%p) thunking to IDirect3DDevice3 interface.\n", iface, lpVertexType);
2091 return IDirect3DDevice3_Vertex(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2096 Thunk_IDirect3DDeviceImpl_2_Index(LPDIRECT3DDEVICE2 iface,
2099 TRACE("(%p)->(%04x) thunking to IDirect3DDevice3 interface.\n", iface, wVertexIndex);
2100 return IDirect3DDevice3_Index(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2105 Thunk_IDirect3DDeviceImpl_2_End(LPDIRECT3DDEVICE2 iface,
2108 TRACE("(%p)->(%08lx) thunking to IDirect3DDevice3 interface.\n", iface, dwFlags);
2109 return IDirect3DDevice3_End(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2114 Thunk_IDirect3DDeviceImpl_2_GetLightState(LPDIRECT3DDEVICE2 iface,
2115 D3DLIGHTSTATETYPE dwLightStateType,
2116 LPDWORD lpdwLightState)
2118 TRACE("(%p)->(%08x,%p) thunking to IDirect3DDevice3 interface.\n", iface, dwLightStateType, lpdwLightState);
2119 return IDirect3DDevice3_GetLightState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2125 Thunk_IDirect3DDeviceImpl_2_SetLightState(LPDIRECT3DDEVICE2 iface,
2126 D3DLIGHTSTATETYPE dwLightStateType,
2129 TRACE("(%p)->(%08x,%08lx) thunking to IDirect3DDevice3 interface.\n", iface, dwLightStateType, dwLightState);
2130 return IDirect3DDevice3_SetLightState(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice2, IDirect3DDevice3, iface),
2136 Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface,
2137 LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc,
2140 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice2 interface.\n", iface, lpD3DEnumTextureProc, lpArg);
2141 return IDirect3DDevice2_EnumTextureFormats(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice, IDirect3DDevice2, iface),
2142 lpD3DEnumTextureProc,
2147 Thunk_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface,
2149 LPDIRECT3DTEXTURE2 lpTexture2)
2151 TRACE("(%p)->(%ld,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, lpTexture2);
2152 return IDirect3DDevice7_SetTexture(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2154 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirect3DTexture2, IDirectDrawSurface7, lpTexture2));
2158 Thunk_IDirect3DDeviceImpl_3_DrawPrimitiveVB(LPDIRECT3DDEVICE3 iface,
2159 D3DPRIMITIVETYPE d3dptPrimitiveType,
2160 LPDIRECT3DVERTEXBUFFER lpD3DVertexBuf,
2161 DWORD dwStartVertex,
2162 DWORD dwNumVertices,
2165 TRACE("(%p)->(%08x,%p,%08lx,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface,
2166 d3dptPrimitiveType, lpD3DVertexBuf, dwStartVertex, dwNumVertices, dwFlags);
2167 return IDirect3DDevice7_DrawPrimitiveVB(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2169 COM_INTERFACE_CAST(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, IDirect3DVertexBuffer7, lpD3DVertexBuf),
2176 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveVB(LPDIRECT3DDEVICE3 iface,
2177 D3DPRIMITIVETYPE d3dptPrimitiveType,
2178 LPDIRECT3DVERTEXBUFFER lpD3DVertexBuf,
2183 TRACE("(%p)->(%08x,%p,%p,%08lx,%08lx) thunking to IDirect3DDevice7 interface.\n", iface,
2184 d3dptPrimitiveType, lpD3DVertexBuf, lpwIndices, dwIndexCount, dwFlags);
2185 return IDirect3DDevice7_DrawIndexedPrimitiveVB(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2187 COM_INTERFACE_CAST(IDirect3DVertexBufferImpl, IDirect3DVertexBuffer, IDirect3DVertexBuffer7, lpD3DVertexBuf),
2196 Thunk_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface,
2198 LPDIRECT3DTEXTURE2* lplpTexture2)
2201 LPDIRECTDRAWSURFACE7 ret_val;
2203 TRACE("(%p)->(%ld,%p) thunking to IDirect3DDevice7 interface.\n", iface, dwStage, lplpTexture2);
2204 ret = IDirect3DDevice7_GetTexture(COM_INTERFACE_CAST(IDirect3DDeviceImpl, IDirect3DDevice3, IDirect3DDevice7, iface),
2208 *lplpTexture2 = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirect3DTexture2, ret_val);
2210 TRACE(" returning interface %p.\n", *lplpTexture2);