2 * Copyright 2000 Marcus Meissner
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36 #include "wine/debug.h"
38 #include "d3d_private.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(ddraw
);
44 Main_IDirect3DImpl_1_Initialize(LPDIRECT3D iface
,
47 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D
, iface
);
48 TRACE("(%p/%p)->(%s) no-op...\n", This
, iface
, debugstr_guid(riid
));
53 Main_IDirect3DImpl_3_2T_1T_EnumDevices(LPDIRECT3D3 iface
,
54 LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback
,
57 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D3
, iface
);
58 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lpEnumDevicesCallback
, lpUserArg
);
63 Main_IDirect3DImpl_3_2T_1T_CreateLight(LPDIRECT3D3 iface
,
64 LPDIRECT3DLIGHT
* lplpDirect3DLight
,
67 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D3
, iface
);
68 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lplpDirect3DLight
, pUnkOuter
);
73 Main_IDirect3DImpl_3_2T_1T_CreateMaterial(LPDIRECT3D3 iface
,
74 LPDIRECT3DMATERIAL3
* lplpDirect3DMaterial3
,
77 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D3
, iface
);
78 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lplpDirect3DMaterial3
, pUnkOuter
);
83 Main_IDirect3DImpl_3_2T_1T_CreateViewport(LPDIRECT3D3 iface
,
84 LPDIRECT3DVIEWPORT3
* lplpD3DViewport3
,
87 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D3
, iface
);
88 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lplpD3DViewport3
, pUnkOuter
);
93 Main_IDirect3DImpl_3_2T_1T_FindDevice(LPDIRECT3D3 iface
,
94 LPD3DFINDDEVICESEARCH lpD3DDFS
,
95 LPD3DFINDDEVICERESULT lpD3DFDR
)
97 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D3
, iface
);
98 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lpD3DDFS
, lpD3DFDR
);
103 Main_IDirect3DImpl_2_CreateDevice(LPDIRECT3D2 iface
,
105 LPDIRECTDRAWSURFACE lpDDS
,
106 LPDIRECT3DDEVICE2
* lplpD3DDevice2
)
108 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D2
, iface
);
109 FIXME("(%p/%p)->(%s,%p,%p): stub!\n", This
, iface
, debugstr_guid(rclsid
), lpDDS
, lplpD3DDevice2
);
114 Main_IDirect3DImpl_3_CreateDevice(LPDIRECT3D3 iface
,
116 LPDIRECTDRAWSURFACE4 lpDDS
,
117 LPDIRECT3DDEVICE3
* lplpD3DDevice3
,
120 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D3
, iface
);
121 FIXME("(%p/%p)->(%s,%p,%p,%p): stub!\n", This
, iface
, debugstr_guid(rclsid
), lpDDS
, lplpD3DDevice3
, lpUnk
);
126 Main_IDirect3DImpl_7_3T_EnumZBufferFormats(LPDIRECT3D7 iface
,
128 LPD3DENUMPIXELFORMATSCALLBACK lpEnumCallback
,
131 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D7
, iface
);
132 FIXME("(%p/%p)->(%s,%p,%p): stub!\n", This
, iface
, debugstr_guid(riidDevice
), lpEnumCallback
, lpContext
);
137 Main_IDirect3DImpl_7_3T_EvictManagedTextures(LPDIRECT3D7 iface
)
139 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D7
, iface
);
140 FIXME("(%p/%p)->(): stub!\n", This
, iface
);
145 Main_IDirect3DImpl_7_EnumDevices(LPDIRECT3D7 iface
,
146 LPD3DENUMDEVICESCALLBACK7 lpEnumDevicesCallback
,
149 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D7
, iface
);
150 FIXME("(%p/%p)->(%p,%p): stub!\n", This
, iface
, lpEnumDevicesCallback
, lpUserArg
);
155 Main_IDirect3DImpl_7_CreateDevice(LPDIRECT3D7 iface
,
157 LPDIRECTDRAWSURFACE7 lpDDS
,
158 LPDIRECT3DDEVICE7
* lplpD3DDevice
)
160 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D7
, iface
);
161 FIXME("(%p/%p)->(%s,%p,%p): stub!\n", This
, iface
, debugstr_guid(rclsid
), lpDDS
, lplpD3DDevice
);
166 Main_IDirect3DImpl_7_3T_CreateVertexBuffer(LPDIRECT3D7 iface
,
167 LPD3DVERTEXBUFFERDESC lpD3DVertBufDesc
,
168 LPDIRECT3DVERTEXBUFFER7
* lplpD3DVertBuf
,
171 ICOM_THIS_FROM(IDirectDrawImpl
, IDirect3D7
, iface
);
172 FIXME("(%p/%p)->(%p,%p,%08lx): stub!\n", This
, iface
, lpD3DVertBufDesc
, lplpD3DVertBuf
, dwFlags
);
177 Thunk_IDirect3DImpl_7_QueryInterface(LPDIRECT3D7 iface
,
181 TRACE("(%p)->(%s,%p) thunking to IDirectDraw7 interface.\n", iface
, debugstr_guid(riid
), obp
);
182 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D7
, IDirectDraw7
, iface
),
188 Thunk_IDirect3DImpl_3_QueryInterface(LPDIRECT3D3 iface
,
192 TRACE("(%p)->(%s,%p) thunking to IDirectDraw7 interface.\n", iface
, debugstr_guid(riid
), obp
);
193 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D3
, IDirectDraw7
, iface
),
199 Thunk_IDirect3DImpl_2_QueryInterface(LPDIRECT3D2 iface
,
203 TRACE("(%p)->(%s,%p) thunking to IDirectDraw7 interface.\n", iface
, debugstr_guid(riid
), obp
);
204 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D2
, IDirectDraw7
, iface
),
210 Thunk_IDirect3DImpl_1_QueryInterface(LPDIRECT3D iface
,
214 TRACE("(%p)->(%s,%p) thunking to IDirectDraw7 interface.\n", iface
, debugstr_guid(riid
), obp
);
215 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D
, IDirectDraw7
, iface
),
221 Thunk_IDirect3DImpl_7_AddRef(LPDIRECT3D7 iface
)
223 TRACE("(%p)->() thunking to IDirectDraw7 interface.\n", iface
);
224 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D7
, IDirectDraw7
, iface
));
228 Thunk_IDirect3DImpl_3_AddRef(LPDIRECT3D3 iface
)
230 TRACE("(%p)->() thunking to IDirectDraw7 interface.\n", iface
);
231 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D3
, IDirectDraw7
, iface
));
235 Thunk_IDirect3DImpl_2_AddRef(LPDIRECT3D2 iface
)
237 TRACE("(%p)->() thunking to IDirectDraw7 interface.\n", iface
);
238 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D2
, IDirectDraw7
, iface
));
242 Thunk_IDirect3DImpl_1_AddRef(LPDIRECT3D iface
)
244 TRACE("(%p)->() thunking to IDirectDraw7 interface.\n", iface
);
245 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D
, IDirectDraw7
, iface
));
249 Thunk_IDirect3DImpl_7_Release(LPDIRECT3D7 iface
)
251 TRACE("(%p)->() thunking to IDirectDraw7 interface.\n", iface
);
252 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D7
, IDirectDraw7
, iface
));
256 Thunk_IDirect3DImpl_3_Release(LPDIRECT3D3 iface
)
258 TRACE("(%p)->() thunking to IDirectDraw7 interface.\n", iface
);
259 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D3
, IDirectDraw7
, iface
));
263 Thunk_IDirect3DImpl_2_Release(LPDIRECT3D2 iface
)
265 TRACE("(%p)->() thunking to IDirectDraw7 interface.\n", iface
);
266 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D2
, IDirectDraw7
, iface
));
270 Thunk_IDirect3DImpl_1_Release(LPDIRECT3D iface
)
272 TRACE("(%p)->() thunking to IDirectDraw7 interface.\n", iface
);
273 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D
, IDirectDraw7
, iface
));
277 Thunk_IDirect3DImpl_3_EnumZBufferFormats(LPDIRECT3D3 iface
,
279 LPD3DENUMPIXELFORMATSCALLBACK lpEnumCallback
,
282 TRACE("(%p)->(%s,%p,%p) thunking to IDirect3D7 interface.\n", iface
, debugstr_guid(riidDevice
), lpEnumCallback
, lpContext
);
283 return IDirect3D7_EnumZBufferFormats(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D3
, IDirect3D7
, iface
),
290 Thunk_IDirect3DImpl_3_EvictManagedTextures(LPDIRECT3D3 iface
)
292 TRACE("(%p)->() thunking to IDirect3D7 interface.\n", iface
);
293 return IDirect3D7_EvictManagedTextures(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D3
, IDirect3D7
, iface
));
297 Thunk_IDirect3DImpl_2_EnumDevices(LPDIRECT3D2 iface
,
298 LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback
,
301 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lpEnumDevicesCallback
, lpUserArg
);
302 return IDirect3D3_EnumDevices(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D2
, IDirect3D3
, iface
),
303 lpEnumDevicesCallback
,
308 Thunk_IDirect3DImpl_2_CreateLight(LPDIRECT3D2 iface
,
309 LPDIRECT3DLIGHT
* lplpDirect3DLight
,
312 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lplpDirect3DLight
, pUnkOuter
);
313 return IDirect3D3_CreateLight(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D2
, IDirect3D3
, iface
),
319 Thunk_IDirect3DImpl_1_CreateLight(LPDIRECT3D iface
,
320 LPDIRECT3DLIGHT
* lplpDirect3DLight
,
323 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lplpDirect3DLight
, pUnkOuter
);
324 return IDirect3D3_CreateLight(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D
, IDirect3D3
, iface
),
330 Thunk_IDirect3DImpl_1_CreateMaterial(LPDIRECT3D iface
,
331 LPDIRECT3DMATERIAL
* lplpDirect3DMaterial
,
335 LPDIRECT3DMATERIAL3 ret_val
;
337 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lplpDirect3DMaterial
, pUnkOuter
);
338 ret
= IDirect3D3_CreateMaterial(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D
, IDirect3D3
, iface
),
342 *lplpDirect3DMaterial
= COM_INTERFACE_CAST(IDirect3DMaterialImpl
, IDirect3DMaterial3
, IDirect3DMaterial
, ret_val
);
344 TRACE(" returning interface %p.\n", *lplpDirect3DMaterial
);
350 Thunk_IDirect3DImpl_1_CreateViewport(LPDIRECT3D iface
,
351 LPDIRECT3DVIEWPORT
* lplpD3DViewport
,
354 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lplpD3DViewport
, pUnkOuter
);
355 return IDirect3D3_CreateViewport(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D
, IDirect3D3
, iface
),
356 (LPDIRECT3DVIEWPORT3
*) lplpD3DViewport
/* No need to cast here */,
361 Thunk_IDirect3DImpl_2_CreateMaterial(LPDIRECT3D2 iface
,
362 LPDIRECT3DMATERIAL2
* lplpDirect3DMaterial2
,
366 LPDIRECT3DMATERIAL3 ret_val
;
368 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lplpDirect3DMaterial2
, pUnkOuter
);
369 ret
= IDirect3D3_CreateMaterial(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D2
, IDirect3D3
, iface
),
373 *lplpDirect3DMaterial2
= COM_INTERFACE_CAST(IDirect3DMaterialImpl
, IDirect3DMaterial3
, IDirect3DMaterial2
, ret_val
);
375 TRACE(" returning interface %p.\n", *lplpDirect3DMaterial2
);
381 Thunk_IDirect3DImpl_2_CreateViewport(LPDIRECT3D2 iface
,
382 LPDIRECT3DVIEWPORT2
* lplpD3DViewport2
,
385 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lplpD3DViewport2
, pUnkOuter
);
386 return IDirect3D3_CreateViewport(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D2
, IDirect3D3
, iface
),
387 (LPDIRECT3DVIEWPORT3
*) lplpD3DViewport2
/* No need to cast here */,
393 Thunk_IDirect3DImpl_3_CreateVertexBuffer(LPDIRECT3D3 iface
,
394 LPD3DVERTEXBUFFERDESC lpD3DVertBufDesc
,
395 LPDIRECT3DVERTEXBUFFER
* lplpD3DVertBuf
,
400 LPDIRECT3DVERTEXBUFFER7 ret_val
;
402 TRACE("(%p)->(%p,%p,%08lx,%p) thunking to IDirect3D7 interface.\n", iface
, lpD3DVertBufDesc
, lplpD3DVertBuf
, dwFlags
, lpUnk
);
404 /* dwFlags is not used in the D3D7 interface, use the vertex buffer description instead */
405 if (dwFlags
& D3DDP_DONOTCLIP
) lpD3DVertBufDesc
->dwCaps
|= D3DVBCAPS_DONOTCLIP
;
407 ret
= IDirect3D7_CreateVertexBuffer(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D3
, IDirect3D7
, iface
),
412 *lplpD3DVertBuf
= COM_INTERFACE_CAST(IDirect3DVertexBufferImpl
, IDirect3DVertexBuffer7
, IDirect3DVertexBuffer
, ret_val
);
414 TRACE(" returning interface %p.\n", *lplpD3DVertBuf
);
420 Thunk_IDirect3DImpl_1_FindDevice(LPDIRECT3D iface
,
421 LPD3DFINDDEVICESEARCH lpD3DDFS
,
422 LPD3DFINDDEVICERESULT lplpD3DDevice
)
424 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lpD3DDFS
, lplpD3DDevice
);
425 return IDirect3D3_FindDevice(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D
, IDirect3D3
, iface
),
431 Thunk_IDirect3DImpl_2_FindDevice(LPDIRECT3D2 iface
,
432 LPD3DFINDDEVICESEARCH lpD3DDFS
,
433 LPD3DFINDDEVICERESULT lpD3DFDR
)
435 TRACE("(%p)->(%p,%p) thunking to IDirect3D3 interface.\n", iface
, lpD3DDFS
, lpD3DFDR
);
436 return IDirect3D3_FindDevice(COM_INTERFACE_CAST(IDirectDrawImpl
, IDirect3D2
, IDirect3D3
, iface
),