2 * Implementation of IDirect3DRM Interface
4 * Copyright 2010 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/debug.h"
28 #include "d3drm_private.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
34 const IDirect3DRMVtbl *lpVtbl;
38 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl;
40 HRESULT Direct3DRM_create(LPDIRECT3DRM* ppDirect3DRM)
42 IDirect3DRMImpl* object;
44 TRACE("(%p)\n", ppDirect3DRM);
46 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
49 ERR("Out of memory\n");
53 object->lpVtbl = &Direct3DRM_Vtbl;
56 *ppDirect3DRM = (IDirect3DRM*)object;
61 /*** IUnknown methods ***/
62 static HRESULT WINAPI IDirect3DRMImpl_QueryInterface(IDirect3DRM* iface, REFIID riid, void** ppvObject)
64 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
66 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
68 if (IsEqualGUID(riid, &IID_IUnknown) ||
69 IsEqualGUID(riid, &IID_IDirect3DRM))
71 IClassFactory_AddRef(iface);
76 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
80 static ULONG WINAPI IDirect3DRMImpl_AddRef(IDirect3DRM* iface)
82 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
84 TRACE("(%p/%p)\n", iface, This);
86 return InterlockedIncrement(&This->ref);
89 static ULONG WINAPI IDirect3DRMImpl_Release(IDirect3DRM* iface)
91 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
92 ULONG ref = InterlockedDecrement(&This->ref);
94 TRACE("(%p/%p)\n", iface, This);
97 HeapFree(GetProcessHeap(), 0, This);
102 /*** IDirect3DRM methods ***/
103 static HRESULT WINAPI IDirect3DRMImpl_CreateObject(IDirect3DRM* iface, REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
105 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
107 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter, debugstr_guid(riid), ppvObj);
112 static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM* iface, LPDIRECT3DRMFRAME pFrameParent, LPDIRECT3DRMFRAME * ppFrame)
114 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
116 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pFrameParent, ppFrame);
121 static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh)
123 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
125 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
130 static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM* iface, LPDIRECT3DRMMESHBUILDER * ppMeshBuilder)
132 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
134 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
136 return Direct3DRMMeshBuilder_create(ppMeshBuilder);
139 static HRESULT WINAPI IDirect3DRMImpl_CreateFace(IDirect3DRM* iface, LPDIRECT3DRMFACE * ppFace)
141 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
143 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
148 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimation(IDirect3DRM* iface, LPDIRECT3DRMANIMATION * ppAnimation)
150 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
152 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
157 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM* iface, LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
159 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
161 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
166 static HRESULT WINAPI IDirect3DRMImpl_CreateTexture(IDirect3DRM* iface, LPD3DRMIMAGE pImage, LPDIRECT3DRMTEXTURE * ppTexture)
168 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
170 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
175 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM* iface, D3DRMLIGHTTYPE type, D3DCOLOR color, LPDIRECT3DRMLIGHT * ppLight)
177 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
179 FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, type, color, ppLight);
184 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLIGHTTYPE type, D3DVALUE red, D3DVALUE green, D3DVALUE blue, LPDIRECT3DRMLIGHT * ppLight)
186 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
188 FIXME("(%p/%p)->(%d,%f,%f,%f,%p): stub\n", iface, This, type, red, green, blue, ppLight);
193 static HRESULT WINAPI IDirect3DRMImpl_Material(IDirect3DRM* iface, D3DVALUE m, LPDIRECT3DRMMATERIAL * ppMaterial)
195 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
197 FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial);
202 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice)
204 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
206 FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, width, height, ppDevice);
211 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM* iface, LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack, LPDIRECT3DRMDEVICE * ppDevice)
213 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
215 FIXME("(%p/%p)->(%s,%p,%p,%p): stub\n", iface, This, debugstr_guid(pGUID), pDD, pDDSBack, ppDevice);
220 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM* iface, LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE * ppDevice)
222 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
224 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, pD3D, pD3DDev, ppDevice);
229 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM* iface, LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height, LPDIRECT3DRMDEVICE * ppDevice)
231 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
233 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): stub\n", iface, This, pDDClipper, debugstr_guid(pGUID), width, height, ppDevice);
238 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)
240 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
242 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);
247 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM* iface, LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE * ppTexture)
249 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
251 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
256 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
258 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
260 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, pDevice, pFrame, xpos, ypos, width, height, ppViewport);
265 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)
267 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
269 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);
274 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
276 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
278 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
283 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
285 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
287 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
292 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
294 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
296 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
301 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
303 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
305 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
310 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
312 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
314 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
319 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
321 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
323 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
328 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
330 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
332 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
337 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
339 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
341 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
346 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
348 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
350 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
355 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
357 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
359 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
364 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
366 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
368 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
373 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)
375 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
377 FIXME("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p): stub\n", iface, This, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
382 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
384 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
386 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
391 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
393 IDirect3DRMImpl_QueryInterface,
394 IDirect3DRMImpl_AddRef,
395 IDirect3DRMImpl_Release,
396 IDirect3DRMImpl_CreateObject,
397 IDirect3DRMImpl_CreateFrame,
398 IDirect3DRMImpl_CreateMesh,
399 IDirect3DRMImpl_CreateMeshBuilder,
400 IDirect3DRMImpl_CreateFace,
401 IDirect3DRMImpl_CreateAnimation,
402 IDirect3DRMImpl_CreateAnimationSet,
403 IDirect3DRMImpl_CreateTexture,
404 IDirect3DRMImpl_CreateLight,
405 IDirect3DRMImpl_CreateLightRGB,
406 IDirect3DRMImpl_Material,
407 IDirect3DRMImpl_CreateDevice,
408 IDirect3DRMImpl_CreateDeviceFromSurface,
409 IDirect3DRMImpl_CreateDeviceFromD3D,
410 IDirect3DRMImpl_CreateDeviceFromClipper,
411 IDirect3DRMImpl_CreateShadow,
412 IDirect3DRMImpl_CreateTextureFromSurface,
413 IDirect3DRMImpl_CreateViewport,
414 IDirect3DRMImpl_CreateWrap,
415 IDirect3DRMImpl_CreateUserVisual,
416 IDirect3DRMImpl_LoadTexture,
417 IDirect3DRMImpl_LoadTextureFromResource,
418 IDirect3DRMImpl_SetSearchPath,
419 IDirect3DRMImpl_AddSearchPath,
420 IDirect3DRMImpl_GetSearchPath,
421 IDirect3DRMImpl_SetDefaultTextureColors,
422 IDirect3DRMImpl_SetDefaultTextureShades,
423 IDirect3DRMImpl_GetDevices,
424 IDirect3DRMImpl_GetNamedObject,
425 IDirect3DRMImpl_EnumerateObjects,
426 IDirect3DRMImpl_Load,