2 * Implementation of IDirect3DRM Interface
4 * Copyright 2010 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/debug.h"
31 #include "d3drm_private.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(d3drm
);
37 const IDirect3DRMVtbl
*lpVtbl
;
41 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl
;
43 HRESULT
Direct3DRM_create(LPDIRECT3DRM
* ppDirect3DRM
)
45 IDirect3DRMImpl
* object
;
47 TRACE("(%p)\n", ppDirect3DRM
);
49 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirect3DRMImpl
));
52 ERR("Out of memory\n");
56 object
->lpVtbl
= &Direct3DRM_Vtbl
;
59 *ppDirect3DRM
= (IDirect3DRM
*)object
;
64 /*** IUnknown methods ***/
65 static HRESULT WINAPI
IDirect3DRMImpl_QueryInterface(IDirect3DRM
* iface
, REFIID riid
, void** ppvObject
)
67 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
69 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
71 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
72 IsEqualGUID(riid
, &IID_IDirect3DRM
))
74 IClassFactory_AddRef(iface
);
79 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
83 static ULONG WINAPI
IDirect3DRMImpl_AddRef(IDirect3DRM
* iface
)
85 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
87 TRACE("(%p/%p)\n", iface
, This
);
89 return InterlockedIncrement(&This
->ref
);
92 static ULONG WINAPI
IDirect3DRMImpl_Release(IDirect3DRM
* iface
)
94 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
95 ULONG ref
= InterlockedDecrement(&This
->ref
);
97 TRACE("(%p/%p)\n", iface
, This
);
100 HeapFree(GetProcessHeap(), 0, This
);
105 /*** IDirect3DRM methods ***/
106 static HRESULT WINAPI
IDirect3DRMImpl_CreateObject(IDirect3DRM
* iface
, REFCLSID rclsid
, LPUNKNOWN pUnkOuter
, REFIID riid
, LPVOID
*ppvObj
)
108 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
110 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface
, This
, debugstr_guid(rclsid
), pUnkOuter
, debugstr_guid(riid
), ppvObj
);
115 static HRESULT WINAPI
IDirect3DRMImpl_CreateFrame(IDirect3DRM
* iface
, LPDIRECT3DRMFRAME pFrameParent
, LPDIRECT3DRMFRAME
* ppFrame
)
117 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
119 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, pFrameParent
, ppFrame
);
124 static HRESULT WINAPI
IDirect3DRMImpl_CreateMesh(IDirect3DRM
* iface
, LPDIRECT3DRMMESH
* ppMesh
)
126 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
128 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppMesh
);
133 static HRESULT WINAPI
IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM
* iface
, LPDIRECT3DRMMESHBUILDER
* ppMeshBuilder
)
135 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
137 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppMeshBuilder
);
142 static HRESULT WINAPI
IDirect3DRMImpl_CreateFace(IDirect3DRM
* iface
, LPDIRECT3DRMFACE
* ppFace
)
144 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
146 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppFace
);
151 static HRESULT WINAPI
IDirect3DRMImpl_CreateAnimation(IDirect3DRM
* iface
, LPDIRECT3DRMANIMATION
* ppAnimation
)
153 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
155 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppAnimation
);
160 static HRESULT WINAPI
IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM
* iface
, LPDIRECT3DRMANIMATIONSET
* ppAnimationSet
)
162 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
164 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppAnimationSet
);
169 static HRESULT WINAPI
IDirect3DRMImpl_CreateTexture(IDirect3DRM
* iface
, LPD3DRMIMAGE pImage
, LPDIRECT3DRMTEXTURE
* ppTexture
)
171 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
173 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, pImage
, ppTexture
);
178 static HRESULT WINAPI
IDirect3DRMImpl_CreateLight(IDirect3DRM
* iface
, D3DRMLIGHTTYPE type
, D3DCOLOR color
, LPDIRECT3DRMLIGHT
* ppLight
)
180 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
182 FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface
, This
, type
, color
, ppLight
);
187 static HRESULT WINAPI
IDirect3DRMImpl_CreateLightRGB(IDirect3DRM
* iface
, D3DRMLIGHTTYPE type
, D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
, LPDIRECT3DRMLIGHT
* ppLight
)
189 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
191 FIXME("(%p/%p)->(%d,%f,%f,%f,%p): stub\n", iface
, This
, type
, red
, green
, blue
, ppLight
);
196 static HRESULT WINAPI
IDirect3DRMImpl_Material(IDirect3DRM
* iface
, D3DVALUE m
, LPDIRECT3DRMMATERIAL
* ppMaterial
)
198 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
200 FIXME("(%p/%p)->(%f,%p): stub\n", iface
, This
, m
, ppMaterial
);
205 static HRESULT WINAPI
IDirect3DRMImpl_CreateDevice(IDirect3DRM
* iface
, DWORD width
, DWORD height
, LPDIRECT3DRMDEVICE
* ppDevice
)
207 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
209 FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface
, This
, width
, height
, ppDevice
);
214 static HRESULT WINAPI
IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM
* iface
, LPGUID pGUID
, LPDIRECTDRAW pDD
, LPDIRECTDRAWSURFACE pDDSBack
, LPDIRECT3DRMDEVICE
* ppDevice
)
216 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
218 FIXME("(%p/%p)->(%s,%p,%p,%p): stub\n", iface
, This
, debugstr_guid(pGUID
), pDD
, pDDSBack
, ppDevice
);
223 static HRESULT WINAPI
IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM
* iface
, LPDIRECT3D pD3D
, LPDIRECT3DDEVICE pD3DDev
, LPDIRECT3DRMDEVICE
* ppDevice
)
225 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
227 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface
, This
, pD3D
, pD3DDev
, ppDevice
);
232 static HRESULT WINAPI
IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM
* iface
, LPDIRECTDRAWCLIPPER pDDClipper
, LPGUID pGUID
, int width
, int height
, LPDIRECT3DRMDEVICE
* ppDevice
)
234 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
236 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): stub\n", iface
, This
, pDDClipper
, debugstr_guid(pGUID
), width
, height
, ppDevice
);
241 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
)
243 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
245 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
);
250 static HRESULT WINAPI
IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM
* iface
, LPDIRECTDRAWSURFACE pDDS
, LPDIRECT3DRMTEXTURE
* ppTexture
)
252 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
254 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, pDDS
, ppTexture
);
259 static HRESULT WINAPI
IDirect3DRMImpl_CreateViewport(IDirect3DRM
* iface
, LPDIRECT3DRMDEVICE pDevice
, LPDIRECT3DRMFRAME pFrame
, DWORD xpos
, DWORD ypos
, DWORD width
, DWORD height
, LPDIRECT3DRMVIEWPORT
* ppViewport
)
261 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
263 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface
, This
, pDevice
, pFrame
, xpos
, ypos
, width
, height
, ppViewport
);
268 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
)
270 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
272 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
);
277 static HRESULT WINAPI
IDirect3DRMImpl_CreateUserVisual(IDirect3DRM
* iface
, D3DRMUSERVISUALCALLBACK cb
, LPVOID pArg
, LPDIRECT3DRMUSERVISUAL
* ppUserVisual
)
279 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
281 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface
, This
, cb
, pArg
, ppUserVisual
);
286 static HRESULT WINAPI
IDirect3DRMImpl_LoadTexture(IDirect3DRM
* iface
, const char * filename
, LPDIRECT3DRMTEXTURE
* ppTexture
)
288 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
290 FIXME("(%p/%p)->(%s,%p): stub\n", iface
, This
, filename
, ppTexture
);
295 static HRESULT WINAPI
IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM
* iface
, HRSRC rs
, LPDIRECT3DRMTEXTURE
* ppTexture
)
297 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
299 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, rs
, ppTexture
);
304 static HRESULT WINAPI
IDirect3DRMImpl_SetSearchPath(IDirect3DRM
* iface
, LPCSTR path
)
306 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
308 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, path
);
313 static HRESULT WINAPI
IDirect3DRMImpl_AddSearchPath(IDirect3DRM
* iface
, LPCSTR path
)
315 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
317 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, path
);
322 static HRESULT WINAPI
IDirect3DRMImpl_GetSearchPath(IDirect3DRM
* iface
, DWORD
*size_return
, LPSTR path_return
)
324 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
326 FIXME("(%p/%p)->(%p,%s): stub\n", iface
, This
, size_return
, path_return
);
331 static HRESULT WINAPI
IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM
* iface
, DWORD nb_colors
)
333 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
335 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, nb_colors
);
340 static HRESULT WINAPI
IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM
* iface
, DWORD nb_shades
)
342 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
344 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, nb_shades
);
349 static HRESULT WINAPI
IDirect3DRMImpl_GetDevices(IDirect3DRM
* iface
, LPDIRECT3DRMDEVICEARRAY
* ppDeviceArray
)
351 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
353 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppDeviceArray
);
358 static HRESULT WINAPI
IDirect3DRMImpl_GetNamedObject(IDirect3DRM
* iface
, const char * pName
, LPDIRECT3DRMOBJECT
* ppObject
)
360 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
362 FIXME("(%p/%p)->(%s,%p): stub\n", iface
, This
, pName
, ppObject
);
367 static HRESULT WINAPI
IDirect3DRMImpl_EnumerateObjects(IDirect3DRM
* iface
, D3DRMOBJECTCALLBACK cb
, LPVOID pArg
)
369 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
371 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, cb
, pArg
);
376 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
)
378 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
380 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
);
385 static HRESULT WINAPI
IDirect3DRMImpl_Tick(IDirect3DRM
* iface
, D3DVALUE tick
)
387 IDirect3DRMImpl
*This
= (IDirect3DRMImpl
*)iface
;
389 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, tick
);
394 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl
=
396 IDirect3DRMImpl_QueryInterface
,
397 IDirect3DRMImpl_AddRef
,
398 IDirect3DRMImpl_Release
,
399 IDirect3DRMImpl_CreateObject
,
400 IDirect3DRMImpl_CreateFrame
,
401 IDirect3DRMImpl_CreateMesh
,
402 IDirect3DRMImpl_CreateMeshBuilder
,
403 IDirect3DRMImpl_CreateFace
,
404 IDirect3DRMImpl_CreateAnimation
,
405 IDirect3DRMImpl_CreateAnimationSet
,
406 IDirect3DRMImpl_CreateTexture
,
407 IDirect3DRMImpl_CreateLight
,
408 IDirect3DRMImpl_CreateLightRGB
,
409 IDirect3DRMImpl_Material
,
410 IDirect3DRMImpl_CreateDevice
,
411 IDirect3DRMImpl_CreateDeviceFromSurface
,
412 IDirect3DRMImpl_CreateDeviceFromD3D
,
413 IDirect3DRMImpl_CreateDeviceFromClipper
,
414 IDirect3DRMImpl_CreateShadow
,
415 IDirect3DRMImpl_CreateTextureFromSurface
,
416 IDirect3DRMImpl_CreateViewport
,
417 IDirect3DRMImpl_CreateWrap
,
418 IDirect3DRMImpl_CreateUserVisual
,
419 IDirect3DRMImpl_LoadTexture
,
420 IDirect3DRMImpl_LoadTextureFromResource
,
421 IDirect3DRMImpl_SetSearchPath
,
422 IDirect3DRMImpl_AddSearchPath
,
423 IDirect3DRMImpl_GetSearchPath
,
424 IDirect3DRMImpl_SetDefaultTextureColors
,
425 IDirect3DRMImpl_SetDefaultTextureShades
,
426 IDirect3DRMImpl_GetDevices
,
427 IDirect3DRMImpl_GetNamedObject
,
428 IDirect3DRMImpl_EnumerateObjects
,
429 IDirect3DRMImpl_Load
,