d3drm: Avoid LPDIRECT3DRMLIGHT.
[wine.git] / dlls / d3drm / d3drm.c
blob9c3c21fbf5a8e77563c01661d0dbc6e9ab3ac073
1 /*
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"
24 #define COBJMACROS
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "dxfile.h"
29 #include "rmxfguid.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";
50 return "?";
53 typedef struct {
54 IDirect3DRM IDirect3DRM_iface;
55 IDirect3DRM2 IDirect3DRM2_iface;
56 IDirect3DRM3 IDirect3DRM3_iface;
57 LONG ref;
58 } IDirect3DRMImpl;
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);
82 *ppvObject = NULL;
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;
97 else
99 FIXME("interface %s not implemented\n", debugstr_guid(riid));
100 return E_NOINTERFACE;
103 IDirect3DRM_AddRef(iface);
104 return S_OK;
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);
114 return 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);
124 if (!ref)
125 HeapFree(GetProcessHeap(), 0, This);
127 return ref;
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);
137 return E_NOTIMPL;
140 static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM *iface,
141 IDirect3DRMFrame *parent_frame, IDirect3DRMFrame **frame)
143 TRACE("iface %p, parent_frame %p, frame %p.\n", iface, parent_frame, frame);
145 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame, (IUnknown *)parent_frame, (IUnknown **)frame);
148 static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM *iface, IDirect3DRMMesh **mesh)
150 IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM(iface);
152 TRACE("iface %p, mesh %p.\n", iface, mesh);
154 return IDirect3DRM3_CreateMesh(&d3drm->IDirect3DRM3_iface, mesh);
157 static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM *iface, IDirect3DRMMeshBuilder **mesh_builder)
159 TRACE("iface %p, mesh_builder %p.\n", iface, mesh_builder);
161 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder, (IUnknown **)mesh_builder);
164 static HRESULT WINAPI IDirect3DRMImpl_CreateFace(IDirect3DRM* iface, IDirect3DRMFace **face)
166 FIXME("iface %p, face %p stub!\n", iface, face);
168 return E_NOTIMPL;
171 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimation(IDirect3DRM* iface, LPDIRECT3DRMANIMATION * ppAnimation)
173 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
175 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
177 return E_NOTIMPL;
180 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM* iface, LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
182 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
184 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
186 return E_NOTIMPL;
189 static HRESULT WINAPI IDirect3DRMImpl_CreateTexture(IDirect3DRM *iface,
190 D3DRMIMAGE *image, IDirect3DRMTexture **texture)
192 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
194 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface, This, image, texture);
196 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture);
199 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM *iface,
200 D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light)
202 IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM(iface);
204 TRACE("iface %p, type %#x, color 0x%08x, light %p.\n", iface, type, color, light);
206 return IDirect3DRM3_CreateLight(&d3drm->IDirect3DRM3_iface, type, color, light);
209 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM *iface, D3DRMLIGHTTYPE type,
210 D3DVALUE red, D3DVALUE green, D3DVALUE blue, IDirect3DRMLight **light)
212 IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM(iface);
214 TRACE("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p.\n",
215 iface, type, red, green, blue, light);
217 return IDirect3DRM3_CreateLightRGB(&d3drm->IDirect3DRM3_iface, type, red, green, blue, light);
220 static HRESULT WINAPI IDirect3DRMImpl_CreateMaterial(IDirect3DRM* iface, D3DVALUE power, LPDIRECT3DRMMATERIAL * material)
222 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
224 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
226 return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
229 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM *iface,
230 DWORD width, DWORD height, IDirect3DRMDevice **device)
232 FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface, width, height, device);
234 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
237 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM *iface, GUID *pGUID,
238 IDirectDraw *pDD, IDirectDrawSurface *pDDSBack, IDirect3DRMDevice **ppDevice)
240 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
242 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), pDD,
243 pDDSBack, ppDevice);
245 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
248 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM *iface,
249 IDirect3D *pD3D, IDirect3DDevice *pD3DDev, IDirect3DRMDevice **ppDevice)
251 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
253 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
255 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
258 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM *iface,
259 IDirectDrawClipper *pDDClipper, GUID *pGUID, int width, int height,
260 IDirect3DRMDevice **ppDevice)
262 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
264 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
265 debugstr_guid(pGUID), width, height, ppDevice);
267 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
270 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM *iface,
271 IDirectDrawSurface *pDDS, IDirect3DRMTexture **ppTexture)
273 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
275 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
277 return E_NOTIMPL;
280 static HRESULT WINAPI IDirect3DRMImpl_CreateShadow(IDirect3DRM *iface, IDirect3DRMVisual *visual,
281 IDirect3DRMLight *light, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
282 IDirect3DRMVisual **shadow)
284 FIXME("iface %p, visual %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
285 iface, visual, light, px, py, pz, nx, ny, nz, shadow);
287 return E_NOTIMPL;
290 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM *iface, IDirect3DRMDevice *device,
291 IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport **viewport)
293 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
294 iface, device, camera, x, y, width, height, viewport);
296 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown **)viewport);
299 static HRESULT WINAPI IDirect3DRMImpl_CreateWrap(IDirect3DRM *iface, D3DRMWRAPTYPE type, IDirect3DRMFrame *frame,
300 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
301 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv,
302 IDirect3DRMWrap **wrap)
304 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
305 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
306 iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
308 return E_NOTIMPL;
311 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
313 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
315 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
317 return E_NOTIMPL;
320 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
322 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
324 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
326 return E_NOTIMPL;
329 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
331 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
333 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
335 return E_NOTIMPL;
338 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
340 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
342 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
344 return E_NOTIMPL;
347 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
349 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
351 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
353 return E_NOTIMPL;
356 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
358 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
360 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
362 return E_NOTIMPL;
365 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
367 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
369 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
371 return E_NOTIMPL;
374 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
376 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
378 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
380 return E_NOTIMPL;
383 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
385 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
387 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
389 return E_NOTIMPL;
392 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM *iface,
393 const char *name, IDirect3DRMObject **object)
395 FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object);
397 return E_NOTIMPL;
400 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
402 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
404 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
406 return E_NOTIMPL;
409 static HRESULT WINAPI IDirect3DRMImpl_Load(IDirect3DRM *iface, void *source, void *object_id, IID **iids,
410 DWORD iid_count, D3DRMLOADOPTIONS flags, D3DRMLOADCALLBACK load_cb, void *load_ctx,
411 D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, IDirect3DRMFrame *parent_frame)
413 IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM(iface);
414 IDirect3DRMFrame3 *parent_frame3 = NULL;
415 HRESULT hr = D3DRM_OK;
417 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
418 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
419 iface, source, object_id, iids, iid_count, flags,
420 load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame);
422 if (parent_frame)
423 hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&parent_frame3);
424 if (SUCCEEDED(hr))
425 hr = IDirect3DRM3_Load(&d3drm->IDirect3DRM3_iface, source, object_id, iids, iid_count,
426 flags, load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame3);
427 if (parent_frame3)
428 IDirect3DRMFrame3_Release(parent_frame3);
430 return hr;
433 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
435 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
437 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
439 return E_NOTIMPL;
442 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
444 IDirect3DRMImpl_QueryInterface,
445 IDirect3DRMImpl_AddRef,
446 IDirect3DRMImpl_Release,
447 IDirect3DRMImpl_CreateObject,
448 IDirect3DRMImpl_CreateFrame,
449 IDirect3DRMImpl_CreateMesh,
450 IDirect3DRMImpl_CreateMeshBuilder,
451 IDirect3DRMImpl_CreateFace,
452 IDirect3DRMImpl_CreateAnimation,
453 IDirect3DRMImpl_CreateAnimationSet,
454 IDirect3DRMImpl_CreateTexture,
455 IDirect3DRMImpl_CreateLight,
456 IDirect3DRMImpl_CreateLightRGB,
457 IDirect3DRMImpl_CreateMaterial,
458 IDirect3DRMImpl_CreateDevice,
459 IDirect3DRMImpl_CreateDeviceFromSurface,
460 IDirect3DRMImpl_CreateDeviceFromD3D,
461 IDirect3DRMImpl_CreateDeviceFromClipper,
462 IDirect3DRMImpl_CreateTextureFromSurface,
463 IDirect3DRMImpl_CreateShadow,
464 IDirect3DRMImpl_CreateViewport,
465 IDirect3DRMImpl_CreateWrap,
466 IDirect3DRMImpl_CreateUserVisual,
467 IDirect3DRMImpl_LoadTexture,
468 IDirect3DRMImpl_LoadTextureFromResource,
469 IDirect3DRMImpl_SetSearchPath,
470 IDirect3DRMImpl_AddSearchPath,
471 IDirect3DRMImpl_GetSearchPath,
472 IDirect3DRMImpl_SetDefaultTextureColors,
473 IDirect3DRMImpl_SetDefaultTextureShades,
474 IDirect3DRMImpl_GetDevices,
475 IDirect3DRMImpl_GetNamedObject,
476 IDirect3DRMImpl_EnumerateObjects,
477 IDirect3DRMImpl_Load,
478 IDirect3DRMImpl_Tick
482 /*** IUnknown methods ***/
483 static HRESULT WINAPI IDirect3DRM2Impl_QueryInterface(IDirect3DRM2* iface, REFIID riid,
484 void** ppvObject)
486 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
487 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
490 static ULONG WINAPI IDirect3DRM2Impl_AddRef(IDirect3DRM2* iface)
492 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
493 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
496 static ULONG WINAPI IDirect3DRM2Impl_Release(IDirect3DRM2* iface)
498 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
499 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
502 /*** IDirect3DRM2 methods ***/
503 static HRESULT WINAPI IDirect3DRM2Impl_CreateObject(IDirect3DRM2* iface, REFCLSID rclsid,
504 LPUNKNOWN pUnkOuter, REFIID riid,
505 LPVOID *ppvObj)
507 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
509 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter,
510 debugstr_guid(riid), ppvObj);
512 return E_NOTIMPL;
515 static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2 *iface,
516 IDirect3DRMFrame *parent_frame, IDirect3DRMFrame2 **frame)
518 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
520 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
522 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown*)parent_frame, (IUnknown**)frame);
525 static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2 *iface, IDirect3DRMMesh **mesh)
527 IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM2(iface);
529 TRACE("iface %p, mesh %p.\n", iface, mesh);
531 return IDirect3DRM3_CreateMesh(&d3drm->IDirect3DRM3_iface, mesh);
534 static HRESULT WINAPI IDirect3DRM2Impl_CreateMeshBuilder(IDirect3DRM2 *iface, IDirect3DRMMeshBuilder2 **mesh_builder)
536 TRACE("iface %p, mesh_builder %p.\n", iface, mesh_builder);
538 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2, (IUnknown **)mesh_builder);
541 static HRESULT WINAPI IDirect3DRM2Impl_CreateFace(IDirect3DRM2 *iface, IDirect3DRMFace **face)
543 FIXME("iface %p, face %p stub!\n", iface, face);
545 return E_NOTIMPL;
548 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimation(IDirect3DRM2* iface,
549 LPDIRECT3DRMANIMATION * ppAnimation)
551 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
553 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
555 return E_NOTIMPL;
558 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimationSet(IDirect3DRM2* iface,
559 LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
561 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
563 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
565 return E_NOTIMPL;
568 static HRESULT WINAPI IDirect3DRM2Impl_CreateTexture(IDirect3DRM2 *iface,
569 D3DRMIMAGE *image, IDirect3DRMTexture2 **texture)
571 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
573 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface, This, image, texture);
575 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture);
578 static HRESULT WINAPI IDirect3DRM2Impl_CreateLight(IDirect3DRM2 *iface,
579 D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light)
581 IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM2(iface);
583 TRACE("iface %p, type %#x, color 0x%08x, light %p.\n", iface, type, color, light);
585 return IDirect3DRM3_CreateLight(&d3drm->IDirect3DRM3_iface, type, color, light);
588 static HRESULT WINAPI IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2 *iface, D3DRMLIGHTTYPE type,
589 D3DVALUE red, D3DVALUE green, D3DVALUE blue, IDirect3DRMLight **light)
591 IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM2(iface);
593 TRACE("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p.\n",
594 iface, type, red, green, blue, light);
596 return IDirect3DRM3_CreateLightRGB(&d3drm->IDirect3DRM3_iface, type, red, green, blue, light);
599 static HRESULT WINAPI IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2* iface, D3DVALUE power,
600 LPDIRECT3DRMMATERIAL * material)
602 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
604 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
606 return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
609 static HRESULT WINAPI IDirect3DRM2Impl_CreateDevice(IDirect3DRM2 *iface,
610 DWORD width, DWORD height, IDirect3DRMDevice2 **device)
612 FIXME("iface %p, width %u, height %u, device %p.\n", iface, width, height, device);
614 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
617 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromSurface(IDirect3DRM2 *iface, GUID *pGUID,
618 IDirectDraw *pDD, IDirectDrawSurface *pDDSBack, IDirect3DRMDevice2 **ppDevice)
620 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
622 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID),
623 pDD, pDDSBack, ppDevice);
625 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
628 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromD3D(IDirect3DRM2 *iface,
629 IDirect3D2 *pD3D, IDirect3DDevice2 *pD3DDev, IDirect3DRMDevice2 **ppDevice)
631 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
633 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
635 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
638 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromClipper(IDirect3DRM2 *iface,
639 IDirectDrawClipper *pDDClipper, GUID *pGUID, int width, int height,
640 IDirect3DRMDevice2 **ppDevice)
642 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
644 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
645 debugstr_guid(pGUID), width, height, ppDevice);
647 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
650 static HRESULT WINAPI IDirect3DRM2Impl_CreateTextureFromSurface(IDirect3DRM2 *iface,
651 IDirectDrawSurface *pDDS, IDirect3DRMTexture2 **ppTexture)
653 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
655 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
657 return E_NOTIMPL;
660 static HRESULT WINAPI IDirect3DRM2Impl_CreateShadow(IDirect3DRM2 *iface, IDirect3DRMVisual *visual,
661 IDirect3DRMLight *light, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
662 IDirect3DRMVisual **shadow)
664 FIXME("iface %p, visual %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
665 iface, visual, light, px, py, pz, nx, ny, nz, shadow);
667 return E_NOTIMPL;
670 static HRESULT WINAPI IDirect3DRM2Impl_CreateViewport(IDirect3DRM2 *iface, IDirect3DRMDevice *device,
671 IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport **viewport)
673 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
674 iface, device, camera, x, y, width, height, viewport);
676 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown **)viewport);
679 static HRESULT WINAPI IDirect3DRM2Impl_CreateWrap(IDirect3DRM2 *iface, D3DRMWRAPTYPE type, IDirect3DRMFrame *frame,
680 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
681 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv,
682 IDirect3DRMWrap **wrap)
684 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
685 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
686 iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
688 return E_NOTIMPL;
691 static HRESULT WINAPI IDirect3DRM2Impl_CreateUserVisual(IDirect3DRM2* iface,
692 D3DRMUSERVISUALCALLBACK cb, LPVOID pArg,
693 LPDIRECT3DRMUSERVISUAL * ppUserVisual)
695 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
697 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
699 return E_NOTIMPL;
702 static HRESULT WINAPI IDirect3DRM2Impl_LoadTexture(IDirect3DRM2* iface, const char * filename,
703 LPDIRECT3DRMTEXTURE2 * ppTexture)
705 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
707 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
709 return E_NOTIMPL;
712 static HRESULT WINAPI IDirect3DRM2Impl_LoadTextureFromResource(IDirect3DRM2* iface, HMODULE hModule,
713 LPCSTR strName, LPCSTR strType,
714 LPDIRECT3DRMTEXTURE2 * ppTexture)
716 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
718 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, hModule, strName, strType, ppTexture);
720 return E_NOTIMPL;
723 static HRESULT WINAPI IDirect3DRM2Impl_SetSearchPath(IDirect3DRM2* iface, LPCSTR path)
725 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
727 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
729 return E_NOTIMPL;
732 static HRESULT WINAPI IDirect3DRM2Impl_AddSearchPath(IDirect3DRM2* iface, LPCSTR path)
734 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
736 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
738 return E_NOTIMPL;
741 static HRESULT WINAPI IDirect3DRM2Impl_GetSearchPath(IDirect3DRM2* iface, DWORD *size_return,
742 LPSTR path_return)
744 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
746 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
748 return E_NOTIMPL;
751 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureColors(IDirect3DRM2* iface, DWORD nb_colors)
753 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
755 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
757 return E_NOTIMPL;
760 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureShades(IDirect3DRM2* iface, DWORD nb_shades)
762 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
764 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
766 return E_NOTIMPL;
769 static HRESULT WINAPI IDirect3DRM2Impl_GetDevices(IDirect3DRM2* iface,
770 LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
772 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
774 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
776 return E_NOTIMPL;
779 static HRESULT WINAPI IDirect3DRM2Impl_GetNamedObject(IDirect3DRM2 *iface,
780 const char *name, IDirect3DRMObject **object)
782 FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object);
784 return E_NOTIMPL;
787 static HRESULT WINAPI IDirect3DRM2Impl_EnumerateObjects(IDirect3DRM2* iface, D3DRMOBJECTCALLBACK cb,
788 LPVOID pArg)
790 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
792 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
794 return E_NOTIMPL;
797 static HRESULT WINAPI IDirect3DRM2Impl_Load(IDirect3DRM2 *iface, void *source, void *object_id, IID **iids,
798 DWORD iid_count, D3DRMLOADOPTIONS flags, D3DRMLOADCALLBACK load_cb, void *load_ctx,
799 D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, IDirect3DRMFrame *parent_frame)
801 IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM2(iface);
802 IDirect3DRMFrame3 *parent_frame3 = NULL;
803 HRESULT hr = D3DRM_OK;
805 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
806 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
807 iface, source, object_id, iids, iid_count, flags,
808 load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame);
810 if (parent_frame)
811 hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&parent_frame3);
812 if (SUCCEEDED(hr))
813 hr = IDirect3DRM3_Load(&d3drm->IDirect3DRM3_iface, source, object_id, iids, iid_count,
814 flags, load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame3);
815 if (parent_frame3)
816 IDirect3DRMFrame3_Release(parent_frame3);
818 return hr;
821 static HRESULT WINAPI IDirect3DRM2Impl_Tick(IDirect3DRM2* iface, D3DVALUE tick)
823 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
825 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
827 return E_NOTIMPL;
830 static HRESULT WINAPI IDirect3DRM2Impl_CreateProgressiveMesh(IDirect3DRM2* iface,
831 LPDIRECT3DRMPROGRESSIVEMESH * ppMesh)
833 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
835 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
837 return E_NOTIMPL;
840 static const struct IDirect3DRM2Vtbl Direct3DRM2_Vtbl =
842 IDirect3DRM2Impl_QueryInterface,
843 IDirect3DRM2Impl_AddRef,
844 IDirect3DRM2Impl_Release,
845 IDirect3DRM2Impl_CreateObject,
846 IDirect3DRM2Impl_CreateFrame,
847 IDirect3DRM2Impl_CreateMesh,
848 IDirect3DRM2Impl_CreateMeshBuilder,
849 IDirect3DRM2Impl_CreateFace,
850 IDirect3DRM2Impl_CreateAnimation,
851 IDirect3DRM2Impl_CreateAnimationSet,
852 IDirect3DRM2Impl_CreateTexture,
853 IDirect3DRM2Impl_CreateLight,
854 IDirect3DRM2Impl_CreateLightRGB,
855 IDirect3DRM2Impl_CreateMaterial,
856 IDirect3DRM2Impl_CreateDevice,
857 IDirect3DRM2Impl_CreateDeviceFromSurface,
858 IDirect3DRM2Impl_CreateDeviceFromD3D,
859 IDirect3DRM2Impl_CreateDeviceFromClipper,
860 IDirect3DRM2Impl_CreateTextureFromSurface,
861 IDirect3DRM2Impl_CreateShadow,
862 IDirect3DRM2Impl_CreateViewport,
863 IDirect3DRM2Impl_CreateWrap,
864 IDirect3DRM2Impl_CreateUserVisual,
865 IDirect3DRM2Impl_LoadTexture,
866 IDirect3DRM2Impl_LoadTextureFromResource,
867 IDirect3DRM2Impl_SetSearchPath,
868 IDirect3DRM2Impl_AddSearchPath,
869 IDirect3DRM2Impl_GetSearchPath,
870 IDirect3DRM2Impl_SetDefaultTextureColors,
871 IDirect3DRM2Impl_SetDefaultTextureShades,
872 IDirect3DRM2Impl_GetDevices,
873 IDirect3DRM2Impl_GetNamedObject,
874 IDirect3DRM2Impl_EnumerateObjects,
875 IDirect3DRM2Impl_Load,
876 IDirect3DRM2Impl_Tick,
877 IDirect3DRM2Impl_CreateProgressiveMesh
881 /*** IUnknown methods ***/
882 static HRESULT WINAPI IDirect3DRM3Impl_QueryInterface(IDirect3DRM3* iface, REFIID riid,
883 void** ppvObject)
885 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
886 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
889 static ULONG WINAPI IDirect3DRM3Impl_AddRef(IDirect3DRM3* iface)
891 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
892 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
895 static ULONG WINAPI IDirect3DRM3Impl_Release(IDirect3DRM3* iface)
897 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
898 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
901 /*** IDirect3DRM3 methods ***/
902 static HRESULT WINAPI IDirect3DRM3Impl_CreateObject(IDirect3DRM3* iface, REFCLSID rclsid,
903 LPUNKNOWN unkwn, REFIID riid, LPVOID* object)
905 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
907 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), unkwn,
908 debugstr_guid(riid), object);
910 return E_NOTIMPL;
913 static HRESULT WINAPI IDirect3DRM3Impl_CreateFrame(IDirect3DRM3 *iface,
914 IDirect3DRMFrame3 *parent, IDirect3DRMFrame3 **frame)
916 TRACE("iface %p, parent %p, frame %p.\n", iface, parent, frame);
918 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown *)parent, (IUnknown **)frame);
921 static HRESULT WINAPI IDirect3DRM3Impl_CreateMesh(IDirect3DRM3 *iface, IDirect3DRMMesh **mesh)
923 TRACE("iface %p, mesh %p.\n", iface, mesh);
925 return Direct3DRMMesh_create(mesh);
928 static HRESULT WINAPI IDirect3DRM3Impl_CreateMeshBuilder(IDirect3DRM3 *iface, IDirect3DRMMeshBuilder3 **mesh_builder)
930 TRACE("iface %p, mesh_builder %p.\n", iface, mesh_builder);
932 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder3, (IUnknown **)mesh_builder);
935 static HRESULT WINAPI IDirect3DRM3Impl_CreateFace(IDirect3DRM3 *iface, IDirect3DRMFace2 **face)
937 FIXME("iface %p, face %p stub!\n", iface, face);
939 return E_NOTIMPL;
942 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimation(IDirect3DRM3* iface,
943 LPDIRECT3DRMANIMATION2* Animation)
945 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
947 FIXME("(%p/%p)->(%p): stub\n", iface, This, Animation);
949 return E_NOTIMPL;
952 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimationSet(IDirect3DRM3* iface,
953 LPDIRECT3DRMANIMATIONSET2* AnimationSet)
955 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
957 FIXME("(%p/%p)->(%p): stub\n", iface, This, AnimationSet);
959 return E_NOTIMPL;
962 static HRESULT WINAPI IDirect3DRM3Impl_CreateTexture(IDirect3DRM3 *iface,
963 D3DRMIMAGE *image, IDirect3DRMTexture3 **texture)
965 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
967 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface, This, image, texture);
969 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture);
972 static HRESULT WINAPI IDirect3DRM3Impl_CreateLight(IDirect3DRM3 *iface,
973 D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light)
975 HRESULT hr;
977 FIXME("iface %p, type %#x, color 0x%08x, light %p partial stub!\n", iface, type, color, light);
979 if (SUCCEEDED(hr = Direct3DRMLight_create((IUnknown **)light)))
981 IDirect3DRMLight_SetType(*light, type);
982 IDirect3DRMLight_SetColor(*light, color);
985 return hr;
988 static HRESULT WINAPI IDirect3DRM3Impl_CreateLightRGB(IDirect3DRM3 *iface, D3DRMLIGHTTYPE type,
989 D3DVALUE red, D3DVALUE green, D3DVALUE blue, IDirect3DRMLight **light)
991 HRESULT hr;
993 FIXME("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p partial stub!\n",
994 iface, type, red, green, blue, light);
996 if (SUCCEEDED(hr = Direct3DRMLight_create((IUnknown **)light)))
998 IDirect3DRMLight_SetType(*light, type);
999 IDirect3DRMLight_SetColorRGB(*light, red, green, blue);
1002 return hr;
1005 static HRESULT WINAPI IDirect3DRM3Impl_CreateMaterial(IDirect3DRM3* iface, D3DVALUE power,
1006 LPDIRECT3DRMMATERIAL2* material)
1008 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1009 HRESULT ret;
1011 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
1013 ret = Direct3DRMMaterial_create(material);
1015 if (SUCCEEDED(ret))
1016 IDirect3DRMMaterial2_SetPower(*material, power);
1018 return ret;
1021 static HRESULT WINAPI IDirect3DRM3Impl_CreateDevice(IDirect3DRM3 *iface,
1022 DWORD width, DWORD height, IDirect3DRMDevice3 **device)
1024 FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface, width, height, device);
1026 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
1029 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID *pGUID,
1030 IDirectDraw *dd, IDirectDrawSurface *back, IDirect3DRMDevice3 **device)
1032 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1034 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), dd, back, device);
1036 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1039 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromD3D(IDirect3DRM3 *iface,
1040 IDirect3D2 *d3d, IDirect3DDevice2 *d3ddev, IDirect3DRMDevice3 **device)
1042 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1044 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, d3d, d3ddev, device);
1046 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1049 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromClipper(IDirect3DRM3 *iface,
1050 IDirectDrawClipper *clipper, GUID *guid, int width, int height,
1051 IDirect3DRMDevice3 **device)
1053 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1055 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, clipper, debugstr_guid(guid),
1056 width, height, device);
1058 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1061 static HRESULT WINAPI IDirect3DRM3Impl_CreateShadow(IDirect3DRM3 *iface, IUnknown *object, IDirect3DRMLight *light,
1062 D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, IDirect3DRMShadow2 **shadow)
1064 FIXME("iface %p, object %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
1065 iface, object, light, px, py, pz, nx, ny, nz, shadow);
1067 return E_NOTIMPL;
1070 static HRESULT WINAPI IDirect3DRM3Impl_CreateTextureFromSurface(IDirect3DRM3 *iface,
1071 IDirectDrawSurface *surface, IDirect3DRMTexture3 **texture)
1073 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1075 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, surface, texture);
1077 return E_NOTIMPL;
1080 static HRESULT WINAPI IDirect3DRM3Impl_CreateViewport(IDirect3DRM3 *iface, IDirect3DRMDevice3 *device,
1081 IDirect3DRMFrame3 *camera, DWORD x, DWORD y, DWORD width, DWORD height, IDirect3DRMViewport2 **viewport)
1083 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
1084 iface, device, camera, x, y, width, height, viewport);
1086 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2, (IUnknown **)viewport);
1089 static HRESULT WINAPI IDirect3DRM3Impl_CreateWrap(IDirect3DRM3 *iface, D3DRMWRAPTYPE type, IDirect3DRMFrame3 *frame,
1090 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
1091 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv,
1092 IDirect3DRMWrap **wrap)
1094 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
1095 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
1096 iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
1098 return E_NOTIMPL;
1101 static HRESULT WINAPI IDirect3DRM3Impl_CreateUserVisual(IDirect3DRM3* iface,
1102 D3DRMUSERVISUALCALLBACK cb, LPVOID arg,
1103 LPDIRECT3DRMUSERVISUAL* UserVisual)
1105 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1107 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, arg, UserVisual);
1109 return E_NOTIMPL;
1112 static HRESULT WINAPI IDirect3DRM3Impl_LoadTexture(IDirect3DRM3* iface, const char* filename,
1113 LPDIRECT3DRMTEXTURE3* Texture)
1115 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1117 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, Texture);
1119 return E_NOTIMPL;
1122 static HRESULT WINAPI IDirect3DRM3Impl_LoadTextureFromResource(IDirect3DRM3* iface, HMODULE mod,
1123 LPCSTR strName, LPCSTR strType,
1124 LPDIRECT3DRMTEXTURE3 * ppTexture)
1126 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1128 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, mod, strName, strType, ppTexture);
1130 return E_NOTIMPL;
1133 static HRESULT WINAPI IDirect3DRM3Impl_SetSearchPath(IDirect3DRM3* iface, LPCSTR path)
1135 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1137 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1139 return E_NOTIMPL;
1142 static HRESULT WINAPI IDirect3DRM3Impl_AddSearchPath(IDirect3DRM3* iface, LPCSTR path)
1144 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1146 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1148 return E_NOTIMPL;
1151 static HRESULT WINAPI IDirect3DRM3Impl_GetSearchPath(IDirect3DRM3* iface, DWORD* size_return,
1152 LPSTR path_return)
1154 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1156 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
1158 return E_NOTIMPL;
1161 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureColors(IDirect3DRM3* iface, DWORD nb_colors)
1163 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1165 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
1167 return E_NOTIMPL;
1170 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureShades(IDirect3DRM3* iface, DWORD nb_shades)
1172 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1174 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
1176 return E_NOTIMPL;
1179 static HRESULT WINAPI IDirect3DRM3Impl_GetDevices(IDirect3DRM3* iface,
1180 LPDIRECT3DRMDEVICEARRAY* DeviceArray)
1182 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1184 FIXME("(%p/%p)->(%p): stub\n", iface, This, DeviceArray);
1186 return E_NOTIMPL;
1189 static HRESULT WINAPI IDirect3DRM3Impl_GetNamedObject(IDirect3DRM3 *iface,
1190 const char *name, IDirect3DRMObject **object)
1192 FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object);
1194 return E_NOTIMPL;
1197 static HRESULT WINAPI IDirect3DRM3Impl_EnumerateObjects(IDirect3DRM3* iface, D3DRMOBJECTCALLBACK cb,
1198 LPVOID arg)
1200 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1202 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
1204 return E_NOTIMPL;
1207 static HRESULT load_data(IDirect3DRM3 *iface, IDirectXFileData *data_object, IID **GUIDs, DWORD nb_GUIDs, D3DRMLOADCALLBACK LoadProc,
1208 void *ArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, void *ArgLTP, IDirect3DRMFrame3 *parent_frame)
1210 HRESULT ret = D3DRMERR_BADOBJECT;
1211 HRESULT hr;
1212 const GUID* guid;
1213 DWORD i;
1214 BOOL requested = FALSE;
1216 hr = IDirectXFileData_GetType(data_object, &guid);
1217 if (hr != DXFILE_OK)
1218 goto end;
1220 TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid));
1222 /* Load object only if it is top level and requested or if it is part of another object */
1224 if (IsEqualGUID(guid, &TID_D3DRMMesh))
1226 TRACE("Found TID_D3DRMMesh\n");
1228 for (i = 0; i < nb_GUIDs; i++)
1229 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder) ||
1230 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder2) ||
1231 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder3))
1233 requested = TRUE;
1234 break;
1237 if (requested || parent_frame)
1239 IDirect3DRMMeshBuilder3 *meshbuilder;
1241 TRACE("Load mesh data\n");
1243 hr = IDirect3DRM3_CreateMeshBuilder(iface, &meshbuilder);
1244 if (SUCCEEDED(hr))
1246 hr = load_mesh_data(meshbuilder, data_object, LoadTextureProc, ArgLTP);
1247 if (SUCCEEDED(hr))
1249 /* Only top level objects are notified */
1250 if (!parent_frame)
1252 IDirect3DRMObject *object;
1254 hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder, GUIDs[i], (void**)&object);
1255 if (SUCCEEDED(hr))
1257 LoadProc(object, GUIDs[i], ArgLP);
1258 IDirect3DRMObject_Release(object);
1261 else
1263 IDirect3DRMFrame3_AddVisual(parent_frame, (IUnknown*)meshbuilder);
1266 IDirect3DRMMeshBuilder3_Release(meshbuilder);
1269 if (FAILED(hr))
1270 ERR("Cannot process mesh\n");
1273 else if (IsEqualGUID(guid, &TID_D3DRMFrame))
1275 TRACE("Found TID_D3DRMFrame\n");
1277 for (i = 0; i < nb_GUIDs; i++)
1278 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame) ||
1279 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame2) ||
1280 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame3))
1282 requested = TRUE;
1283 break;
1286 if (requested || parent_frame)
1288 IDirect3DRMFrame3 *frame;
1290 TRACE("Load frame data\n");
1292 hr = IDirect3DRM3_CreateFrame(iface, parent_frame, &frame);
1293 if (SUCCEEDED(hr))
1295 IDirectXFileObject *child;
1297 while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(data_object, &child)))
1299 IDirectXFileData *data;
1300 IDirectXFileDataReference *reference;
1301 IDirectXFileBinary *binary;
1303 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileBinary, (void **)&binary);
1304 if (SUCCEEDED(hr))
1306 FIXME("Binary Object not supported yet\n");
1307 IDirectXFileBinary_Release(binary);
1308 continue;
1311 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data);
1312 if (SUCCEEDED(hr))
1314 TRACE("Found Data Object\n");
1315 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1316 IDirectXFileData_Release(data);
1317 continue;
1319 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference);
1320 if (SUCCEEDED(hr))
1322 TRACE("Found Data Object Reference\n");
1323 IDirectXFileDataReference_Resolve(reference, &data);
1324 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1325 IDirectXFileData_Release(data);
1326 IDirectXFileDataReference_Release(reference);
1327 continue;
1331 if (hr != DXFILEERR_NOMOREOBJECTS)
1333 IDirect3DRMFrame3_Release(frame);
1334 goto end;
1336 hr = S_OK;
1338 /* Only top level objects are notified */
1339 if (!parent_frame)
1341 IDirect3DRMObject *object;
1343 hr = IDirect3DRMFrame3_QueryInterface(frame, GUIDs[i], (void**)&object);
1344 if (SUCCEEDED(hr))
1346 LoadProc(object, GUIDs[i], ArgLP);
1347 IDirect3DRMObject_Release(object);
1350 IDirect3DRMFrame3_Release(frame);
1353 if (FAILED(hr))
1354 ERR("Cannot process frame\n");
1357 else if (IsEqualGUID(guid, &TID_D3DRMMaterial))
1359 TRACE("Found TID_D3DRMMaterial\n");
1361 /* Cannot be requested so nothing to do */
1363 else if (IsEqualGUID(guid, &TID_D3DRMFrameTransformMatrix))
1365 TRACE("Found TID_D3DRMFrameTransformMatrix\n");
1367 /* Cannot be requested */
1368 if (parent_frame)
1370 D3DRMMATRIX4D matrix;
1371 DWORD size;
1373 TRACE("Load Frame Transform Matrix data\n");
1375 size = sizeof(matrix);
1376 hr = IDirectXFileData_GetData(data_object, NULL, &size, (void**)matrix);
1377 if ((hr != DXFILE_OK) || (size != sizeof(matrix)))
1378 goto end;
1380 hr = IDirect3DRMFrame3_AddTransform(parent_frame, D3DRMCOMBINE_REPLACE, matrix);
1381 if (FAILED(hr))
1382 goto end;
1385 else
1387 FIXME("Found unknown TID %s\n", debugstr_guid(guid));
1390 ret = D3DRM_OK;
1392 end:
1394 return ret;
1397 static HRESULT WINAPI IDirect3DRM3Impl_Load(IDirect3DRM3 *iface, void *source, void *object_id, IID **iids,
1398 DWORD iid_count, D3DRMLOADOPTIONS flags, D3DRMLOADCALLBACK load_cb, void *load_ctx,
1399 D3DRMLOADTEXTURECALLBACK load_tex_cb, void *load_tex_ctx, IDirect3DRMFrame3 *parent_frame)
1401 DXFILELOADOPTIONS load_options;
1402 LPDIRECTXFILE pDXFile = NULL;
1403 LPDIRECTXFILEENUMOBJECT pEnumObject = NULL;
1404 LPDIRECTXFILEDATA pData = NULL;
1405 HRESULT hr;
1406 const GUID* pGuid;
1407 DWORD size;
1408 Header* pHeader;
1409 HRESULT ret = D3DRMERR_BADOBJECT;
1410 DWORD i;
1412 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
1413 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
1414 iface, source, object_id, iids, iid_count, flags,
1415 load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame);
1417 TRACE("Looking for GUIDs:\n");
1418 for (i = 0; i < iid_count; ++i)
1419 TRACE("- %s (%s)\n", debugstr_guid(iids[i]), get_IID_string(iids[i]));
1421 if (flags == D3DRMLOAD_FROMMEMORY)
1423 load_options = DXFILELOAD_FROMMEMORY;
1425 else if (flags == D3DRMLOAD_FROMFILE)
1427 load_options = DXFILELOAD_FROMFILE;
1428 TRACE("Loading from file %s\n", debugstr_a(source));
1430 else
1432 FIXME("Load options %#x not supported yet.\n", flags);
1433 return E_NOTIMPL;
1436 hr = DirectXFileCreate(&pDXFile);
1437 if (hr != DXFILE_OK)
1438 goto end;
1440 hr = IDirectXFile_RegisterTemplates(pDXFile, templates, strlen(templates));
1441 if (hr != DXFILE_OK)
1442 goto end;
1444 hr = IDirectXFile_CreateEnumObject(pDXFile, source, load_options, &pEnumObject);
1445 if (hr != DXFILE_OK)
1446 goto end;
1448 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1449 if (hr != DXFILE_OK)
1450 goto end;
1452 hr = IDirectXFileData_GetType(pData, &pGuid);
1453 if (hr != DXFILE_OK)
1454 goto end;
1456 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1458 if (!IsEqualGUID(pGuid, &TID_DXFILEHeader))
1460 ret = D3DRMERR_BADFILE;
1461 goto end;
1464 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&pHeader);
1465 if ((hr != DXFILE_OK) || (size != sizeof(Header)))
1466 goto end;
1468 TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
1470 /* Version must be 1.0.x */
1471 if ((pHeader->major != 1) || (pHeader->minor != 0))
1473 ret = D3DRMERR_BADFILE;
1474 goto end;
1477 IDirectXFileData_Release(pData);
1478 pData = NULL;
1480 while (1)
1482 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1483 if (hr == DXFILEERR_NOMOREOBJECTS)
1485 TRACE("No more object\n");
1486 break;
1488 else if (hr != DXFILE_OK)
1490 ret = D3DRMERR_BADFILE;
1491 goto end;
1494 ret = load_data(iface, pData, iids, iid_count, load_cb, load_ctx, load_tex_cb, load_tex_ctx, parent_frame);
1495 if (ret != D3DRM_OK)
1496 goto end;
1498 IDirectXFileData_Release(pData);
1499 pData = NULL;
1502 ret = D3DRM_OK;
1504 end:
1505 if (pData)
1506 IDirectXFileData_Release(pData);
1507 if (pEnumObject)
1508 IDirectXFileEnumObject_Release(pEnumObject);
1509 if (pDXFile)
1510 IDirectXFile_Release(pDXFile);
1512 return ret;
1515 static HRESULT WINAPI IDirect3DRM3Impl_Tick(IDirect3DRM3* iface, D3DVALUE tick)
1517 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1519 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
1521 return E_NOTIMPL;
1524 static HRESULT WINAPI IDirect3DRM3Impl_CreateProgressiveMesh(IDirect3DRM3* iface,
1525 LPDIRECT3DRMPROGRESSIVEMESH Mesh)
1527 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1529 FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
1531 return E_NOTIMPL;
1534 static HRESULT WINAPI IDirect3DRM3Impl_RegisterClient(IDirect3DRM3* iface, REFGUID rguid,
1535 LPDWORD id)
1537 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1539 FIXME("(%p/%p)->(%s, %p): stub\n", iface, This, debugstr_guid(rguid), id);
1541 return E_NOTIMPL;
1544 static HRESULT WINAPI IDirect3DRM3Impl_UnregisterClient(IDirect3DRM3* iface, REFGUID rguid)
1546 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1548 FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_guid(rguid));
1550 return E_NOTIMPL;
1553 static HRESULT WINAPI IDirect3DRM3Impl_CreateClippedVisual(IDirect3DRM3 *iface,
1554 IDirect3DRMVisual *visual, IDirect3DRMClippedVisual **clipped_visual)
1556 FIXME("iface %p, visual %p, clipped_visual %p stub!\n", iface, visual, clipped_visual);
1558 return E_NOTIMPL;
1561 static HRESULT WINAPI IDirect3DRM3Impl_SetOptions(IDirect3DRM3* iface, DWORD opt)
1563 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1565 FIXME("(%p/%p)->(%d): stub\n", iface, This, opt);
1567 return E_NOTIMPL;
1570 static HRESULT WINAPI IDirect3DRM3Impl_GetOptions(IDirect3DRM3* iface, LPDWORD opt)
1572 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1574 FIXME("(%p/%p)->(%p): stub\n", iface, This, opt);
1576 return E_NOTIMPL;
1579 static const struct IDirect3DRM3Vtbl Direct3DRM3_Vtbl =
1581 IDirect3DRM3Impl_QueryInterface,
1582 IDirect3DRM3Impl_AddRef,
1583 IDirect3DRM3Impl_Release,
1584 IDirect3DRM3Impl_CreateObject,
1585 IDirect3DRM3Impl_CreateFrame,
1586 IDirect3DRM3Impl_CreateMesh,
1587 IDirect3DRM3Impl_CreateMeshBuilder,
1588 IDirect3DRM3Impl_CreateFace,
1589 IDirect3DRM3Impl_CreateAnimation,
1590 IDirect3DRM3Impl_CreateAnimationSet,
1591 IDirect3DRM3Impl_CreateTexture,
1592 IDirect3DRM3Impl_CreateLight,
1593 IDirect3DRM3Impl_CreateLightRGB,
1594 IDirect3DRM3Impl_CreateMaterial,
1595 IDirect3DRM3Impl_CreateDevice,
1596 IDirect3DRM3Impl_CreateDeviceFromSurface,
1597 IDirect3DRM3Impl_CreateDeviceFromD3D,
1598 IDirect3DRM3Impl_CreateDeviceFromClipper,
1599 IDirect3DRM3Impl_CreateTextureFromSurface,
1600 IDirect3DRM3Impl_CreateShadow,
1601 IDirect3DRM3Impl_CreateViewport,
1602 IDirect3DRM3Impl_CreateWrap,
1603 IDirect3DRM3Impl_CreateUserVisual,
1604 IDirect3DRM3Impl_LoadTexture,
1605 IDirect3DRM3Impl_LoadTextureFromResource,
1606 IDirect3DRM3Impl_SetSearchPath,
1607 IDirect3DRM3Impl_AddSearchPath,
1608 IDirect3DRM3Impl_GetSearchPath,
1609 IDirect3DRM3Impl_SetDefaultTextureColors,
1610 IDirect3DRM3Impl_SetDefaultTextureShades,
1611 IDirect3DRM3Impl_GetDevices,
1612 IDirect3DRM3Impl_GetNamedObject,
1613 IDirect3DRM3Impl_EnumerateObjects,
1614 IDirect3DRM3Impl_Load,
1615 IDirect3DRM3Impl_Tick,
1616 IDirect3DRM3Impl_CreateProgressiveMesh,
1617 IDirect3DRM3Impl_RegisterClient,
1618 IDirect3DRM3Impl_UnregisterClient,
1619 IDirect3DRM3Impl_CreateClippedVisual,
1620 IDirect3DRM3Impl_SetOptions,
1621 IDirect3DRM3Impl_GetOptions
1624 HRESULT WINAPI Direct3DRMCreate(IDirect3DRM **d3drm)
1626 IDirect3DRMImpl *object;
1628 TRACE("d3drm %p.\n", d3drm);
1630 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
1631 return E_OUTOFMEMORY;
1633 object->IDirect3DRM_iface.lpVtbl = &Direct3DRM_Vtbl;
1634 object->IDirect3DRM2_iface.lpVtbl = &Direct3DRM2_Vtbl;
1635 object->IDirect3DRM3_iface.lpVtbl = &Direct3DRM3_Vtbl;
1636 object->ref = 1;
1638 *d3drm = &object->IDirect3DRM_iface;
1640 return S_OK;