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"
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
)
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
;
201 Main_IDirect3DDeviceImpl_7_3T_2T_1T_QueryInterface(LPDIRECT3DDEVICE7 iface
,
205 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
206 TRACE("(%p/%p)->(%s,%p)\n", This
, iface
, debugstr_guid(riid
), obp
);
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
));
216 TRACE(" Creating IUnknown interface at %p.\n", *obp
);
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
);
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
);
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
);
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
);
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
);
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
);
258 FIXME("(%p): interface for IID %s NOT found!\n", This
, debugstr_guid(riid
));
259 return OLE_E_ENUM_NOMORE
;
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);
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);
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
);
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
);
305 Main_IDirect3DDeviceImpl_7_3T_EnumTextureFormats(LPDIRECT3DDEVICE7 iface
,
306 LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc
,
309 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
310 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lpD3DEnumPixelProc
, lpArg
);
315 Main_IDirect3DDeviceImpl_7_3T_2T_1T_BeginScene(LPDIRECT3DDEVICE7 iface
)
317 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
318 TRACE("(%p/%p)->()\n", This
, iface
);
324 Main_IDirect3DDeviceImpl_7_3T_2T_1T_EndScene(LPDIRECT3DDEVICE7 iface
)
326 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
327 TRACE("(%p/%p)->()\n", This
, iface
);
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
);
347 Main_IDirect3DDeviceImpl_7_3T_2T_SetRenderTarget(LPDIRECT3DDEVICE7 iface
,
348 LPDIRECTDRAWSURFACE7 lpNewRenderTarget
,
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");
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
);
377 Main_IDirect3DDeviceImpl_7_Clear(LPDIRECT3DDEVICE7 iface
,
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
);
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
;
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
;
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
;
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
;
442 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType
);
446 if (matrix_changed
!= 0x00000000) This
->matrices_updated(This
, matrix_changed
);
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
);
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
);
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
);
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
);
501 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType
);
502 return DDERR_INVALIDPARAMS
;
509 Main_IDirect3DDeviceImpl_7_3T_2T_MultiplyTransform(LPDIRECT3DDEVICE7 iface
,
510 D3DTRANSFORMSTATETYPE dtstTransformStateType
,
511 LPD3DMATRIX lpD3DMatrix
)
513 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
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
;
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
;
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
;
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
;
565 ERR("Unknown transform type %08x !!!\n", dtstTransformStateType
);
566 return DDERR_INVALIDPARAMS
;
569 multiply_matrix(mat
,mat
,lpD3DMatrix
);
571 if (TRACE_ON(ddraw
)) {
575 if (matrix_changed
!= 0x00000000) This
->matrices_updated(This
, matrix_changed
);
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
);
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
);
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
);
629 Main_IDirect3DDeviceImpl_7_SetLight(LPDIRECT3DDEVICE7 iface
,
633 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
634 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This
, iface
, dwLightIndex
, lpLight
);
639 Main_IDirect3DDeviceImpl_7_GetLight(LPDIRECT3DDEVICE7 iface
,
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
);
658 Main_IDirect3DDeviceImpl_7_3T_2T_SetRenderState(LPDIRECT3DDEVICE7 iface
,
659 D3DRENDERSTATETYPE dwRenderStateType
,
662 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
663 FIXME("(%p/%p)->(%08x,%08lx): stub!\n", This
, iface
, dwRenderStateType
, dwRenderState
);
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
);
678 Main_IDirect3DDeviceImpl_7_BeginStateBlock(LPDIRECT3DDEVICE7 iface
)
680 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
681 FIXME("(%p/%p)->(): stub!\n", This
, iface
);
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
);
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
);
704 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitive(LPDIRECT3DDEVICE7 iface
,
705 D3DPRIMITIVETYPE d3dptPrimitiveType
,
706 DWORD d3dvtVertexType
,
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
);
717 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitive(LPDIRECT3DDEVICE7 iface
,
718 D3DPRIMITIVETYPE d3dptPrimitiveType
,
719 DWORD d3dvtVertexType
,
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
);
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
);
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
);
750 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitiveStrided(LPDIRECT3DDEVICE7 iface
,
751 D3DPRIMITIVETYPE d3dptPrimitiveType
,
753 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData
,
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
);
763 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitiveStrided(LPDIRECT3DDEVICE7 iface
,
764 D3DPRIMITIVETYPE d3dptPrimitiveType
,
766 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData
,
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
);
778 Main_IDirect3DDeviceImpl_7_3T_DrawPrimitiveVB(LPDIRECT3DDEVICE7 iface
,
779 D3DPRIMITIVETYPE d3dptPrimitiveType
,
780 LPDIRECT3DVERTEXBUFFER7 lpD3DVertexBuf
,
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
);
791 Main_IDirect3DDeviceImpl_7_3T_DrawIndexedPrimitiveVB(LPDIRECT3DDEVICE7 iface
,
792 D3DPRIMITIVETYPE d3dptPrimitiveType
,
793 LPDIRECT3DVERTEXBUFFER7 lpD3DVertexBuf
,
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
);
806 Main_IDirect3DDeviceImpl_7_3T_ComputeSphereVisibility(LPDIRECT3DDEVICE7 iface
,
807 LPD3DVECTOR lpCenters
,
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
);
819 Main_IDirect3DDeviceImpl_7_3T_GetTexture(LPDIRECT3DDEVICE7 iface
,
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
);
833 TRACE(" returning interface at %p (for implementation at %p).\n", *lpTexture
, This
->current_texture
[dwStage
]);
839 Main_IDirect3DDeviceImpl_7_3T_SetTexture(LPDIRECT3DDEVICE7 iface
,
841 LPDIRECTDRAWSURFACE7 lpTexture
)
843 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
844 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This
, iface
, dwStage
, lpTexture
);
849 Main_IDirect3DDeviceImpl_7_3T_GetTextureStageState(LPDIRECT3DDEVICE7 iface
,
851 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType
,
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];
860 return DDERR_INVALIDPARAMS
;
864 Main_IDirect3DDeviceImpl_7_3T_SetTextureStageState(LPDIRECT3DDEVICE7 iface
,
866 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType
,
869 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
870 FIXME("(%p/%p)->(%08lx,%08x,%08lx): stub!\n", This
, iface
, dwStage
, d3dTexStageStateType
, dwState
);
875 Main_IDirect3DDeviceImpl_7_3T_ValidateDevice(LPDIRECT3DDEVICE7 iface
,
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 :-) */
888 Main_IDirect3DDeviceImpl_7_ApplyStateBlock(LPDIRECT3DDEVICE7 iface
,
891 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
892 FIXME("(%p/%p)->(%08lx): stub!\n", This
, iface
, dwBlockHandle
);
897 Main_IDirect3DDeviceImpl_7_CaptureStateBlock(LPDIRECT3DDEVICE7 iface
,
900 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
901 FIXME("(%p/%p)->(%08lx): stub!\n", This
, iface
, dwBlockHandle
);
906 Main_IDirect3DDeviceImpl_7_DeleteStateBlock(LPDIRECT3DDEVICE7 iface
,
909 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
910 FIXME("(%p/%p)->(%08lx): stub!\n", This
, iface
, dwBlockHandle
);
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
);
925 Main_IDirect3DDeviceImpl_7_Load(LPDIRECT3DDEVICE7 iface
,
926 LPDIRECTDRAWSURFACE7 lpDestTex
,
928 LPDIRECTDRAWSURFACE7 lpSrcTex
,
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
));
940 Main_IDirect3DDeviceImpl_7_LightEnable(LPDIRECT3DDEVICE7 iface
,
944 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
945 FIXME("(%p/%p)->(%08lx,%d): stub!\n", This
, iface
, dwLightIndex
, bEnable
);
950 Main_IDirect3DDeviceImpl_7_GetLightEnable(LPDIRECT3DDEVICE7 iface
,
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
);
966 Main_IDirect3DDeviceImpl_7_SetClipPlane(LPDIRECT3DDEVICE7 iface
,
968 D3DVALUE
* pPlaneEquation
)
970 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice7
, iface
);
971 FIXME("(%p/%p)->(%08lx,%p): stub!\n", This
, iface
, dwIndex
, pPlaneEquation
);
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]));
992 Main_IDirect3DDeviceImpl_7_GetInfo(LPDIRECT3DDEVICE7 iface
,
994 LPVOID pDevInfoStruct
,
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 */
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
);
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
);
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
;
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... */
1065 prev_viewport
= cur_viewport
;
1066 cur_viewport
= cur_viewport
->next
;
1069 return DDERR_INVALIDPARAMS
;
1073 Main_IDirect3DDeviceImpl_3_2T_1T_NextViewport(LPDIRECT3DDEVICE3 iface
,
1074 LPDIRECT3DVIEWPORT3 lpDirect3DViewport3
,
1075 LPDIRECT3DVIEWPORT3
* lplpDirect3DViewport3
,
1078 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice3
, iface
);
1079 IDirect3DViewportImpl
*res
= NULL
;
1081 TRACE("(%p/%p)->(%p,%p,%08lx)\n", This
, iface
, lpDirect3DViewport3
, lplpDirect3DViewport3
, dwFlags
);
1084 case D3DNEXT_NEXT
: {
1085 IDirect3DViewportImpl
*lpDirect3DViewportImpl
= ICOM_OBJECT(IDirect3DViewportImpl
, IDirect3DViewport3
, lpDirect3DViewport3
);
1086 res
= lpDirect3DViewportImpl
->next
;
1088 case D3DNEXT_HEAD
: {
1089 res
= This
->viewport_list
;
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
;
1099 *lplpDirect3DViewport3
= NULL
;
1100 return DDERR_INVALIDPARAMS
;
1102 *lplpDirect3DViewport3
= ICOM_INTERFACE(res
, IDirect3DViewport3
);
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
))
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
);
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
);
1152 Main_IDirect3DDeviceImpl_3_Begin(LPDIRECT3DDEVICE3 iface
,
1153 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1154 DWORD dwVertexTypeDesc
,
1157 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice3
, iface
);
1158 FIXME("(%p/%p)->(%08x,%08lx,%08lx): stub!\n", This
, iface
, d3dptPrimitiveType
, dwVertexTypeDesc
, dwFlags
);
1163 Main_IDirect3DDeviceImpl_3_BeginIndexed(LPDIRECT3DDEVICE3 iface
,
1164 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1165 DWORD d3dvtVertexType
,
1167 DWORD dwNumVertices
,
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
);
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
);
1185 Main_IDirect3DDeviceImpl_3_2T_Index(LPDIRECT3DDEVICE3 iface
,
1188 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice3
, iface
);
1189 FIXME("(%p/%p)->(%04x): stub!\n", This
, iface
, wVertexIndex
);
1194 Main_IDirect3DDeviceImpl_3_2T_End(LPDIRECT3DDEVICE3 iface
,
1197 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice3
, iface
);
1198 FIXME("(%p/%p)->(%08lx): stub!\n", This
, iface
, dwFlags
);
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
);
1213 Main_IDirect3DDeviceImpl_3_2T_SetLightState(LPDIRECT3DDEVICE3 iface
,
1214 D3DLIGHTSTATETYPE dwLightStateType
,
1217 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice3
, iface
);
1218 FIXME("(%p/%p)->(%08x,%08lx): stub!\n", This
, iface
, dwLightStateType
, dwLightState
);
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
);
1241 Main_IDirect3DDeviceImpl_2_NextViewport(LPDIRECT3DDEVICE2 iface
,
1242 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2
,
1243 LPDIRECT3DVIEWPORT2
* lplpDirect3DViewport2
,
1246 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice2
, iface
);
1247 FIXME("(%p/%p)->(%p,%p,%08lx): stub!\n", This
, iface
, lpDirect3DViewport2
, lplpDirect3DViewport2
, dwFlags
);
1252 Main_IDirect3DDeviceImpl_2_1T_EnumTextureFormats(LPDIRECT3DDEVICE2 iface
,
1253 LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc
,
1256 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice2
, iface
);
1257 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lpD3DEnumTextureProc
, lpArg
);
1262 Main_IDirect3DDeviceImpl_2_Begin(LPDIRECT3DDEVICE2 iface
,
1263 D3DPRIMITIVETYPE d3dpt
,
1264 D3DVERTEXTYPE dwVertexTypeDesc
,
1267 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice2
, iface
);
1268 FIXME("(%p/%p)->(%08x,%08x,%08lx): stub!\n", This
, iface
, d3dpt
, dwVertexTypeDesc
, dwFlags
);
1273 Main_IDirect3DDeviceImpl_2_BeginIndexed(LPDIRECT3DDEVICE2 iface
,
1274 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1275 D3DVERTEXTYPE d3dvtVertexType
,
1277 DWORD dwNumVertices
,
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
);
1286 Main_IDirect3DDeviceImpl_2_DrawPrimitive(LPDIRECT3DDEVICE2 iface
,
1287 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1288 D3DVERTEXTYPE d3dvtVertexType
,
1290 DWORD dwVertexCount
,
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
);
1299 Main_IDirect3DDeviceImpl_2_DrawIndexedPrimitive(LPDIRECT3DDEVICE2 iface
,
1300 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1301 D3DVERTEXTYPE d3dvtVertexType
,
1303 DWORD dwVertexCount
,
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
);
1314 Main_IDirect3DDeviceImpl_1_Initialize(LPDIRECT3DDEVICE iface
,
1315 LPDIRECT3D lpDirect3D
,
1317 LPD3DDEVICEDESC lpD3DDVDesc
)
1319 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice
, iface
);
1320 FIXME("(%p/%p)->(%p,%p,%p): stub!\n", This
, iface
, lpDirect3D
, lpGUID
, lpD3DDVDesc
);
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
);
1336 Main_IDirect3DDeviceImpl_1_Execute(LPDIRECT3DDEVICE iface
,
1337 LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer
,
1338 LPDIRECT3DVIEWPORT lpDirect3DViewport
,
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 */
1350 lpDirect3DExecuteBufferImpl
->execute(lpDirect3DExecuteBufferImpl
, This
, lpDirect3DViewportImpl
);
1356 Main_IDirect3DDeviceImpl_1_NextViewport(LPDIRECT3DDEVICE iface
,
1357 LPDIRECT3DVIEWPORT lpDirect3DViewport
,
1358 LPDIRECT3DVIEWPORT
* lplpDirect3DViewport
,
1361 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice
, iface
);
1362 FIXME("(%p/%p)->(%p,%p,%08lx): stub!\n", This
, iface
, lpDirect3DViewport
, lplpDirect3DViewport
, dwFlags
);
1367 Main_IDirect3DDeviceImpl_1_Pick(LPDIRECT3DDEVICE iface
,
1368 LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer
,
1369 LPDIRECT3DVIEWPORT lpDirect3DViewport
,
1373 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice
, iface
);
1374 FIXME("(%p/%p)->(%p,%p,%08lx,%p): stub!\n", This
, iface
, lpDirect3DExecuteBuffer
, lpDirect3DViewport
, dwFlags
, lpRect
);
1379 Main_IDirect3DDeviceImpl_1_GetPickRecords(LPDIRECT3DDEVICE iface
,
1381 LPD3DPICKRECORD lpD3DPickRec
)
1383 ICOM_THIS_FROM(IDirect3DDeviceImpl
, IDirect3DDevice
, iface
);
1384 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lpCount
, lpD3DPickRec
);
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
);
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
;
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
);
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
);
1443 Thunk_IDirect3DDeviceImpl_3_QueryInterface(LPDIRECT3DDEVICE3 iface
,
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
),
1454 Thunk_IDirect3DDeviceImpl_2_QueryInterface(LPDIRECT3DDEVICE2 iface
,
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
),
1465 Thunk_IDirect3DDeviceImpl_1_QueryInterface(LPDIRECT3DDEVICE iface
,
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
),
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
));
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
));
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
));
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
));
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
));
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
));
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 */);
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 */);
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 */);
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 */);
1554 Thunk_IDirect3DDeviceImpl_2_NextViewport(LPDIRECT3DDEVICE3 iface
,
1555 LPDIRECT3DVIEWPORT2 lpDirect3DViewport2
,
1556 LPDIRECT3DVIEWPORT2
* lplpDirect3DViewport2
,
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
,
1567 Thunk_IDirect3DDeviceImpl_1_NextViewport(LPDIRECT3DDEVICE3 iface
,
1568 LPDIRECT3DVIEWPORT lpDirect3DViewport
,
1569 LPDIRECT3DVIEWPORT
* lplpDirect3DViewport
,
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
,
1580 Thunk_IDirect3DDeviceImpl_3_GetDirect3D(LPDIRECT3DDEVICE3 iface
,
1581 LPDIRECT3D3
* lplpDirect3D3
)
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
),
1589 *lplpDirect3D3
= COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D7
, IDirect3D3
, ret_ptr
);
1590 TRACE(" returning interface %p\n", *lplpDirect3D3
);
1595 Thunk_IDirect3DDeviceImpl_2_GetDirect3D(LPDIRECT3DDEVICE2 iface
,
1596 LPDIRECT3D2
* lplpDirect3D2
)
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
),
1604 *lplpDirect3D2
= COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D7
, IDirect3D2
, ret_ptr
);
1605 TRACE(" returning interface %p\n", *lplpDirect3D2
);
1610 Thunk_IDirect3DDeviceImpl_1_GetDirect3D(LPDIRECT3DDEVICE iface
,
1611 LPDIRECT3D
* lplpDirect3D
)
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
),
1619 *lplpDirect3D
= COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D7
, IDirect3D
, ret_ptr
);
1620 TRACE(" returning interface %p\n", *lplpDirect3D
);
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 */);
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 */);
1643 Thunk_IDirect3DDeviceImpl_3_EnumTextureFormats(LPDIRECT3DDEVICE3 iface
,
1644 LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc
,
1647 TRACE("(%p)->(%p,%p) thunking to IDirect3DDevice7 interface.\n", iface
, lpD3DEnumPixelProc
, lpArg
);
1648 return IDirect3DDevice7_EnumTextureFormats(COM_INTERFACE_CAST(IDirect3DDeviceImpl
, IDirect3DDevice3
, IDirect3DDevice7
, iface
),
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
));
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
));
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
));
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
));
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
));
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
));
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
,
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
,
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
,
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
,
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
,
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
,
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
),
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
),
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
),
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
),
1806 Thunk_IDirect3DDeviceImpl_3_DrawPrimitive(LPDIRECT3DDEVICE3 iface
,
1807 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1808 DWORD d3dvtVertexType
,
1810 DWORD dwVertexCount
,
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
),
1823 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitive(LPDIRECT3DDEVICE3 iface
,
1824 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1825 DWORD d3dvtVertexType
,
1827 DWORD dwVertexCount
,
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
),
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
),
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
),
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
),
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
),
1880 Thunk_IDirect3DDeviceImpl_3_DrawPrimitiveStrided(LPDIRECT3DDEVICE3 iface
,
1881 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1883 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData
,
1884 DWORD dwVertexCount
,
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
),
1891 lpD3DDrawPrimStrideData
,
1897 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveStrided(LPDIRECT3DDEVICE3 iface
,
1898 D3DPRIMITIVETYPE d3dptPrimitiveType
,
1900 LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData
,
1901 DWORD dwVertexCount
,
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
),
1910 lpD3DDrawPrimStrideData
,
1918 Thunk_IDirect3DDeviceImpl_3_ComputeSphereVisibility(LPDIRECT3DDEVICE3 iface
,
1919 LPD3DVECTOR lpCenters
,
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
),
1935 Thunk_IDirect3DDeviceImpl_3_GetTextureStageState(LPDIRECT3DDEVICE3 iface
,
1937 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType
,
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
),
1943 d3dTexStageStateType
,
1948 Thunk_IDirect3DDeviceImpl_3_SetTextureStageState(LPDIRECT3DDEVICE3 iface
,
1950 D3DTEXTURESTAGESTATETYPE d3dTexStageStateType
,
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
),
1956 d3dTexStageStateType
,
1961 Thunk_IDirect3DDeviceImpl_3_ValidateDevice(LPDIRECT3DDEVICE3 iface
,
1964 TRACE("(%p)->(%p) thunking to IDirect3DDevice7 interface.\n", iface
, lpdwPasses
);
1965 return IDirect3DDevice7_ValidateDevice(COM_INTERFACE_CAST(IDirect3DDeviceImpl
, IDirect3DDevice3
, IDirect3DDevice7
, iface
),
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
),
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
),
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
));
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
),
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
),
2021 Thunk_IDirect3DDeviceImpl_3_SetRenderTarget(LPDIRECT3DDEVICE3 iface
,
2022 LPDIRECTDRAWSURFACE4 lpNewRenderTarget
,
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 */,
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 */);
2041 Thunk_IDirect3DDeviceImpl_2_SetRenderTarget(LPDIRECT3DDEVICE2 iface
,
2042 LPDIRECTDRAWSURFACE lpNewRenderTarget
,
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
),
2052 Thunk_IDirect3DDeviceImpl_2_GetRenderTarget(LPDIRECT3DDEVICE2 iface
,
2053 LPDIRECTDRAWSURFACE
* lplpRenderTarget
)
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
),
2061 *lplpRenderTarget
= (LPDIRECTDRAWSURFACE
) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
, IDirectDrawSurface7
, IDirectDrawSurface3
, ret_val
);
2062 TRACE(" returning interface %p\n", *lplpRenderTarget
);
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
),
2076 Thunk_IDirect3DDeviceImpl_2_Index(LPDIRECT3DDEVICE2 iface
,
2079 TRACE("(%p)->(%04x) thunking to IDirect3DDevice3 interface.\n", iface
, wVertexIndex
);
2080 return IDirect3DDevice3_Index(COM_INTERFACE_CAST(IDirect3DDeviceImpl
, IDirect3DDevice2
, IDirect3DDevice3
, iface
),
2085 Thunk_IDirect3DDeviceImpl_2_End(LPDIRECT3DDEVICE2 iface
,
2088 TRACE("(%p)->(%08lx) thunking to IDirect3DDevice3 interface.\n", iface
, dwFlags
);
2089 return IDirect3DDevice3_End(COM_INTERFACE_CAST(IDirect3DDeviceImpl
, IDirect3DDevice2
, IDirect3DDevice3
, iface
),
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
),
2105 Thunk_IDirect3DDeviceImpl_2_SetLightState(LPDIRECT3DDEVICE2 iface
,
2106 D3DLIGHTSTATETYPE dwLightStateType
,
2109 TRACE("(%p)->(%08x,%08lx) thunking to IDirect3DDevice3 interface.\n", iface
, dwLightStateType
, dwLightState
);
2110 return IDirect3DDevice3_SetLightState(COM_INTERFACE_CAST(IDirect3DDeviceImpl
, IDirect3DDevice2
, IDirect3DDevice3
, iface
),
2116 Thunk_IDirect3DDeviceImpl_1_EnumTextureFormats(LPDIRECT3DDEVICE iface
,
2117 LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc
,
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
,
2127 Thunk_IDirect3DDeviceImpl_3_SetTexture(LPDIRECT3DDEVICE3 iface
,
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
),
2134 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
, IDirect3DTexture2
, IDirectDrawSurface7
, lpTexture2
));
2138 Thunk_IDirect3DDeviceImpl_3_DrawPrimitiveVB(LPDIRECT3DDEVICE3 iface
,
2139 D3DPRIMITIVETYPE d3dptPrimitiveType
,
2140 LPDIRECT3DVERTEXBUFFER lpD3DVertexBuf
,
2141 DWORD dwStartVertex
,
2142 DWORD dwNumVertices
,
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
),
2149 COM_INTERFACE_CAST(IDirect3DVertexBufferImpl
, IDirect3DVertexBuffer
, IDirect3DVertexBuffer7
, lpD3DVertexBuf
),
2156 Thunk_IDirect3DDeviceImpl_3_DrawIndexedPrimitiveVB(LPDIRECT3DDEVICE3 iface
,
2157 D3DPRIMITIVETYPE d3dptPrimitiveType
,
2158 LPDIRECT3DVERTEXBUFFER lpD3DVertexBuf
,
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
),
2167 COM_INTERFACE_CAST(IDirect3DVertexBufferImpl
, IDirect3DVertexBuffer
, IDirect3DVertexBuffer7
, lpD3DVertexBuf
),
2176 Thunk_IDirect3DDeviceImpl_3_GetTexture(LPDIRECT3DDEVICE3 iface
,
2178 LPDIRECT3DTEXTURE2
* lplpTexture2
)
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
),
2188 *lplpTexture2
= COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
, IDirectDrawSurface7
, IDirect3DTexture2
, ret_val
);
2190 TRACE(" returning interface %p.\n", *lplpTexture2
);