2 * Implementation of IDirect3DRMLight Interface
4 * Copyright 2012 André Hentschel
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"
30 WINE_DEFAULT_DEBUG_CHANNEL(d3drm
);
33 IDirect3DRMLight IDirect3DRMLight_iface
;
35 } IDirect3DRMLightImpl
;
37 static inline IDirect3DRMLightImpl
*impl_from_IDirect3DRMLight(IDirect3DRMLight
*iface
)
39 return CONTAINING_RECORD(iface
, IDirect3DRMLightImpl
, IDirect3DRMLight_iface
);
42 /*** IUnknown methods ***/
43 static HRESULT WINAPI
IDirect3DRMLightImpl_QueryInterface(IDirect3DRMLight
* iface
,
44 REFIID riid
, void** object
)
46 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
48 TRACE("(%p/%p)->(%s, %p)\n", iface
, This
, debugstr_guid(riid
), object
);
52 if(IsEqualGUID(riid
, &IID_IUnknown
) ||
53 IsEqualGUID(riid
, &IID_IDirect3DRMLight
))
55 *object
= &This
->IDirect3DRMLight_iface
;
59 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
63 IDirect3DRMLight_AddRef(iface
);
67 static ULONG WINAPI
IDirect3DRMLightImpl_AddRef(IDirect3DRMLight
* iface
)
69 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
71 TRACE("(%p)\n", This
);
73 return InterlockedIncrement(&This
->ref
);
76 static ULONG WINAPI
IDirect3DRMLightImpl_Release(IDirect3DRMLight
* iface
)
78 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
79 ULONG ref
= InterlockedDecrement(&This
->ref
);
81 TRACE("(%p)\n", This
);
84 HeapFree(GetProcessHeap(), 0, This
);
89 /*** IDirect3DRMObject methods ***/
90 static HRESULT WINAPI
IDirect3DRMLightImpl_Clone(IDirect3DRMLight
* iface
,
91 LPUNKNOWN unkwn
, REFIID riid
,
94 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
96 FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface
, This
, unkwn
, debugstr_guid(riid
), object
);
101 static HRESULT WINAPI
IDirect3DRMLightImpl_AddDestroyCallback(IDirect3DRMLight
* iface
,
102 D3DRMOBJECTCALLBACK cb
,
105 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
107 FIXME("(%p/%p)->(%p, %p): stub\n", iface
, This
, cb
, argument
);
112 static HRESULT WINAPI
IDirect3DRMLightImpl_DeleteDestroyCallback(IDirect3DRMLight
* iface
,
113 D3DRMOBJECTCALLBACK cb
,
116 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
118 FIXME("(%p/%p)->(%p, %p): stub\n", iface
, This
, cb
, argument
);
123 static HRESULT WINAPI
IDirect3DRMLightImpl_SetAppData(IDirect3DRMLight
* iface
,
126 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
128 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, data
);
133 static DWORD WINAPI
IDirect3DRMLightImpl_GetAppData(IDirect3DRMLight
* iface
)
135 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
137 FIXME("(%p/%p)->(): stub\n", iface
, This
);
142 static HRESULT WINAPI
IDirect3DRMLightImpl_SetName(IDirect3DRMLight
* iface
, LPCSTR name
)
144 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
146 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, name
);
151 static HRESULT WINAPI
IDirect3DRMLightImpl_GetName(IDirect3DRMLight
* iface
,
152 LPDWORD size
, LPSTR name
)
154 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
156 FIXME("(%p/%p)->(%p, %p): stub\n", iface
, This
, size
, name
);
161 static HRESULT WINAPI
IDirect3DRMLightImpl_GetClassName(IDirect3DRMLight
* iface
,
162 LPDWORD size
, LPSTR name
)
164 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
166 FIXME("(%p/%p)->(%p, %p): stub\n", iface
, This
, size
, name
);
171 /*** IDirect3DRMLight methods ***/
172 static HRESULT WINAPI
IDirect3DRMLightImpl_SetType(IDirect3DRMLight
* iface
, D3DRMLIGHTTYPE type
)
174 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
176 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, type
);
181 static HRESULT WINAPI
IDirect3DRMLightImpl_SetColor(IDirect3DRMLight
* iface
, D3DCOLOR color
)
183 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
185 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, color
);
190 static HRESULT WINAPI
IDirect3DRMLightImpl_SetColorRGB(IDirect3DRMLight
* iface
,
191 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
193 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
195 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface
, This
, red
, green
, blue
);
200 static HRESULT WINAPI
IDirect3DRMLightImpl_SetRange(IDirect3DRMLight
* iface
, D3DVALUE range
)
202 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
204 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, range
);
209 static HRESULT WINAPI
IDirect3DRMLightImpl_SetUmbra(IDirect3DRMLight
* iface
, D3DVALUE umbra
)
211 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
213 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, umbra
);
218 static HRESULT WINAPI
IDirect3DRMLightImpl_SetPenumbra(IDirect3DRMLight
* iface
, D3DVALUE penumbra
)
220 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
222 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, penumbra
);
227 static HRESULT WINAPI
IDirect3DRMLightImpl_SetConstantAttenuation(IDirect3DRMLight
* iface
,
228 D3DVALUE cattenuation
)
230 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
232 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, cattenuation
);
237 static HRESULT WINAPI
IDirect3DRMLightImpl_SetLinearAttenuation(IDirect3DRMLight
* iface
,
238 D3DVALUE lattenuation
)
240 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
242 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, lattenuation
);
247 static HRESULT WINAPI
IDirect3DRMLightImpl_SetQuadraticAttenuation(IDirect3DRMLight
* iface
,
248 D3DVALUE qattenuation
)
250 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
252 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, qattenuation
);
257 static D3DVALUE WINAPI
IDirect3DRMLightImpl_GetRange(IDirect3DRMLight
* iface
)
259 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
261 FIXME("(%p/%p)->(): stub\n", iface
, This
);
266 static D3DVALUE WINAPI
IDirect3DRMLightImpl_GetUmbra(IDirect3DRMLight
* iface
)
268 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
270 FIXME("(%p/%p)->(): stub\n", iface
, This
);
275 static D3DVALUE WINAPI
IDirect3DRMLightImpl_GetPenumbra(IDirect3DRMLight
* iface
)
277 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
279 FIXME("(%p/%p)->(): stub\n", iface
, This
);
284 static D3DVALUE WINAPI
IDirect3DRMLightImpl_GetConstantAttenuation(IDirect3DRMLight
* iface
)
286 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
288 FIXME("(%p/%p)->(): stub\n", iface
, This
);
293 static D3DVALUE WINAPI
IDirect3DRMLightImpl_GetLinearAttenuation(IDirect3DRMLight
* iface
)
295 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
297 FIXME("(%p/%p)->(): stub\n", iface
, This
);
302 static D3DVALUE WINAPI
IDirect3DRMLightImpl_GetQuadraticAttenuation(IDirect3DRMLight
* iface
)
304 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
306 FIXME("(%p/%p)->(): stub\n", iface
, This
);
311 static D3DCOLOR WINAPI
IDirect3DRMLightImpl_GetColor(IDirect3DRMLight
* iface
)
313 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
315 FIXME("(%p/%p)->(): stub\n", iface
, This
);
320 static D3DRMLIGHTTYPE WINAPI
IDirect3DRMLightImpl_GetType(IDirect3DRMLight
* iface
)
322 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
324 FIXME("(%p/%p)->(): stub\n", iface
, This
);
326 return D3DRMLIGHT_AMBIENT
;
329 static HRESULT WINAPI
IDirect3DRMLightImpl_SetEnableFrame(IDirect3DRMLight
* iface
,
330 LPDIRECT3DRMFRAME frame
)
332 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
334 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, frame
);
339 static HRESULT WINAPI
IDirect3DRMLightImpl_GetEnableFrame(IDirect3DRMLight
* iface
,
340 LPDIRECT3DRMFRAME
* frame
)
342 IDirect3DRMLightImpl
*This
= impl_from_IDirect3DRMLight(iface
);
344 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, frame
);
349 static const struct IDirect3DRMLightVtbl Direct3DRMLight_Vtbl
=
351 /*** IUnknown methods ***/
352 IDirect3DRMLightImpl_QueryInterface
,
353 IDirect3DRMLightImpl_AddRef
,
354 IDirect3DRMLightImpl_Release
,
355 /*** IDirect3DRMObject methods ***/
356 IDirect3DRMLightImpl_Clone
,
357 IDirect3DRMLightImpl_AddDestroyCallback
,
358 IDirect3DRMLightImpl_DeleteDestroyCallback
,
359 IDirect3DRMLightImpl_SetAppData
,
360 IDirect3DRMLightImpl_GetAppData
,
361 IDirect3DRMLightImpl_SetName
,
362 IDirect3DRMLightImpl_GetName
,
363 IDirect3DRMLightImpl_GetClassName
,
364 /*** IDirect3DRMLight methods ***/
365 IDirect3DRMLightImpl_SetType
,
366 IDirect3DRMLightImpl_SetColor
,
367 IDirect3DRMLightImpl_SetColorRGB
,
368 IDirect3DRMLightImpl_SetRange
,
369 IDirect3DRMLightImpl_SetUmbra
,
370 IDirect3DRMLightImpl_SetPenumbra
,
371 IDirect3DRMLightImpl_SetConstantAttenuation
,
372 IDirect3DRMLightImpl_SetLinearAttenuation
,
373 IDirect3DRMLightImpl_SetQuadraticAttenuation
,
374 IDirect3DRMLightImpl_GetRange
,
375 IDirect3DRMLightImpl_GetUmbra
,
376 IDirect3DRMLightImpl_GetPenumbra
,
377 IDirect3DRMLightImpl_GetConstantAttenuation
,
378 IDirect3DRMLightImpl_GetLinearAttenuation
,
379 IDirect3DRMLightImpl_GetQuadraticAttenuation
,
380 IDirect3DRMLightImpl_GetColor
,
381 IDirect3DRMLightImpl_GetType
,
382 IDirect3DRMLightImpl_SetEnableFrame
,
383 IDirect3DRMLightImpl_GetEnableFrame
386 HRESULT
Direct3DRMLight_create(IUnknown
** ppObj
)
388 IDirect3DRMLightImpl
* object
;
390 TRACE("(%p)\n", ppObj
);
392 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirect3DRMLightImpl
));
395 ERR("Out of memory\n");
396 return E_OUTOFMEMORY
;
399 object
->IDirect3DRMLight_iface
.lpVtbl
= &Direct3DRMLight_Vtbl
;
402 *ppObj
= (IUnknown
*)&object
->IDirect3DRMLight_iface
;