2 * Implementation of IDirect3DRM Interface
4 * Copyright 2010, 2012 Christian Costa
5 * Copyright 2011 André Hentschel
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
31 #include "d3drm_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
35 static const char* get_IID_string(const GUID* guid)
37 if (IsEqualGUID(guid, &IID_IDirect3DRMFrame))
38 return "IID_IDirect3DRMFrame";
39 else if (IsEqualGUID(guid, &IID_IDirect3DRMFrame2))
40 return "IID_IDirect3DRMFrame2";
41 else if (IsEqualGUID(guid, &IID_IDirect3DRMFrame3))
42 return "IID_IDirect3DRMFrame3";
43 else if (IsEqualGUID(guid, &IID_IDirect3DRMMeshBuilder))
44 return "IID_IDirect3DRMMeshBuilder";
45 else if (IsEqualGUID(guid, &IID_IDirect3DRMMeshBuilder2))
46 return "IID_IDirect3DRMMeshBuilder2";
47 else if (IsEqualGUID(guid, &IID_IDirect3DRMMeshBuilder3))
48 return "IID_IDirect3DRMMeshBuilder3";
54 IDirect3DRM IDirect3DRM_iface;
55 IDirect3DRM2 IDirect3DRM2_iface;
56 IDirect3DRM3 IDirect3DRM3_iface;
60 static inline IDirect3DRMImpl *impl_from_IDirect3DRM(IDirect3DRM *iface)
62 return CONTAINING_RECORD(iface, IDirect3DRMImpl, IDirect3DRM_iface);
65 static inline IDirect3DRMImpl *impl_from_IDirect3DRM2(IDirect3DRM2 *iface)
67 return CONTAINING_RECORD(iface, IDirect3DRMImpl, IDirect3DRM2_iface);
70 static inline IDirect3DRMImpl *impl_from_IDirect3DRM3(IDirect3DRM3 *iface)
72 return CONTAINING_RECORD(iface, IDirect3DRMImpl, IDirect3DRM3_iface);
75 /*** IUnknown methods ***/
76 static HRESULT WINAPI IDirect3DRMImpl_QueryInterface(IDirect3DRM* iface, REFIID riid, void** ppvObject)
78 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
80 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
84 if(IsEqualGUID(riid, &IID_IUnknown) ||
85 IsEqualGUID(riid, &IID_IDirect3DRM))
87 *ppvObject = &This->IDirect3DRM_iface;
89 else if(IsEqualGUID(riid, &IID_IDirect3DRM2))
91 *ppvObject = &This->IDirect3DRM2_iface;
93 else if(IsEqualGUID(riid, &IID_IDirect3DRM3))
95 *ppvObject = &This->IDirect3DRM3_iface;
99 FIXME("interface %s not implemented\n", debugstr_guid(riid));
100 return E_NOINTERFACE;
103 IDirect3DRM_AddRef(iface);
107 static ULONG WINAPI IDirect3DRMImpl_AddRef(IDirect3DRM* iface)
109 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
110 ULONG ref = InterlockedIncrement(&This->ref);
112 TRACE("(%p/%p)->(): new ref = %d\n", iface, This, ref);
117 static ULONG WINAPI IDirect3DRMImpl_Release(IDirect3DRM* iface)
119 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
120 ULONG ref = InterlockedDecrement(&This->ref);
122 TRACE("(%p/%p)->(): new ref = %d\n", iface, This, ref);
125 HeapFree(GetProcessHeap(), 0, This);
130 /*** IDirect3DRM methods ***/
131 static HRESULT WINAPI IDirect3DRMImpl_CreateObject(IDirect3DRM* iface, REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
133 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
135 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter, debugstr_guid(riid), ppvObj);
140 static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM* iface, LPDIRECT3DRMFRAME parent_frame, LPDIRECT3DRMFRAME * frame)
142 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
144 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
146 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame, (IUnknown*)parent_frame, (IUnknown**)frame);
149 static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh)
151 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
153 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
158 static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM* iface, LPDIRECT3DRMMESHBUILDER * ppMeshBuilder)
160 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
162 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
164 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder, (IUnknown**)ppMeshBuilder);
167 static HRESULT WINAPI IDirect3DRMImpl_CreateFace(IDirect3DRM* iface, LPDIRECT3DRMFACE * ppFace)
169 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
171 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
176 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimation(IDirect3DRM* iface, LPDIRECT3DRMANIMATION * ppAnimation)
178 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
180 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
185 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM* iface, LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
187 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
189 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
194 static HRESULT WINAPI IDirect3DRMImpl_CreateTexture(IDirect3DRM* iface, LPD3DRMIMAGE pImage, LPDIRECT3DRMTEXTURE * ppTexture)
196 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
198 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
203 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM* iface, D3DRMLIGHTTYPE type,
204 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
206 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
208 TRACE("(%p/%p)->(%d,%d,%p)\n", iface, This, type, color, Light);
210 return IDirect3DRM3_CreateLight(&This->IDirect3DRM3_iface, type, color, Light);
213 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLIGHTTYPE type,
214 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
215 LPDIRECT3DRMLIGHT* Light)
217 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
219 TRACE("(%p/%p)->(%d,%f,%f,%f,%p)\n", iface, This, type, red, green, blue, Light);
221 return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light);
224 static HRESULT WINAPI IDirect3DRMImpl_Material(IDirect3DRM* iface, D3DVALUE m, LPDIRECT3DRMMATERIAL * ppMaterial)
226 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
228 FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial);
233 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice)
235 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
237 FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
239 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
242 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM* iface, LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack, LPDIRECT3DRMDEVICE * ppDevice)
244 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
246 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), pDD,
249 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
252 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM* iface, LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE * ppDevice)
254 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
256 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
258 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
261 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM* iface, LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height, LPDIRECT3DRMDEVICE * ppDevice)
263 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
265 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
266 debugstr_guid(pGUID), width, height, ppDevice);
268 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
271 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM* iface, LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE * ppTexture)
273 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
275 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
280 static HRESULT WINAPI IDirect3DRMImpl_CreateShadow(IDirect3DRM* iface, LPDIRECT3DRMVISUAL pVisual, LPDIRECT3DRMLIGHT pLight, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMVISUAL * ppVisual)
282 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
284 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz, nx, ny, nz, ppVisual);
289 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
291 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
293 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
294 xpos, ypos, width, height, ppViewport);
296 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
299 static HRESULT WINAPI IDirect3DRMImpl_CreateWrap(IDirect3DRM* iface, D3DRMWRAPTYPE type, LPDIRECT3DRMFRAME pFrame, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
301 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
303 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type, pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
308 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
310 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
312 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
317 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
319 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
321 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
326 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
328 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
330 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
335 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
337 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
339 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
344 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
346 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
348 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
353 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
355 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
357 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
362 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
364 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
366 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
371 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
373 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
375 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
380 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
382 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
384 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
389 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
391 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
393 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
398 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
400 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
402 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
407 static HRESULT WINAPI IDirect3DRMImpl_Load(IDirect3DRM* iface, LPVOID pObjSource, LPVOID pObjID, LPIID * ppGUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc, LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
409 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
410 LPDIRECT3DRMFRAME3 pParentFrame3 = NULL;
411 HRESULT hr = D3DRM_OK;
413 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
416 hr = IDirect3DRMFrame_QueryInterface(pParentFrame, &IID_IDirect3DRMFrame3, (void**)&pParentFrame3);
418 hr = IDirect3DRM3_Load(&This->IDirect3DRM3_iface, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame3);
420 IDirect3DRMFrame3_Release(pParentFrame3);
425 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
427 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
429 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
434 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
436 IDirect3DRMImpl_QueryInterface,
437 IDirect3DRMImpl_AddRef,
438 IDirect3DRMImpl_Release,
439 IDirect3DRMImpl_CreateObject,
440 IDirect3DRMImpl_CreateFrame,
441 IDirect3DRMImpl_CreateMesh,
442 IDirect3DRMImpl_CreateMeshBuilder,
443 IDirect3DRMImpl_CreateFace,
444 IDirect3DRMImpl_CreateAnimation,
445 IDirect3DRMImpl_CreateAnimationSet,
446 IDirect3DRMImpl_CreateTexture,
447 IDirect3DRMImpl_CreateLight,
448 IDirect3DRMImpl_CreateLightRGB,
449 IDirect3DRMImpl_Material,
450 IDirect3DRMImpl_CreateDevice,
451 IDirect3DRMImpl_CreateDeviceFromSurface,
452 IDirect3DRMImpl_CreateDeviceFromD3D,
453 IDirect3DRMImpl_CreateDeviceFromClipper,
454 IDirect3DRMImpl_CreateTextureFromSurface,
455 IDirect3DRMImpl_CreateShadow,
456 IDirect3DRMImpl_CreateViewport,
457 IDirect3DRMImpl_CreateWrap,
458 IDirect3DRMImpl_CreateUserVisual,
459 IDirect3DRMImpl_LoadTexture,
460 IDirect3DRMImpl_LoadTextureFromResource,
461 IDirect3DRMImpl_SetSearchPath,
462 IDirect3DRMImpl_AddSearchPath,
463 IDirect3DRMImpl_GetSearchPath,
464 IDirect3DRMImpl_SetDefaultTextureColors,
465 IDirect3DRMImpl_SetDefaultTextureShades,
466 IDirect3DRMImpl_GetDevices,
467 IDirect3DRMImpl_GetNamedObject,
468 IDirect3DRMImpl_EnumerateObjects,
469 IDirect3DRMImpl_Load,
474 /*** IUnknown methods ***/
475 static HRESULT WINAPI IDirect3DRM2Impl_QueryInterface(IDirect3DRM2* iface, REFIID riid,
478 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
479 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
482 static ULONG WINAPI IDirect3DRM2Impl_AddRef(IDirect3DRM2* iface)
484 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
485 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
488 static ULONG WINAPI IDirect3DRM2Impl_Release(IDirect3DRM2* iface)
490 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
491 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
494 /*** IDirect3DRM2 methods ***/
495 static HRESULT WINAPI IDirect3DRM2Impl_CreateObject(IDirect3DRM2* iface, REFCLSID rclsid,
496 LPUNKNOWN pUnkOuter, REFIID riid,
499 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
501 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter,
502 debugstr_guid(riid), ppvObj);
507 static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2* iface, LPDIRECT3DRMFRAME parent_frame,
508 LPDIRECT3DRMFRAME2 * frame)
510 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
512 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
514 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown*)parent_frame, (IUnknown**)frame);
517 static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2* iface, LPDIRECT3DRMMESH * ppMesh)
519 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
521 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
526 static HRESULT WINAPI IDirect3DRM2Impl_CreateMeshBuilder(IDirect3DRM2* iface,
527 LPDIRECT3DRMMESHBUILDER2 * ppMeshBuilder)
529 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
531 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
533 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2, (IUnknown**)ppMeshBuilder);
536 static HRESULT WINAPI IDirect3DRM2Impl_CreateFace(IDirect3DRM2* iface, LPDIRECT3DRMFACE * ppFace)
538 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
540 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
545 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimation(IDirect3DRM2* iface,
546 LPDIRECT3DRMANIMATION * ppAnimation)
548 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
550 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
555 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimationSet(IDirect3DRM2* iface,
556 LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
558 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
560 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
565 static HRESULT WINAPI IDirect3DRM2Impl_CreateTexture(IDirect3DRM2* iface, LPD3DRMIMAGE pImage,
566 LPDIRECT3DRMTEXTURE2 * ppTexture)
568 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
570 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
575 static HRESULT WINAPI IDirect3DRM2Impl_CreateLight(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
576 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
578 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
580 TRACE("(%p/%p)->(%d,%d,%p)\n", iface, This, type, color, Light);
582 return IDirect3DRM3_CreateLight(&This->IDirect3DRM3_iface, type, color, Light);
585 static HRESULT WINAPI IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
586 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
587 LPDIRECT3DRMLIGHT* Light)
589 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
591 TRACE("(%p/%p)->(%d,%f,%f,%f,%p)\n", iface, This, type, red, green, blue, Light);
593 return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light);
596 static HRESULT WINAPI IDirect3DRM2Impl_Material(IDirect3DRM2* iface, D3DVALUE m,
597 LPDIRECT3DRMMATERIAL * ppMaterial)
599 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
601 FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial);
606 static HRESULT WINAPI IDirect3DRM2Impl_CreateDevice(IDirect3DRM2* iface, DWORD width, DWORD height,
607 LPDIRECT3DRMDEVICE2 * ppDevice)
609 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
611 FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
613 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
616 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromSurface(IDirect3DRM2* iface, LPGUID pGUID,
618 LPDIRECTDRAWSURFACE pDDSBack,
619 LPDIRECT3DRMDEVICE2 * ppDevice)
621 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
623 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID),
624 pDD, pDDSBack, ppDevice);
626 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
629 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromD3D(IDirect3DRM2* iface, LPDIRECT3D2 pD3D,
630 LPDIRECT3DDEVICE2 pD3DDev,
631 LPDIRECT3DRMDEVICE2 * ppDevice)
633 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
635 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
637 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
640 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromClipper(IDirect3DRM2* iface,
641 LPDIRECTDRAWCLIPPER pDDClipper,
642 LPGUID pGUID, int width, int height,
643 LPDIRECT3DRMDEVICE2 * ppDevice)
645 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
647 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
648 debugstr_guid(pGUID), width, height, ppDevice);
650 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
653 static HRESULT WINAPI IDirect3DRM2Impl_CreateTextureFromSurface(IDirect3DRM2* iface,
654 LPDIRECTDRAWSURFACE pDDS,
655 LPDIRECT3DRMTEXTURE2 * ppTexture)
657 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
659 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
664 static HRESULT WINAPI IDirect3DRM2Impl_CreateShadow(IDirect3DRM2* iface, LPDIRECT3DRMVISUAL pVisual,
665 LPDIRECT3DRMLIGHT pLight,
666 D3DVALUE px, D3DVALUE py, D3DVALUE pz,
667 D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
668 LPDIRECT3DRMVISUAL * ppVisual)
670 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
672 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz,
673 nx, ny, nz, ppVisual);
678 static HRESULT WINAPI IDirect3DRM2Impl_CreateViewport(IDirect3DRM2* iface,
679 LPDIRECT3DRMDEVICE pDevice,
680 LPDIRECT3DRMFRAME pFrame,
681 DWORD xpos, DWORD ypos,
682 DWORD width, DWORD height,
683 LPDIRECT3DRMVIEWPORT * ppViewport)
685 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
687 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
688 xpos, ypos, width, height, ppViewport);
690 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
693 static HRESULT WINAPI IDirect3DRM2Impl_CreateWrap(IDirect3DRM2* iface, D3DRMWRAPTYPE type,
694 LPDIRECT3DRMFRAME pFrame,
695 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
696 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
697 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
698 D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
699 D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
701 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
703 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
704 pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
709 static HRESULT WINAPI IDirect3DRM2Impl_CreateUserVisual(IDirect3DRM2* iface,
710 D3DRMUSERVISUALCALLBACK cb, LPVOID pArg,
711 LPDIRECT3DRMUSERVISUAL * ppUserVisual)
713 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
715 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
720 static HRESULT WINAPI IDirect3DRM2Impl_LoadTexture(IDirect3DRM2* iface, const char * filename,
721 LPDIRECT3DRMTEXTURE2 * ppTexture)
723 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
725 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
730 static HRESULT WINAPI IDirect3DRM2Impl_LoadTextureFromResource(IDirect3DRM2* iface, HMODULE hModule,
731 LPCSTR strName, LPCSTR strType,
732 LPDIRECT3DRMTEXTURE2 * ppTexture)
734 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
736 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, hModule, strName, strType, ppTexture);
741 static HRESULT WINAPI IDirect3DRM2Impl_SetSearchPath(IDirect3DRM2* iface, LPCSTR path)
743 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
745 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
750 static HRESULT WINAPI IDirect3DRM2Impl_AddSearchPath(IDirect3DRM2* iface, LPCSTR path)
752 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
754 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
759 static HRESULT WINAPI IDirect3DRM2Impl_GetSearchPath(IDirect3DRM2* iface, DWORD *size_return,
762 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
764 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
769 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureColors(IDirect3DRM2* iface, DWORD nb_colors)
771 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
773 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
778 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureShades(IDirect3DRM2* iface, DWORD nb_shades)
780 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
782 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
787 static HRESULT WINAPI IDirect3DRM2Impl_GetDevices(IDirect3DRM2* iface,
788 LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
790 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
792 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
797 static HRESULT WINAPI IDirect3DRM2Impl_GetNamedObject(IDirect3DRM2* iface, const char * pName,
798 LPDIRECT3DRMOBJECT * ppObject)
800 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
802 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
807 static HRESULT WINAPI IDirect3DRM2Impl_EnumerateObjects(IDirect3DRM2* iface, D3DRMOBJECTCALLBACK cb,
810 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
812 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
817 static HRESULT WINAPI IDirect3DRM2Impl_Load(IDirect3DRM2* iface, LPVOID pObjSource, LPVOID pObjID,
818 LPIID * ppGUIDs, DWORD nb_GUIDs,
819 D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc,
820 LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc,
821 LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
823 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
824 LPDIRECT3DRMFRAME3 pParentFrame3 = NULL;
825 HRESULT hr = D3DRM_OK;
827 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, pObjSource, pObjID,
828 ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
831 hr = IDirect3DRMFrame_QueryInterface(pParentFrame, &IID_IDirect3DRMFrame3, (void**)&pParentFrame3);
833 hr = IDirect3DRM3_Load(&This->IDirect3DRM3_iface, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame3);
835 IDirect3DRMFrame3_Release(pParentFrame3);
840 static HRESULT WINAPI IDirect3DRM2Impl_Tick(IDirect3DRM2* iface, D3DVALUE tick)
842 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
844 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
849 static HRESULT WINAPI IDirect3DRM2Impl_CreateProgressiveMesh(IDirect3DRM2* iface,
850 LPDIRECT3DRMPROGRESSIVEMESH * ppMesh)
852 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
854 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
859 static const struct IDirect3DRM2Vtbl Direct3DRM2_Vtbl =
861 IDirect3DRM2Impl_QueryInterface,
862 IDirect3DRM2Impl_AddRef,
863 IDirect3DRM2Impl_Release,
864 IDirect3DRM2Impl_CreateObject,
865 IDirect3DRM2Impl_CreateFrame,
866 IDirect3DRM2Impl_CreateMesh,
867 IDirect3DRM2Impl_CreateMeshBuilder,
868 IDirect3DRM2Impl_CreateFace,
869 IDirect3DRM2Impl_CreateAnimation,
870 IDirect3DRM2Impl_CreateAnimationSet,
871 IDirect3DRM2Impl_CreateTexture,
872 IDirect3DRM2Impl_CreateLight,
873 IDirect3DRM2Impl_CreateLightRGB,
874 IDirect3DRM2Impl_Material,
875 IDirect3DRM2Impl_CreateDevice,
876 IDirect3DRM2Impl_CreateDeviceFromSurface,
877 IDirect3DRM2Impl_CreateDeviceFromD3D,
878 IDirect3DRM2Impl_CreateDeviceFromClipper,
879 IDirect3DRM2Impl_CreateTextureFromSurface,
880 IDirect3DRM2Impl_CreateShadow,
881 IDirect3DRM2Impl_CreateViewport,
882 IDirect3DRM2Impl_CreateWrap,
883 IDirect3DRM2Impl_CreateUserVisual,
884 IDirect3DRM2Impl_LoadTexture,
885 IDirect3DRM2Impl_LoadTextureFromResource,
886 IDirect3DRM2Impl_SetSearchPath,
887 IDirect3DRM2Impl_AddSearchPath,
888 IDirect3DRM2Impl_GetSearchPath,
889 IDirect3DRM2Impl_SetDefaultTextureColors,
890 IDirect3DRM2Impl_SetDefaultTextureShades,
891 IDirect3DRM2Impl_GetDevices,
892 IDirect3DRM2Impl_GetNamedObject,
893 IDirect3DRM2Impl_EnumerateObjects,
894 IDirect3DRM2Impl_Load,
895 IDirect3DRM2Impl_Tick,
896 IDirect3DRM2Impl_CreateProgressiveMesh
900 /*** IUnknown methods ***/
901 static HRESULT WINAPI IDirect3DRM3Impl_QueryInterface(IDirect3DRM3* iface, REFIID riid,
904 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
905 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
908 static ULONG WINAPI IDirect3DRM3Impl_AddRef(IDirect3DRM3* iface)
910 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
911 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
914 static ULONG WINAPI IDirect3DRM3Impl_Release(IDirect3DRM3* iface)
916 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
917 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
920 /*** IDirect3DRM3 methods ***/
921 static HRESULT WINAPI IDirect3DRM3Impl_CreateObject(IDirect3DRM3* iface, REFCLSID rclsid,
922 LPUNKNOWN unkwn, REFIID riid, LPVOID* object)
924 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
926 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), unkwn,
927 debugstr_guid(riid), object);
932 static HRESULT WINAPI IDirect3DRM3Impl_CreateFrame(IDirect3DRM3* iface, LPDIRECT3DRMFRAME3 parent_frame,
933 LPDIRECT3DRMFRAME3* frame)
935 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
937 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
939 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown*)parent_frame, (IUnknown**)frame);
942 static HRESULT WINAPI IDirect3DRM3Impl_CreateMesh(IDirect3DRM3* iface, LPDIRECT3DRMMESH* Mesh)
944 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
946 FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
951 static HRESULT WINAPI IDirect3DRM3Impl_CreateMeshBuilder(IDirect3DRM3* iface,
952 LPDIRECT3DRMMESHBUILDER3* ppMeshBuilder)
954 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
956 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
958 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder3, (IUnknown**)ppMeshBuilder);
961 static HRESULT WINAPI IDirect3DRM3Impl_CreateFace(IDirect3DRM3* iface, LPDIRECT3DRMFACE2* Face)
963 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
965 FIXME("(%p/%p)->(%p): stub\n", iface, This, Face);
970 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimation(IDirect3DRM3* iface,
971 LPDIRECT3DRMANIMATION2* Animation)
973 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
975 FIXME("(%p/%p)->(%p): stub\n", iface, This, Animation);
980 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimationSet(IDirect3DRM3* iface,
981 LPDIRECT3DRMANIMATIONSET2* AnimationSet)
983 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
985 FIXME("(%p/%p)->(%p): stub\n", iface, This, AnimationSet);
990 static HRESULT WINAPI IDirect3DRM3Impl_CreateTexture(IDirect3DRM3* iface, LPD3DRMIMAGE Image,
991 LPDIRECT3DRMTEXTURE3* Texture)
993 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
995 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, Image, Texture);
1000 static HRESULT WINAPI IDirect3DRM3Impl_CreateLight(IDirect3DRM3* iface, D3DRMLIGHTTYPE type,
1001 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
1003 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1006 FIXME("(%p/%p)->(%d,%d,%p): partial stub\n", iface, This, type, color, Light);
1008 ret = Direct3DRMLight_create((IUnknown**)Light);
1012 IDirect3DRMLight_SetType(*Light, type);
1013 IDirect3DRMLight_SetColor(*Light, color);
1019 static HRESULT WINAPI IDirect3DRM3Impl_CreateLightRGB(IDirect3DRM3* iface, D3DRMLIGHTTYPE type,
1020 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
1021 LPDIRECT3DRMLIGHT* Light)
1023 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1026 FIXME("(%p/%p)->(%d,%f,%f,%f,%p): partial stub\n", iface, This, type, red, green, blue, Light);
1028 ret = Direct3DRMLight_create((IUnknown**)Light);
1032 IDirect3DRMLight_SetType(*Light, type);
1033 IDirect3DRMLight_SetColorRGB(*Light, red, green, blue);
1039 static HRESULT WINAPI IDirect3DRM3Impl_Material(IDirect3DRM3* iface, D3DVALUE m,
1040 LPDIRECT3DRMMATERIAL2* Material)
1042 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1044 FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, Material);
1049 static HRESULT WINAPI IDirect3DRM3Impl_CreateDevice(IDirect3DRM3* iface, DWORD width, DWORD height,
1050 LPDIRECT3DRMDEVICE3* device)
1052 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1054 FIXME("(%p/%p)->(%d,%d,%p): partial stub\n", iface, This, width, height, device);
1056 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1059 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromSurface(IDirect3DRM3* iface, LPGUID pGUID,
1061 LPDIRECTDRAWSURFACE back,
1062 LPDIRECT3DRMDEVICE3* device)
1064 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1066 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), dd, back, device);
1068 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1071 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromD3D(IDirect3DRM3* iface, LPDIRECT3D2 d3d,
1072 LPDIRECT3DDEVICE2 d3ddev,
1073 LPDIRECT3DRMDEVICE3* device)
1075 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1077 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, d3d, d3ddev, device);
1079 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1082 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromClipper(IDirect3DRM3* iface,
1083 LPDIRECTDRAWCLIPPER clipper,
1084 LPGUID GUID, int width, int height,
1085 LPDIRECT3DRMDEVICE3* device)
1087 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1089 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, clipper, debugstr_guid(GUID),
1090 width, height, device);
1092 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1095 static HRESULT WINAPI IDirect3DRM3Impl_CreateShadow(IDirect3DRM3* iface, LPUNKNOWN Visual1,
1096 LPDIRECT3DRMLIGHT Light, D3DVALUE px,
1097 D3DVALUE py, D3DVALUE pz, D3DVALUE nx,
1098 D3DVALUE ny, D3DVALUE nz,
1099 LPDIRECT3DRMSHADOW2* Visual2)
1101 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1103 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, Visual1, Light, px, py, pz,
1104 nx, ny, nz, Visual2);
1109 static HRESULT WINAPI IDirect3DRM3Impl_CreateTextureFromSurface(IDirect3DRM3* iface,
1110 LPDIRECTDRAWSURFACE surface,
1111 LPDIRECT3DRMTEXTURE3* texture)
1113 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1115 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, surface, texture);
1120 static HRESULT WINAPI IDirect3DRM3Impl_CreateViewport(IDirect3DRM3* iface,
1121 LPDIRECT3DRMDEVICE3 Device,
1122 LPDIRECT3DRMFRAME3 frame, DWORD xpos,
1123 DWORD ypos, DWORD width, DWORD height,
1124 LPDIRECT3DRMVIEWPORT2* viewport)
1126 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1128 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, Device, frame, xpos, ypos, width,
1131 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2, (IUnknown**)viewport);
1134 static HRESULT WINAPI IDirect3DRM3Impl_CreateWrap(IDirect3DRM3* iface, D3DRMWRAPTYPE type,
1135 LPDIRECT3DRMFRAME3 frame,
1136 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
1137 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
1138 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
1139 D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
1140 D3DVALUE sv, LPDIRECT3DRMWRAP* wrap)
1142 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1144 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
1145 frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
1150 static HRESULT WINAPI IDirect3DRM3Impl_CreateUserVisual(IDirect3DRM3* iface,
1151 D3DRMUSERVISUALCALLBACK cb, LPVOID arg,
1152 LPDIRECT3DRMUSERVISUAL* UserVisual)
1154 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1156 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, arg, UserVisual);
1161 static HRESULT WINAPI IDirect3DRM3Impl_LoadTexture(IDirect3DRM3* iface, const char* filename,
1162 LPDIRECT3DRMTEXTURE3* Texture)
1164 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1166 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, Texture);
1171 static HRESULT WINAPI IDirect3DRM3Impl_LoadTextureFromResource(IDirect3DRM3* iface, HMODULE mod,
1172 LPCSTR strName, LPCSTR strType,
1173 LPDIRECT3DRMTEXTURE3 * ppTexture)
1175 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1177 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, mod, strName, strType, ppTexture);
1182 static HRESULT WINAPI IDirect3DRM3Impl_SetSearchPath(IDirect3DRM3* iface, LPCSTR path)
1184 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1186 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1191 static HRESULT WINAPI IDirect3DRM3Impl_AddSearchPath(IDirect3DRM3* iface, LPCSTR path)
1193 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1195 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1200 static HRESULT WINAPI IDirect3DRM3Impl_GetSearchPath(IDirect3DRM3* iface, DWORD* size_return,
1203 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1205 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
1210 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureColors(IDirect3DRM3* iface, DWORD nb_colors)
1212 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1214 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
1219 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureShades(IDirect3DRM3* iface, DWORD nb_shades)
1221 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1223 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
1228 static HRESULT WINAPI IDirect3DRM3Impl_GetDevices(IDirect3DRM3* iface,
1229 LPDIRECT3DRMDEVICEARRAY* DeviceArray)
1231 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1233 FIXME("(%p/%p)->(%p): stub\n", iface, This, DeviceArray);
1238 static HRESULT WINAPI IDirect3DRM3Impl_GetNamedObject(IDirect3DRM3* iface, const char* Name,
1239 LPDIRECT3DRMOBJECT* Object)
1241 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1243 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, Name, Object);
1248 static HRESULT WINAPI IDirect3DRM3Impl_EnumerateObjects(IDirect3DRM3* iface, D3DRMOBJECTCALLBACK cb,
1251 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1253 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
1258 static HRESULT load_data(IDirect3DRM3* iface, LPDIRECTXFILEDATA data_object, LPIID* GUIDs, DWORD nb_GUIDs, D3DRMLOADCALLBACK LoadProc,
1259 LPVOID ArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID ArgLTP, LPDIRECT3DRMFRAME3 parent_frame)
1261 HRESULT ret = D3DRMERR_BADOBJECT;
1265 BOOL requested = FALSE;
1267 hr = IDirectXFileData_GetType(data_object, &guid);
1268 if (hr != DXFILE_OK)
1271 TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid));
1273 if (IsEqualGUID(guid, &TID_D3DRMMesh))
1275 TRACE("Found TID_D3DRMMesh\n");
1277 for (i = 0; i < nb_GUIDs; i++)
1278 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder) ||
1279 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder2) ||
1280 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder3))
1288 LPDIRECT3DRMMESHBUILDER3 meshbuilder;
1290 TRACE("Load mesh data and notify application\n");
1292 hr = IDirect3DRM3_CreateMeshBuilder(iface, &meshbuilder);
1295 LPDIRECT3DRMOBJECT object = NULL;
1297 hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder, GUIDs[i], (void**)&object);
1300 hr = load_mesh_data(meshbuilder, data_object);
1303 /* Only top level objects are notified */
1305 IDirect3DRMFrame3_AddVisual(parent_frame, (IUnknown*)meshbuilder);
1307 LoadProc(object, GUIDs[i], ArgLP);
1309 IDirect3DRMObject_Release(object);
1311 IDirect3DRMMeshBuilder3_Release(meshbuilder);
1315 ERR("Cannot process mesh\n");
1318 else if (IsEqualGUID(guid, &TID_D3DRMFrame))
1320 TRACE("Found TID_D3DRMFrame\n");
1322 for (i = 0; i < nb_GUIDs; i++)
1323 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame) ||
1324 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame2) ||
1325 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame3))
1333 LPDIRECT3DRMFRAME3 frame;
1335 TRACE("Load frame data and notify application\n");
1337 hr = IDirect3DRM3_CreateFrame(iface, parent_frame, &frame);
1340 LPDIRECT3DRMOBJECT object;
1342 hr = IDirect3DRMFrame3_QueryInterface(frame, GUIDs[i], (void**)&object);
1345 LPDIRECTXFILEOBJECT child;
1347 while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(data_object, &child)))
1349 LPDIRECTXFILEDATA data;
1350 LPDIRECTXFILEDATAREFERENCE reference;
1351 LPDIRECTXFILEBINARY binary;
1353 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileBinary, (void **)&binary);
1356 FIXME("Binary Object not supported yet\n");
1357 IDirectXFileBinary_Release(binary);
1361 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data);
1364 TRACE("Found Data Object\n");
1365 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1366 IDirectXFileData_Release(data);
1369 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference);
1372 TRACE("Found Data Object Reference\n");
1373 IDirectXFileDataReference_Resolve(reference, &data);
1374 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1375 IDirectXFileData_Release(data);
1376 IDirectXFileDataReference_Release(reference);
1381 if (hr != DXFILEERR_NOMOREOBJECTS)
1383 IDirect3DRMObject_Release(object);
1384 IDirect3DRMFrame3_Release(frame);
1389 /* Only top level objects are notified */
1391 LoadProc(object, GUIDs[i], ArgLP);
1392 IDirect3DRMObject_Release(object);
1394 IDirect3DRMFrame3_Release(frame);
1398 ERR("Cannot process frame\n");
1401 else if (IsEqualGUID(guid, &TID_D3DRMMaterial))
1403 TRACE("Found TID_D3DRMMaterial\n");
1405 for (i = 0; i < nb_GUIDs; i++)
1406 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMaterial) ||
1407 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMaterial2))
1412 FIXME("Processing material not supported yet\n");
1415 else if (IsEqualGUID(guid, &TID_D3DRMFrameTransformMatrix))
1417 TRACE("Found TID_D3DRMFrameTransformMatrix\n");
1421 D3DRMMATRIX4D matrix;
1424 TRACE("Load Frame Transform Matrix data\n");
1426 size = sizeof(matrix);
1427 hr = IDirectXFileData_GetData(data_object, NULL, &size, (void**)matrix);
1428 if ((hr != DXFILE_OK) || (size != sizeof(matrix)))
1431 hr = IDirect3DRMFrame3_AddTransform(parent_frame, D3DRMCOMBINE_REPLACE, matrix);
1438 FIXME("Found unknown TID %s\n", debugstr_guid(guid));
1448 static HRESULT WINAPI IDirect3DRM3Impl_Load(IDirect3DRM3* iface, LPVOID ObjSource, LPVOID ObjID,
1449 LPIID* GUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags,
1450 D3DRMLOADCALLBACK LoadProc, LPVOID ArgLP,
1451 D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID ArgLTP,
1452 LPDIRECT3DRMFRAME3 ParentFrame)
1454 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1455 DXFILELOADOPTIONS load_options;
1456 LPDIRECTXFILE pDXFile = NULL;
1457 LPDIRECTXFILEENUMOBJECT pEnumObject = NULL;
1458 LPDIRECTXFILEDATA pData = NULL;
1463 HRESULT ret = D3DRMERR_BADOBJECT;
1466 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, ObjSource, ObjID, GUIDs,
1467 nb_GUIDs, LOFlags, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1469 TRACE("Looking for GUIDs:\n");
1470 for (i = 0; i < nb_GUIDs; i++)
1471 TRACE("- %s (%s)\n", debugstr_guid(GUIDs[i]), get_IID_string(GUIDs[i]));
1473 if (LOFlags == D3DRMLOAD_FROMMEMORY)
1475 load_options = DXFILELOAD_FROMMEMORY;
1477 else if (LOFlags == D3DRMLOAD_FROMFILE)
1479 load_options = DXFILELOAD_FROMFILE;
1480 TRACE("Loading from file %s\n", debugstr_a(ObjSource));
1484 FIXME("Load options %d not supported yet\n", LOFlags);
1488 hr = DirectXFileCreate(&pDXFile);
1489 if (hr != DXFILE_OK)
1492 hr = IDirectXFile_RegisterTemplates(pDXFile, templates, strlen(templates));
1493 if (hr != DXFILE_OK)
1496 hr = IDirectXFile_CreateEnumObject(pDXFile, ObjSource, load_options, &pEnumObject);
1497 if (hr != DXFILE_OK)
1500 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1501 if (hr != DXFILE_OK)
1504 hr = IDirectXFileData_GetType(pData, &pGuid);
1505 if (hr != DXFILE_OK)
1508 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1510 if (!IsEqualGUID(pGuid, &TID_DXFILEHeader))
1512 ret = D3DRMERR_BADFILE;
1516 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&pHeader);
1517 if ((hr != DXFILE_OK) || (size != sizeof(Header)))
1520 TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
1522 /* Version must be 1.0.x */
1523 if ((pHeader->major != 1) || (pHeader->minor != 0))
1525 ret = D3DRMERR_BADFILE;
1529 IDirectXFileData_Release(pData);
1534 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1535 if (hr == DXFILEERR_NOMOREOBJECTS)
1537 TRACE("No more object\n");
1540 else if (hr != DXFILE_OK)
1542 ret = D3DRMERR_NOTFOUND;
1546 ret = load_data(iface, pData, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1547 if (ret != D3DRM_OK)
1550 IDirectXFileData_Release(pData);
1558 IDirectXFileData_Release(pData);
1560 IDirectXFileEnumObject_Release(pEnumObject);
1562 IDirectXFile_Release(pDXFile);
1567 static HRESULT WINAPI IDirect3DRM3Impl_Tick(IDirect3DRM3* iface, D3DVALUE tick)
1569 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1571 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
1576 static HRESULT WINAPI IDirect3DRM3Impl_CreateProgressiveMesh(IDirect3DRM3* iface,
1577 LPDIRECT3DRMPROGRESSIVEMESH Mesh)
1579 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1581 FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
1586 static HRESULT WINAPI IDirect3DRM3Impl_RegisterClient(IDirect3DRM3* iface, REFGUID rguid,
1589 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1591 FIXME("(%p/%p)->(%s, %p): stub\n", iface, This, debugstr_guid(rguid), id);
1596 static HRESULT WINAPI IDirect3DRM3Impl_UnregisterClient(IDirect3DRM3* iface, REFGUID rguid)
1598 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1600 FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_guid(rguid));
1605 static HRESULT WINAPI IDirect3DRM3Impl_CreateClippedVisual(IDirect3DRM3* iface,
1606 LPDIRECT3DRMVISUAL vis,
1607 LPDIRECT3DRMCLIPPEDVISUAL* clippedvis)
1609 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1611 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, vis, clippedvis);
1616 static HRESULT WINAPI IDirect3DRM3Impl_SetOptions(IDirect3DRM3* iface, DWORD opt)
1618 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1620 FIXME("(%p/%p)->(%d): stub\n", iface, This, opt);
1625 static HRESULT WINAPI IDirect3DRM3Impl_GetOptions(IDirect3DRM3* iface, LPDWORD opt)
1627 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1629 FIXME("(%p/%p)->(%p): stub\n", iface, This, opt);
1634 static const struct IDirect3DRM3Vtbl Direct3DRM3_Vtbl =
1636 IDirect3DRM3Impl_QueryInterface,
1637 IDirect3DRM3Impl_AddRef,
1638 IDirect3DRM3Impl_Release,
1639 IDirect3DRM3Impl_CreateObject,
1640 IDirect3DRM3Impl_CreateFrame,
1641 IDirect3DRM3Impl_CreateMesh,
1642 IDirect3DRM3Impl_CreateMeshBuilder,
1643 IDirect3DRM3Impl_CreateFace,
1644 IDirect3DRM3Impl_CreateAnimation,
1645 IDirect3DRM3Impl_CreateAnimationSet,
1646 IDirect3DRM3Impl_CreateTexture,
1647 IDirect3DRM3Impl_CreateLight,
1648 IDirect3DRM3Impl_CreateLightRGB,
1649 IDirect3DRM3Impl_Material,
1650 IDirect3DRM3Impl_CreateDevice,
1651 IDirect3DRM3Impl_CreateDeviceFromSurface,
1652 IDirect3DRM3Impl_CreateDeviceFromD3D,
1653 IDirect3DRM3Impl_CreateDeviceFromClipper,
1654 IDirect3DRM3Impl_CreateTextureFromSurface,
1655 IDirect3DRM3Impl_CreateShadow,
1656 IDirect3DRM3Impl_CreateViewport,
1657 IDirect3DRM3Impl_CreateWrap,
1658 IDirect3DRM3Impl_CreateUserVisual,
1659 IDirect3DRM3Impl_LoadTexture,
1660 IDirect3DRM3Impl_LoadTextureFromResource,
1661 IDirect3DRM3Impl_SetSearchPath,
1662 IDirect3DRM3Impl_AddSearchPath,
1663 IDirect3DRM3Impl_GetSearchPath,
1664 IDirect3DRM3Impl_SetDefaultTextureColors,
1665 IDirect3DRM3Impl_SetDefaultTextureShades,
1666 IDirect3DRM3Impl_GetDevices,
1667 IDirect3DRM3Impl_GetNamedObject,
1668 IDirect3DRM3Impl_EnumerateObjects,
1669 IDirect3DRM3Impl_Load,
1670 IDirect3DRM3Impl_Tick,
1671 IDirect3DRM3Impl_CreateProgressiveMesh,
1672 IDirect3DRM3Impl_RegisterClient,
1673 IDirect3DRM3Impl_UnregisterClient,
1674 IDirect3DRM3Impl_CreateClippedVisual,
1675 IDirect3DRM3Impl_SetOptions,
1676 IDirect3DRM3Impl_GetOptions
1679 HRESULT Direct3DRM_create(IUnknown** ppObj)
1681 IDirect3DRMImpl* object;
1683 TRACE("(%p)\n", ppObj);
1685 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
1688 ERR("Out of memory\n");
1689 return E_OUTOFMEMORY;
1692 object->IDirect3DRM_iface.lpVtbl = &Direct3DRM_Vtbl;
1693 object->IDirect3DRM2_iface.lpVtbl = &Direct3DRM2_Vtbl;
1694 object->IDirect3DRM3_iface.lpVtbl = &Direct3DRM3_Vtbl;
1697 *ppObj = (IUnknown*)&object->IDirect3DRM_iface;