ws2_32/tests: Initialize a test buffer (valgrind).
[wine/wine-gecko.git] / dlls / d3drm / frame.c
blobd66e9bfb04d5356a30d79623f3899306a3040827
1 /*
2 * Implementation of IDirect3DRMFrame Interface
4 * Copyright 2011, 2012 André Hentschel
5 * Copyright 2012 Christian Costa
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 <assert.h>
23 #include "wine/debug.h"
25 #define COBJMACROS
27 #include "winbase.h"
28 #include "wingdi.h"
30 #include "d3drm_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
34 static D3DRMMATRIX4D identity = {
35 { 1.0f, 0.0f, 0.0f, 0.0f },
36 { 0.0f, 1.0f, 0.0f, 0.0f },
37 { 0.0f, 0.0f, 1.0f, 0.0f },
38 { 0.0f, 0.0f, 0.0f, 1.0f }
41 struct d3drm_frame
43 IDirect3DRMFrame2 IDirect3DRMFrame2_iface;
44 IDirect3DRMFrame3 IDirect3DRMFrame3_iface;
45 LONG ref;
46 struct d3drm_frame *parent;
47 ULONG nb_children;
48 ULONG children_capacity;
49 IDirect3DRMFrame3** children;
50 ULONG nb_visuals;
51 ULONG visuals_capacity;
52 IDirect3DRMVisual** visuals;
53 ULONG nb_lights;
54 ULONG lights_capacity;
55 IDirect3DRMLight** lights;
56 D3DRMMATRIX4D transform;
57 D3DCOLOR scenebackground;
60 struct d3drm_frame_array
62 IDirect3DRMFrameArray IDirect3DRMFrameArray_iface;
63 LONG ref;
64 ULONG size;
65 IDirect3DRMFrame **frames;
68 struct d3drm_visual_array
70 IDirect3DRMVisualArray IDirect3DRMVisualArray_iface;
71 LONG ref;
72 ULONG size;
73 IDirect3DRMVisual **visuals;
76 struct d3drm_light_array
78 IDirect3DRMLightArray IDirect3DRMLightArray_iface;
79 LONG ref;
80 ULONG size;
81 IDirect3DRMLight **lights;
84 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface)
86 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame2_iface);
89 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
91 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame3_iface);
94 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface);
96 static inline struct d3drm_frame_array *impl_from_IDirect3DRMFrameArray(IDirect3DRMFrameArray *iface)
98 return CONTAINING_RECORD(iface, struct d3drm_frame_array, IDirect3DRMFrameArray_iface);
101 static inline struct d3drm_visual_array *impl_from_IDirect3DRMVisualArray(IDirect3DRMVisualArray *iface)
103 return CONTAINING_RECORD(iface, struct d3drm_visual_array, IDirect3DRMVisualArray_iface);
106 static inline struct d3drm_light_array *impl_from_IDirect3DRMLightArray(IDirect3DRMLightArray *iface)
108 return CONTAINING_RECORD(iface, struct d3drm_light_array, IDirect3DRMLightArray_iface);
111 static HRESULT WINAPI d3drm_frame_array_QueryInterface(IDirect3DRMFrameArray *iface, REFIID riid, void **out)
113 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
115 if (IsEqualGUID(riid, &IID_IDirect3DRMFrameArray)
116 || IsEqualGUID(riid, &IID_IUnknown))
118 IDirect3DRMFrameArray_AddRef(iface);
119 *out = iface;
120 return S_OK;
123 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
125 *out = NULL;
126 return E_NOINTERFACE;
129 static ULONG WINAPI d3drm_frame_array_AddRef(IDirect3DRMFrameArray *iface)
131 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
132 ULONG refcount = InterlockedIncrement(&array->ref);
134 TRACE("%p increasing refcount to %u.\n", iface, refcount);
136 return refcount;
139 static ULONG WINAPI d3drm_frame_array_Release(IDirect3DRMFrameArray *iface)
141 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
142 ULONG refcount = InterlockedDecrement(&array->ref);
143 ULONG i;
145 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
147 if (!refcount)
149 for (i = 0; i < array->size; ++i)
151 IDirect3DRMFrame_Release(array->frames[i]);
153 HeapFree(GetProcessHeap(), 0, array->frames);
154 HeapFree(GetProcessHeap(), 0, array);
157 return refcount;
160 static DWORD WINAPI d3drm_frame_array_GetSize(IDirect3DRMFrameArray *iface)
162 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
164 TRACE("iface %p.\n", iface);
166 return array->size;
169 static HRESULT WINAPI d3drm_frame_array_GetElement(IDirect3DRMFrameArray *iface,
170 DWORD index, IDirect3DRMFrame **frame)
172 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
174 TRACE("iface %p, index %u, frame %p.\n", iface, index, frame);
176 if (!frame)
177 return D3DRMERR_BADVALUE;
179 if (index >= array->size)
181 *frame = NULL;
182 return D3DRMERR_BADVALUE;
185 IDirect3DRMFrame_AddRef(array->frames[index]);
186 *frame = array->frames[index];
188 return D3DRM_OK;
191 static const struct IDirect3DRMFrameArrayVtbl d3drm_frame_array_vtbl =
193 d3drm_frame_array_QueryInterface,
194 d3drm_frame_array_AddRef,
195 d3drm_frame_array_Release,
196 d3drm_frame_array_GetSize,
197 d3drm_frame_array_GetElement,
200 static struct d3drm_frame_array *d3drm_frame_array_create(unsigned int frame_count, IDirect3DRMFrame3 **frames)
202 struct d3drm_frame_array *array;
203 unsigned int i;
205 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
206 return NULL;
208 array->IDirect3DRMFrameArray_iface.lpVtbl = &d3drm_frame_array_vtbl;
209 array->ref = 1;
210 array->size = frame_count;
212 if (frame_count)
214 if (!(array->frames = HeapAlloc(GetProcessHeap(), 0, frame_count * sizeof(*array->frames))))
216 HeapFree(GetProcessHeap(), 0, array);
217 return NULL;
220 for (i = 0; i < frame_count; ++i)
222 IDirect3DRMFrame3_QueryInterface(frames[i], &IID_IDirect3DRMFrame, (void **)&array->frames[i]);
226 return array;
229 static HRESULT WINAPI d3drm_visual_array_QueryInterface(IDirect3DRMVisualArray *iface, REFIID riid, void **out)
231 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
233 if (IsEqualGUID(riid, &IID_IDirect3DRMVisualArray)
234 || IsEqualGUID(riid, &IID_IUnknown))
236 IDirect3DRMVisualArray_AddRef(iface);
237 *out = iface;
238 return S_OK;
241 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
243 *out = NULL;
244 return E_NOINTERFACE;
247 static ULONG WINAPI d3drm_visual_array_AddRef(IDirect3DRMVisualArray *iface)
249 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
250 ULONG refcount = InterlockedIncrement(&array->ref);
252 TRACE("%p increasing refcount to %u.\n", iface, refcount);
254 return refcount;
257 static ULONG WINAPI d3drm_visual_array_Release(IDirect3DRMVisualArray *iface)
259 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
260 ULONG refcount = InterlockedDecrement(&array->ref);
261 ULONG i;
263 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
265 if (!refcount)
267 for (i = 0; i < array->size; ++i)
269 IDirect3DRMVisual_Release(array->visuals[i]);
271 HeapFree(GetProcessHeap(), 0, array->visuals);
272 HeapFree(GetProcessHeap(), 0, array);
275 return refcount;
278 static DWORD WINAPI d3drm_visual_array_GetSize(IDirect3DRMVisualArray *iface)
280 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
282 TRACE("iface %p.\n", iface);
284 return array->size;
287 static HRESULT WINAPI d3drm_visual_array_GetElement(IDirect3DRMVisualArray *iface,
288 DWORD index, IDirect3DRMVisual **visual)
290 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
292 TRACE("iface %p, index %u, visual %p.\n", iface, index, visual);
294 if (!visual)
295 return D3DRMERR_BADVALUE;
297 if (index >= array->size)
299 *visual = NULL;
300 return D3DRMERR_BADVALUE;
303 IDirect3DRMVisual_AddRef(array->visuals[index]);
304 *visual = array->visuals[index];
306 return D3DRM_OK;
309 static const struct IDirect3DRMVisualArrayVtbl d3drm_visual_array_vtbl =
311 d3drm_visual_array_QueryInterface,
312 d3drm_visual_array_AddRef,
313 d3drm_visual_array_Release,
314 d3drm_visual_array_GetSize,
315 d3drm_visual_array_GetElement,
318 static struct d3drm_visual_array *d3drm_visual_array_create(unsigned int visual_count, IDirect3DRMVisual **visuals)
320 struct d3drm_visual_array *array;
321 unsigned int i;
323 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
324 return NULL;
326 array->IDirect3DRMVisualArray_iface.lpVtbl = &d3drm_visual_array_vtbl;
327 array->ref = 1;
328 array->size = visual_count;
330 if (visual_count)
332 if (!(array->visuals = HeapAlloc(GetProcessHeap(), 0, visual_count * sizeof(*array->visuals))))
334 HeapFree(GetProcessHeap(), 0, array);
335 return NULL;
338 for (i = 0; i < visual_count; ++i)
340 array->visuals[i] = visuals[i];
341 IDirect3DRMVisual_AddRef(array->visuals[i]);
345 return array;
348 static HRESULT WINAPI d3drm_light_array_QueryInterface(IDirect3DRMLightArray *iface, REFIID riid, void **out)
350 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
352 if (IsEqualGUID(riid, &IID_IDirect3DRMLightArray)
353 || IsEqualGUID(riid, &IID_IUnknown))
355 IDirect3DRMLightArray_AddRef(iface);
356 *out = iface;
357 return S_OK;
360 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
362 *out = NULL;
363 return E_NOINTERFACE;
366 static ULONG WINAPI d3drm_light_array_AddRef(IDirect3DRMLightArray *iface)
368 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
369 ULONG refcount = InterlockedIncrement(&array->ref);
371 TRACE("%p increasing refcount to %u.\n", iface, refcount);
373 return refcount;
376 static ULONG WINAPI d3drm_light_array_Release(IDirect3DRMLightArray *iface)
378 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
379 ULONG refcount = InterlockedDecrement(&array->ref);
380 ULONG i;
382 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
384 if (!refcount)
386 for (i = 0; i < array->size; ++i)
388 IDirect3DRMLight_Release(array->lights[i]);
390 HeapFree(GetProcessHeap(), 0, array->lights);
391 HeapFree(GetProcessHeap(), 0, array);
394 return refcount;
397 static DWORD WINAPI d3drm_light_array_GetSize(IDirect3DRMLightArray *iface)
399 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
401 TRACE("iface %p.\n", iface);
403 return array->size;
406 static HRESULT WINAPI d3drm_light_array_GetElement(IDirect3DRMLightArray *iface,
407 DWORD index, IDirect3DRMLight **light)
409 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
411 TRACE("iface %p, index %u, light %p.\n", iface, index, light);
413 if (!light)
414 return D3DRMERR_BADVALUE;
416 if (index >= array->size)
418 *light = NULL;
419 return D3DRMERR_BADVALUE;
422 IDirect3DRMLight_AddRef(array->lights[index]);
423 *light = array->lights[index];
425 return D3DRM_OK;
428 static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl =
430 d3drm_light_array_QueryInterface,
431 d3drm_light_array_AddRef,
432 d3drm_light_array_Release,
433 d3drm_light_array_GetSize,
434 d3drm_light_array_GetElement,
437 static struct d3drm_light_array *d3drm_light_array_create(unsigned int light_count, IDirect3DRMLight **lights)
439 struct d3drm_light_array *array;
440 unsigned int i;
442 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
443 return NULL;
445 array->IDirect3DRMLightArray_iface.lpVtbl = &d3drm_light_array_vtbl;
446 array->ref = 1;
447 array->size = light_count;
449 if (light_count)
451 if (!(array->lights = HeapAlloc(GetProcessHeap(), 0, light_count * sizeof(*array->lights))))
453 HeapFree(GetProcessHeap(), 0, array);
454 return NULL;
457 for (i = 0; i < light_count; ++i)
459 array->lights[i] = lights[i];
460 IDirect3DRMLight_AddRef(array->lights[i]);
464 return array;
467 static HRESULT WINAPI d3drm_frame2_QueryInterface(IDirect3DRMFrame2 *iface, REFIID riid, void **out)
469 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
471 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
473 if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2)
474 || IsEqualGUID(riid, &IID_IDirect3DRMFrame)
475 || IsEqualGUID(riid, &IID_IUnknown))
477 *out = &frame->IDirect3DRMFrame2_iface;
479 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
481 *out = &frame->IDirect3DRMFrame3_iface;
483 else
485 *out = NULL;
486 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
487 return E_NOINTERFACE;
490 IUnknown_AddRef((IUnknown *)*out);
491 return S_OK;
494 static ULONG WINAPI d3drm_frame2_AddRef(IDirect3DRMFrame2 *iface)
496 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
497 ULONG refcount = InterlockedIncrement(&frame->ref);
499 TRACE("%p increasing refcount to %u.\n", iface, refcount);
501 return refcount;
504 static ULONG WINAPI d3drm_frame2_Release(IDirect3DRMFrame2 *iface)
506 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
507 ULONG refcount = InterlockedDecrement(&frame->ref);
508 ULONG i;
510 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
512 if (!refcount)
514 for (i = 0; i < frame->nb_children; ++i)
516 IDirect3DRMFrame3_Release(frame->children[i]);
518 HeapFree(GetProcessHeap(), 0, frame->children);
519 for (i = 0; i < frame->nb_visuals; ++i)
521 IDirect3DRMVisual_Release(frame->visuals[i]);
523 HeapFree(GetProcessHeap(), 0, frame->visuals);
524 for (i = 0; i < frame->nb_lights; ++i)
526 IDirect3DRMLight_Release(frame->lights[i]);
528 HeapFree(GetProcessHeap(), 0, frame->lights);
529 HeapFree(GetProcessHeap(), 0, frame);
532 return refcount;
535 static HRESULT WINAPI d3drm_frame2_Clone(IDirect3DRMFrame2 *iface,
536 IUnknown *outer, REFIID iid, void **out)
538 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
540 return E_NOTIMPL;
543 static HRESULT WINAPI d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2 *iface,
544 D3DRMOBJECTCALLBACK cb, void *ctx)
546 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
548 return E_NOTIMPL;
551 static HRESULT WINAPI d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2 *iface,
552 D3DRMOBJECTCALLBACK cb, void *ctx)
554 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
556 return E_NOTIMPL;
559 static HRESULT WINAPI d3drm_frame2_SetAppData(IDirect3DRMFrame2 *iface, DWORD data)
561 FIXME("iface %p, data %#x stub!\n", iface, data);
563 return E_NOTIMPL;
566 static DWORD WINAPI d3drm_frame2_GetAppData(IDirect3DRMFrame2 *iface)
568 FIXME("iface %p stub!\n", iface);
570 return 0;
573 static HRESULT WINAPI d3drm_frame2_SetName(IDirect3DRMFrame2 *iface, const char *name)
575 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
577 return E_NOTIMPL;
580 static HRESULT WINAPI d3drm_frame2_GetName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
582 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
584 return E_NOTIMPL;
587 static HRESULT WINAPI d3drm_frame2_GetClassName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
589 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
591 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
593 return IDirect3DRMFrame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
596 static HRESULT WINAPI d3drm_frame2_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
598 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
599 IDirect3DRMFrame3 *child3;
600 HRESULT hr;
602 TRACE("iface %p, child %p.\n", iface, child);
604 if (!child)
605 return D3DRMERR_BADOBJECT;
606 hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3);
607 if (hr != S_OK)
608 return D3DRMERR_BADOBJECT;
609 IDirect3DRMFrame_Release(child);
611 return IDirect3DRMFrame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3);
614 static HRESULT WINAPI d3drm_frame2_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
616 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
618 TRACE("iface %p, light %p.\n", iface, light);
620 return IDirect3DRMFrame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
623 static HRESULT WINAPI d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2 *iface,
624 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
626 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
628 return E_NOTIMPL;
631 static HRESULT WINAPI d3drm_frame2_AddTransform(IDirect3DRMFrame2 *iface, D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
633 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
635 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
637 return IDirect3DRMFrame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
640 static HRESULT WINAPI d3drm_frame2_AddTranslation(IDirect3DRMFrame2 *iface,
641 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
643 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
645 return E_NOTIMPL;
648 static HRESULT WINAPI d3drm_frame2_AddScale(IDirect3DRMFrame2 *iface,
649 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
651 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
653 return E_NOTIMPL;
656 static HRESULT WINAPI d3drm_frame2_AddRotation(IDirect3DRMFrame2 *iface,
657 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
659 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
661 return E_NOTIMPL;
664 static HRESULT WINAPI d3drm_frame2_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
666 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
668 TRACE("iface %p, visual %p.\n", iface, visual);
670 return IDirect3DRMFrame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
673 static HRESULT WINAPI d3drm_frame2_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children)
675 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
677 TRACE("iface %p, children %p.\n", iface, children);
679 return IDirect3DRMFrame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
682 static D3DCOLOR WINAPI d3drm_frame2_GetColor(IDirect3DRMFrame2 *iface)
684 FIXME("iface %p stub!\n", iface);
686 return 0;
689 static HRESULT WINAPI d3drm_frame2_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
691 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
693 TRACE("iface %p, lights %p.\n", iface, lights);
695 return IDirect3DRMFrame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
698 static D3DRMMATERIALMODE WINAPI d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2 *iface)
700 FIXME("iface %p stub!\n", iface);
702 return D3DRMMATERIAL_FROMPARENT;
705 static HRESULT WINAPI d3drm_frame2_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **parent)
707 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
709 TRACE("iface %p, parent %p.\n", iface, parent);
711 if (!parent)
712 return D3DRMERR_BADVALUE;
714 if (frame->parent)
716 *parent = (IDirect3DRMFrame *)&frame->parent->IDirect3DRMFrame2_iface;
717 IDirect3DRMFrame_AddRef(*parent);
719 else
721 *parent = NULL;
724 return D3DRM_OK;
727 static HRESULT WINAPI d3drm_frame2_GetPosition(IDirect3DRMFrame2 *iface,
728 IDirect3DRMFrame *reference, D3DVECTOR *position)
730 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
732 return E_NOTIMPL;
735 static HRESULT WINAPI d3drm_frame2_GetRotation(IDirect3DRMFrame2 *iface,
736 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
738 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
740 return E_NOTIMPL;
743 static HRESULT WINAPI d3drm_frame2_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene)
745 FIXME("iface %p, scene %p stub!\n", iface, scene);
747 return E_NOTIMPL;
750 static D3DRMSORTMODE WINAPI d3drm_frame2_GetSortMode(IDirect3DRMFrame2 *iface)
752 FIXME("iface %p stub!\n", iface);
754 return D3DRMSORT_FROMPARENT;
757 static HRESULT WINAPI d3drm_frame2_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture)
759 FIXME("iface %p, texture %p stub!\n", iface, texture);
761 return E_NOTIMPL;
764 static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix)
766 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
768 TRACE("iface %p, matrix %p.\n", iface, matrix);
770 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
772 return D3DRM_OK;
775 static HRESULT WINAPI d3drm_frame2_GetVelocity(IDirect3DRMFrame2 *iface,
776 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
778 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
779 iface, reference, velocity, with_rotation);
781 return E_NOTIMPL;
784 static HRESULT WINAPI d3drm_frame2_GetOrientation(IDirect3DRMFrame2 *iface,
785 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
787 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
789 return E_NOTIMPL;
792 static HRESULT WINAPI d3drm_frame2_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals)
794 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
795 struct d3drm_visual_array *array;
797 TRACE("iface %p, visuals %p.\n", iface, visuals);
799 if (!visuals)
800 return D3DRMERR_BADVALUE;
802 if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals)))
803 return E_OUTOFMEMORY;
805 *visuals = &array->IDirect3DRMVisualArray_iface;
807 return D3DRM_OK;
810 static HRESULT WINAPI d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2 *iface, BOOL *wrap_u, BOOL *wrap_v)
812 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
814 return E_NOTIMPL;
817 static HRESULT WINAPI d3drm_frame2_InverseTransform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
819 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
821 return E_NOTIMPL;
824 static HRESULT WINAPI d3drm_frame2_Load(IDirect3DRMFrame2 *iface, void *filename,
825 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
827 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
828 iface, filename, name, flags, cb, ctx);
830 return E_NOTIMPL;
833 static HRESULT WINAPI d3drm_frame2_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target,
834 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
836 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
838 return E_NOTIMPL;
841 static HRESULT WINAPI d3drm_frame2_Move(IDirect3DRMFrame2 *iface, D3DVALUE delta)
843 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
845 return E_NOTIMPL;
848 static HRESULT WINAPI d3drm_frame2_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
850 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
851 IDirect3DRMFrame3 *child3;
852 HRESULT hr;
854 TRACE("iface %p, child %p.\n", iface, child);
856 if (!child)
857 return D3DRMERR_BADOBJECT;
858 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3)))
859 return D3DRMERR_BADOBJECT;
860 IDirect3DRMFrame_Release(child);
862 return IDirect3DRMFrame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3);
865 static HRESULT WINAPI d3drm_frame2_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
867 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
869 TRACE("iface %p, light %p.\n", iface, light);
871 return IDirect3DRMFrame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
874 static HRESULT WINAPI d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2 *iface,
875 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
877 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
879 return E_NOTIMPL;
882 static HRESULT WINAPI d3drm_frame2_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
884 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
886 TRACE("iface %p, visual %p.\n", iface, visual);
888 return IDirect3DRMFrame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
891 static D3DCOLOR WINAPI d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2 *iface)
893 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
895 TRACE("iface %p.\n", iface);
897 return IDirect3DRMFrame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
900 static HRESULT WINAPI d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
901 IDirectDrawSurface **surface)
903 FIXME("iface %p, surface %p stub!\n", iface, surface);
905 return E_NOTIMPL;
908 static D3DCOLOR WINAPI d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2 *iface)
910 FIXME("iface %p stub!\n", iface);
912 return 0;
915 static BOOL WINAPI d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2 *iface)
917 FIXME("iface %p stub!\n", iface);
919 return FALSE;
922 static D3DRMFOGMODE WINAPI d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2 *iface)
924 FIXME("iface %p stub!\n", iface);
926 return D3DRMFOG_LINEAR;
929 static HRESULT WINAPI d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2 *iface,
930 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
932 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
934 return E_NOTIMPL;
937 static HRESULT WINAPI d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2 *iface, D3DCOLOR color)
939 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
941 TRACE("iface %p, color 0x%08x.\n", iface, color);
943 return IDirect3DRMFrame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
946 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2 *iface,
947 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
949 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
951 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
953 return IDirect3DRMFrame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
956 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface, IDirectDrawSurface *surface)
958 FIXME("iface %p, surface %p stub!\n", iface, surface);
960 return E_NOTIMPL;
963 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
965 FIXME("iface %p, texture %p stub!\n", iface, texture);
967 return E_NOTIMPL;
970 static HRESULT WINAPI d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2 *iface, BOOL enable)
972 FIXME("iface %p, enable %#x stub!\n", iface, enable);
974 return E_NOTIMPL;
977 static HRESULT WINAPI d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
979 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
981 return E_NOTIMPL;
984 static HRESULT WINAPI d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2 *iface, D3DRMFOGMODE mode)
986 FIXME("iface %p, mode %#x stub!\n", iface, mode);
988 return E_NOTIMPL;
991 static HRESULT WINAPI d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2 *iface,
992 D3DVALUE start, D3DVALUE end, D3DVALUE density)
994 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
996 return E_NOTIMPL;
999 static HRESULT WINAPI d3drm_frame2_SetColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
1001 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
1003 return E_NOTIMPL;
1006 static HRESULT WINAPI d3drm_frame2_SetColorRGB(IDirect3DRMFrame2 *iface,
1007 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1009 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
1011 return E_NOTIMPL;
1014 static D3DRMZBUFFERMODE WINAPI d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2 *iface)
1016 FIXME("iface %p stub!\n", iface);
1018 return D3DRMZBUFFER_FROMPARENT;
1021 static HRESULT WINAPI d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2 *iface, D3DRMMATERIALMODE mode)
1023 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1025 return E_NOTIMPL;
1028 static HRESULT WINAPI d3drm_frame2_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
1029 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
1031 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
1032 iface, reference, dx, dy, dz, ux, uy, uz);
1034 return E_NOTIMPL;
1037 static HRESULT WINAPI d3drm_frame2_SetPosition(IDirect3DRMFrame2 *iface,
1038 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1040 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
1042 return E_NOTIMPL;
1045 static HRESULT WINAPI d3drm_frame2_SetRotation(IDirect3DRMFrame2 *iface,
1046 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1048 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1049 iface, reference, x, y, z, theta);
1051 return E_NOTIMPL;
1054 static HRESULT WINAPI d3drm_frame2_SetSortMode(IDirect3DRMFrame2 *iface, D3DRMSORTMODE mode)
1056 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1058 return E_NOTIMPL;
1061 static HRESULT WINAPI d3drm_frame2_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
1063 FIXME("iface %p, texture %p stub!\n", iface, texture);
1065 return E_NOTIMPL;
1068 static HRESULT WINAPI d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2 *iface, BOOL wrap_u, BOOL wrap_v)
1070 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
1072 return E_NOTIMPL;
1075 static HRESULT WINAPI d3drm_frame2_SetVelocity(IDirect3DRMFrame2 *iface,
1076 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
1078 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
1079 iface, reference, x, y, z, with_rotation);
1081 return E_NOTIMPL;
1084 static HRESULT WINAPI d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2 *iface, D3DRMZBUFFERMODE mode)
1086 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1088 return E_NOTIMPL;
1091 static HRESULT WINAPI d3drm_frame2_Transform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
1093 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1095 return E_NOTIMPL;
1098 static HRESULT WINAPI d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2 *iface,
1099 D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags)
1101 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags);
1103 return E_NOTIMPL;
1106 static HRESULT WINAPI d3drm_frame2_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
1108 FIXME("iface %p, box %p stub!\n", iface, box);
1110 return E_NOTIMPL;
1113 static BOOL WINAPI d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2 *iface)
1115 FIXME("iface %p stub!\n", iface);
1117 return E_NOTIMPL;
1120 static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up)
1122 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
1124 return E_NOTIMPL;
1127 static HRESULT WINAPI d3drm_frame2_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
1129 FIXME("iface %p, material %p stub!\n", iface, material);
1131 return E_NOTIMPL;
1134 static BOOL WINAPI d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2 *iface)
1136 FIXME("iface %p stub!\n", iface);
1138 return E_NOTIMPL;
1141 static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
1143 FIXME("iface %p, box %p stub!\n", iface, box);
1145 return E_NOTIMPL;
1148 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl =
1150 d3drm_frame2_QueryInterface,
1151 d3drm_frame2_AddRef,
1152 d3drm_frame2_Release,
1153 d3drm_frame2_Clone,
1154 d3drm_frame2_AddDestroyCallback,
1155 d3drm_frame2_DeleteDestroyCallback,
1156 d3drm_frame2_SetAppData,
1157 d3drm_frame2_GetAppData,
1158 d3drm_frame2_SetName,
1159 d3drm_frame2_GetName,
1160 d3drm_frame2_GetClassName,
1161 d3drm_frame2_AddChild,
1162 d3drm_frame2_AddLight,
1163 d3drm_frame2_AddMoveCallback,
1164 d3drm_frame2_AddTransform,
1165 d3drm_frame2_AddTranslation,
1166 d3drm_frame2_AddScale,
1167 d3drm_frame2_AddRotation,
1168 d3drm_frame2_AddVisual,
1169 d3drm_frame2_GetChildren,
1170 d3drm_frame2_GetColor,
1171 d3drm_frame2_GetLights,
1172 d3drm_frame2_GetMaterialMode,
1173 d3drm_frame2_GetParent,
1174 d3drm_frame2_GetPosition,
1175 d3drm_frame2_GetRotation,
1176 d3drm_frame2_GetScene,
1177 d3drm_frame2_GetSortMode,
1178 d3drm_frame2_GetTexture,
1179 d3drm_frame2_GetTransform,
1180 d3drm_frame2_GetVelocity,
1181 d3drm_frame2_GetOrientation,
1182 d3drm_frame2_GetVisuals,
1183 d3drm_frame2_GetTextureTopology,
1184 d3drm_frame2_InverseTransform,
1185 d3drm_frame2_Load,
1186 d3drm_frame2_LookAt,
1187 d3drm_frame2_Move,
1188 d3drm_frame2_DeleteChild,
1189 d3drm_frame2_DeleteLight,
1190 d3drm_frame2_DeleteMoveCallback,
1191 d3drm_frame2_DeleteVisual,
1192 d3drm_frame2_GetSceneBackground,
1193 d3drm_frame2_GetSceneBackgroundDepth,
1194 d3drm_frame2_GetSceneFogColor,
1195 d3drm_frame2_GetSceneFogEnable,
1196 d3drm_frame2_GetSceneFogMode,
1197 d3drm_frame2_GetSceneFogParams,
1198 d3drm_frame2_SetSceneBackground,
1199 d3drm_frame2_SetSceneBackgroundRGB,
1200 d3drm_frame2_SetSceneBackgroundDepth,
1201 d3drm_frame2_SetSceneBackgroundImage,
1202 d3drm_frame2_SetSceneFogEnable,
1203 d3drm_frame2_SetSceneFogColor,
1204 d3drm_frame2_SetSceneFogMode,
1205 d3drm_frame2_SetSceneFogParams,
1206 d3drm_frame2_SetColor,
1207 d3drm_frame2_SetColorRGB,
1208 d3drm_frame2_GetZbufferMode,
1209 d3drm_frame2_SetMaterialMode,
1210 d3drm_frame2_SetOrientation,
1211 d3drm_frame2_SetPosition,
1212 d3drm_frame2_SetRotation,
1213 d3drm_frame2_SetSortMode,
1214 d3drm_frame2_SetTexture,
1215 d3drm_frame2_SetTextureTopology,
1216 d3drm_frame2_SetVelocity,
1217 d3drm_frame2_SetZbufferMode,
1218 d3drm_frame2_Transform,
1219 d3drm_frame2_AddMoveCallback2,
1220 d3drm_frame2_GetBox,
1221 d3drm_frame2_GetBoxEnable,
1222 d3drm_frame2_GetAxes,
1223 d3drm_frame2_GetMaterial,
1224 d3drm_frame2_GetInheritAxes,
1225 d3drm_frame2_GetHierarchyBox,
1228 static HRESULT WINAPI d3drm_frame3_QueryInterface(IDirect3DRMFrame3 *iface, REFIID riid, void **out)
1230 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1232 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
1234 return d3drm_frame2_QueryInterface(&frame->IDirect3DRMFrame2_iface, riid, out);
1237 static ULONG WINAPI d3drm_frame3_AddRef(IDirect3DRMFrame3 *iface)
1239 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1241 TRACE("iface %p.\n", iface);
1243 return d3drm_frame2_AddRef(&frame->IDirect3DRMFrame2_iface);
1246 static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface)
1248 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1250 TRACE("iface %p.\n", iface);
1252 return d3drm_frame2_Release(&frame->IDirect3DRMFrame2_iface);
1255 static HRESULT WINAPI d3drm_frame3_Clone(IDirect3DRMFrame3 *iface,
1256 IUnknown *outer, REFIID iid, void **out)
1258 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
1260 return E_NOTIMPL;
1263 static HRESULT WINAPI d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3 *iface,
1264 D3DRMOBJECTCALLBACK cb, void *ctx)
1266 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1268 return E_NOTIMPL;
1271 static HRESULT WINAPI d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3 *iface,
1272 D3DRMOBJECTCALLBACK cb, void *ctx)
1274 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1276 return E_NOTIMPL;
1279 static HRESULT WINAPI d3drm_frame3_SetAppData(IDirect3DRMFrame3 *iface, DWORD data)
1281 FIXME("iface %p, data %#x stub!\n", iface, data);
1283 return E_NOTIMPL;
1286 static DWORD WINAPI d3drm_frame3_GetAppData(IDirect3DRMFrame3 *iface)
1288 FIXME("iface %p stub!\n", iface);
1290 return 0;
1293 static HRESULT WINAPI d3drm_frame3_SetName(IDirect3DRMFrame3 *iface, const char *name)
1295 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1297 return E_NOTIMPL;
1300 static HRESULT WINAPI d3drm_frame3_GetName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
1302 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
1304 return E_NOTIMPL;
1307 static HRESULT WINAPI d3drm_frame3_GetClassName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
1309 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
1311 if (!size || *size < strlen("Frame") || !name)
1312 return E_INVALIDARG;
1314 strcpy(name, "Frame");
1315 *size = sizeof("Frame");
1317 return D3DRM_OK;
1320 static HRESULT WINAPI d3drm_frame3_AddChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1322 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1323 struct d3drm_frame *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child);
1325 TRACE("iface %p, child %p.\n", iface, child);
1327 if (!child_obj)
1328 return D3DRMERR_BADOBJECT;
1330 if (child_obj->parent)
1332 IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface;
1334 if (parent == iface)
1336 /* Passed frame is already a child so return success */
1337 return D3DRM_OK;
1339 else
1341 /* Remove parent and continue */
1342 IDirect3DRMFrame3_DeleteChild(parent, child);
1346 if ((This->nb_children + 1) > This->children_capacity)
1348 ULONG new_capacity;
1349 IDirect3DRMFrame3** children;
1351 if (!This->children_capacity)
1353 new_capacity = 16;
1354 children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*));
1356 else
1358 new_capacity = This->children_capacity * 2;
1359 children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*));
1362 if (!children)
1363 return E_OUTOFMEMORY;
1365 This->children_capacity = new_capacity;
1366 This->children = children;
1369 This->children[This->nb_children++] = child;
1370 IDirect3DRMFrame3_AddRef(child);
1371 child_obj->parent = This;
1373 return D3DRM_OK;
1376 static HRESULT WINAPI d3drm_frame3_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1378 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1379 ULONG i;
1380 IDirect3DRMLight** lights;
1382 TRACE("iface %p, light %p.\n", iface, light);
1384 if (!light)
1385 return D3DRMERR_BADOBJECT;
1387 /* Check if already existing and return gracefully without increasing ref count */
1388 for (i = 0; i < This->nb_lights; i++)
1389 if (This->lights[i] == light)
1390 return D3DRM_OK;
1392 if ((This->nb_lights + 1) > This->lights_capacity)
1394 ULONG new_capacity;
1396 if (!This->lights_capacity)
1398 new_capacity = 16;
1399 lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*));
1401 else
1403 new_capacity = This->lights_capacity * 2;
1404 lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*));
1407 if (!lights)
1408 return E_OUTOFMEMORY;
1410 This->lights_capacity = new_capacity;
1411 This->lights = lights;
1414 This->lights[This->nb_lights++] = light;
1415 IDirect3DRMLight_AddRef(light);
1417 return D3DRM_OK;
1420 static HRESULT WINAPI d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3 *iface,
1421 D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags)
1423 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags);
1425 return E_NOTIMPL;
1428 static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface,
1429 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
1431 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1433 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
1435 switch (type)
1437 case D3DRMCOMBINE_REPLACE:
1438 memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D));
1439 break;
1441 case D3DRMCOMBINE_BEFORE:
1442 FIXME("D3DRMCOMBINE_BEFORE not supported yet\n");
1443 break;
1445 case D3DRMCOMBINE_AFTER:
1446 FIXME("D3DRMCOMBINE_AFTER not supported yet\n");
1447 break;
1449 default:
1450 WARN("Unknown Combine Type %u\n", type);
1451 return D3DRMERR_BADVALUE;
1454 return S_OK;
1457 static HRESULT WINAPI d3drm_frame3_AddTranslation(IDirect3DRMFrame3 *iface,
1458 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1460 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1462 return E_NOTIMPL;
1465 static HRESULT WINAPI d3drm_frame3_AddScale(IDirect3DRMFrame3 *iface,
1466 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1468 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1470 return E_NOTIMPL;
1473 static HRESULT WINAPI d3drm_frame3_AddRotation(IDirect3DRMFrame3 *iface,
1474 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1476 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1477 iface, type, x, y, z, theta);
1479 return E_NOTIMPL;
1482 static HRESULT WINAPI d3drm_frame3_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1484 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1485 ULONG i;
1486 IDirect3DRMVisual** visuals;
1488 TRACE("iface %p, visual %p.\n", iface, visual);
1490 if (!visual)
1491 return D3DRMERR_BADOBJECT;
1493 /* Check if already existing and return gracefully without increasing ref count */
1494 for (i = 0; i < This->nb_visuals; i++)
1495 if (This->visuals[i] == (IDirect3DRMVisual *)visual)
1496 return D3DRM_OK;
1498 if ((This->nb_visuals + 1) > This->visuals_capacity)
1500 ULONG new_capacity;
1502 if (!This->visuals_capacity)
1504 new_capacity = 16;
1505 visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*));
1507 else
1509 new_capacity = This->visuals_capacity * 2;
1510 visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*));
1513 if (!visuals)
1514 return E_OUTOFMEMORY;
1516 This->visuals_capacity = new_capacity;
1517 This->visuals = visuals;
1520 This->visuals[This->nb_visuals++] = (IDirect3DRMVisual *)visual;
1521 IDirect3DRMVisual_AddRef(visual);
1523 return D3DRM_OK;
1526 static HRESULT WINAPI d3drm_frame3_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children)
1528 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1529 struct d3drm_frame_array *array;
1531 TRACE("iface %p, children %p.\n", iface, children);
1533 if (!children)
1534 return D3DRMERR_BADVALUE;
1536 if (!(array = d3drm_frame_array_create(frame->nb_children, frame->children)))
1537 return E_OUTOFMEMORY;
1539 *children = &array->IDirect3DRMFrameArray_iface;
1541 return D3DRM_OK;
1544 static D3DCOLOR WINAPI d3drm_frame3_GetColor(IDirect3DRMFrame3 *iface)
1546 FIXME("iface %p stub!\n", iface);
1548 return 0;
1551 static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
1553 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1554 struct d3drm_light_array *array;
1556 TRACE("iface %p, lights %p.\n", iface, lights);
1558 if (!lights)
1559 return D3DRMERR_BADVALUE;
1561 if (!(array = d3drm_light_array_create(frame->nb_lights, frame->lights)))
1562 return E_OUTOFMEMORY;
1564 *lights = &array->IDirect3DRMLightArray_iface;
1566 return D3DRM_OK;
1569 static D3DRMMATERIALMODE WINAPI d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3 *iface)
1571 FIXME("iface %p stub!\n", iface);
1573 return D3DRMMATERIAL_FROMPARENT;
1576 static HRESULT WINAPI d3drm_frame3_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **parent)
1578 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1580 TRACE("iface %p, parent %p.\n", iface, parent);
1582 if (!parent)
1583 return D3DRMERR_BADVALUE;
1585 if (frame->parent)
1587 *parent = &frame->parent->IDirect3DRMFrame3_iface;
1588 IDirect3DRMFrame_AddRef(*parent);
1590 else
1592 *parent = NULL;
1595 return D3DRM_OK;
1598 static HRESULT WINAPI d3drm_frame3_GetPosition(IDirect3DRMFrame3 *iface,
1599 IDirect3DRMFrame3 *reference, D3DVECTOR *position)
1601 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1603 return E_NOTIMPL;
1606 static HRESULT WINAPI d3drm_frame3_GetRotation(IDirect3DRMFrame3 *iface,
1607 IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *theta)
1609 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1611 return E_NOTIMPL;
1614 static HRESULT WINAPI d3drm_frame3_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene)
1616 FIXME("iface %p, scene %p stub!\n", iface, scene);
1618 return E_NOTIMPL;
1621 static D3DRMSORTMODE WINAPI d3drm_frame3_GetSortMode(IDirect3DRMFrame3 *iface)
1623 FIXME("iface %p stub!\n", iface);
1625 return D3DRMSORT_FROMPARENT;
1628 static HRESULT WINAPI d3drm_frame3_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture)
1630 FIXME("iface %p, texture %p stub!\n", iface, texture);
1632 return E_NOTIMPL;
1635 static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface,
1636 IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix)
1638 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1640 TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix);
1642 if (reference)
1643 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1645 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1647 return D3DRM_OK;
1650 static HRESULT WINAPI d3drm_frame3_GetVelocity(IDirect3DRMFrame3 *iface,
1651 IDirect3DRMFrame3 *reference, D3DVECTOR *velocity, BOOL with_rotation)
1653 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1654 iface, reference, velocity, with_rotation);
1656 return E_NOTIMPL;
1659 static HRESULT WINAPI d3drm_frame3_GetOrientation(IDirect3DRMFrame3 *iface,
1660 IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up)
1662 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1664 return E_NOTIMPL;
1667 static HRESULT WINAPI d3drm_frame3_GetVisuals(IDirect3DRMFrame3 *iface,
1668 DWORD *count, IUnknown **visuals)
1670 FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals);
1672 return E_NOTIMPL;
1675 static HRESULT WINAPI d3drm_frame3_InverseTransform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
1677 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1679 return E_NOTIMPL;
1682 static HRESULT WINAPI d3drm_frame3_Load(IDirect3DRMFrame3 *iface, void *filename,
1683 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx)
1685 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1686 iface, filename, name, flags, cb, ctx);
1688 return E_NOTIMPL;
1691 static HRESULT WINAPI d3drm_frame3_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target,
1692 IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint)
1694 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1696 return E_NOTIMPL;
1699 static HRESULT WINAPI d3drm_frame3_Move(IDirect3DRMFrame3 *iface, D3DVALUE delta)
1701 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1703 return E_NOTIMPL;
1706 static HRESULT WINAPI d3drm_frame3_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1708 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1709 struct d3drm_frame *child_impl = unsafe_impl_from_IDirect3DRMFrame3(child);
1710 ULONG i;
1712 TRACE("iface %p, child %p.\n", iface, child);
1714 if (!child_impl)
1715 return D3DRMERR_BADOBJECT;
1717 /* Check if child exists */
1718 for (i = 0; i < frame->nb_children; ++i)
1720 if (frame->children[i] == child)
1721 break;
1724 if (i == frame->nb_children)
1725 return D3DRMERR_BADVALUE;
1727 memmove(frame->children + i, frame->children + i + 1, sizeof(*frame->children) * (frame->nb_children - 1 - i));
1728 IDirect3DRMFrame3_Release(child);
1729 child_impl->parent = NULL;
1730 --frame->nb_children;
1732 return D3DRM_OK;
1735 static HRESULT WINAPI d3drm_frame3_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1737 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1738 ULONG i;
1740 TRACE("iface %p, light %p.\n", iface, light);
1742 if (!light)
1743 return D3DRMERR_BADOBJECT;
1745 /* Check if visual exists */
1746 for (i = 0; i < frame->nb_lights; ++i)
1748 if (frame->lights[i] == light)
1749 break;
1752 if (i == frame->nb_lights)
1753 return D3DRMERR_BADVALUE;
1755 memmove(frame->lights + i, frame->lights + i + 1, sizeof(*frame->lights) * (frame->nb_lights - 1 - i));
1756 IDirect3DRMLight_Release(light);
1757 --frame->nb_lights;
1759 return D3DRM_OK;
1762 static HRESULT WINAPI d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3 *iface,
1763 D3DRMFRAME3MOVECALLBACK cb, void *ctx)
1765 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1767 return E_NOTIMPL;
1770 static HRESULT WINAPI d3drm_frame3_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1772 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1773 ULONG i;
1775 TRACE("iface %p, visual %p.\n", iface, visual);
1777 if (!visual)
1778 return D3DRMERR_BADOBJECT;
1780 /* Check if visual exists */
1781 for (i = 0; i < frame->nb_visuals; ++i)
1783 if (frame->visuals[i] == (IDirect3DRMVisual *)visual)
1784 break;
1787 if (i == frame->nb_visuals)
1788 return D3DRMERR_BADVALUE;
1790 memmove(frame->visuals + i, frame->visuals + i + 1, sizeof(*frame->visuals) * (frame->nb_visuals - 1 - i));
1791 IDirect3DRMVisual_Release(visual);
1792 --frame->nb_visuals;
1794 return D3DRM_OK;
1797 static D3DCOLOR WINAPI d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3 *iface)
1799 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1801 TRACE("iface %p.\n", iface);
1803 return frame->scenebackground;
1806 static HRESULT WINAPI d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1807 IDirectDrawSurface **surface)
1809 FIXME("iface %p, surface %p stub!\n", iface, surface);
1811 return E_NOTIMPL;
1814 static D3DCOLOR WINAPI d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3 *iface)
1816 FIXME("iface %p stub!\n", iface);
1818 return 0;
1821 static BOOL WINAPI d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3 *iface)
1823 FIXME("iface %p stub!\n", iface);
1825 return FALSE;
1828 static D3DRMFOGMODE WINAPI d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3 *iface)
1830 FIXME("iface %p stub!\n", iface);
1832 return D3DRMFOG_LINEAR;
1835 static HRESULT WINAPI d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3 *iface,
1836 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1838 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1840 return E_NOTIMPL;
1843 static HRESULT WINAPI d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1845 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1847 TRACE("iface %p, color 0x%08x.\n", iface, color);
1849 frame->scenebackground = color;
1851 return D3DRM_OK;
1854 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3 *iface,
1855 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1857 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1859 TRACE("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
1861 frame->scenebackground = RGBA_MAKE((BYTE)(red * 255.0f),
1862 (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff);
1864 return D3DRM_OK;
1867 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1868 IDirectDrawSurface *surface)
1870 FIXME("iface %p, surface %p stub!\n", iface, surface);
1872 return E_NOTIMPL;
1875 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
1876 IDirect3DRMTexture3 *texture)
1878 FIXME("iface %p, texture %p stub!\n", iface, texture);
1880 return E_NOTIMPL;
1883 static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable)
1885 FIXME("iface %p, enable %#x stub!\n", iface, enable);
1887 return E_NOTIMPL;
1890 static HRESULT WINAPI d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1892 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
1894 return E_NOTIMPL;
1897 static HRESULT WINAPI d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3 *iface, D3DRMFOGMODE mode)
1899 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1901 return E_NOTIMPL;
1904 static HRESULT WINAPI d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3 *iface,
1905 D3DVALUE start, D3DVALUE end, D3DVALUE density)
1907 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
1909 return E_NOTIMPL;
1912 static HRESULT WINAPI d3drm_frame3_SetColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1914 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
1916 return E_NOTIMPL;
1919 static HRESULT WINAPI d3drm_frame3_SetColorRGB(IDirect3DRMFrame3 *iface,
1920 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1922 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
1924 return E_NOTIMPL;
1927 static D3DRMZBUFFERMODE WINAPI d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3 *iface)
1929 FIXME("iface %p stub!\n", iface);
1931 return D3DRMZBUFFER_FROMPARENT;
1934 static HRESULT WINAPI d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3 *iface, D3DRMMATERIALMODE mode)
1936 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1938 return E_NOTIMPL;
1941 static HRESULT WINAPI d3drm_frame3_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
1942 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
1944 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
1945 iface, reference, dx, dy, dz, ux, uy, uz);
1947 return E_NOTIMPL;
1950 static HRESULT WINAPI d3drm_frame3_SetPosition(IDirect3DRMFrame3 *iface,
1951 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1953 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
1955 return E_NOTIMPL;
1958 static HRESULT WINAPI d3drm_frame3_SetRotation(IDirect3DRMFrame3 *iface,
1959 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1961 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1962 iface, reference, x, y, z, theta);
1964 return E_NOTIMPL;
1967 static HRESULT WINAPI d3drm_frame3_SetSortMode(IDirect3DRMFrame3 *iface, D3DRMSORTMODE mode)
1969 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1971 return E_NOTIMPL;
1974 static HRESULT WINAPI d3drm_frame3_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture)
1976 FIXME("iface %p, texture %p stub!\n", iface, texture);
1978 return E_NOTIMPL;
1981 static HRESULT WINAPI d3drm_frame3_SetVelocity(IDirect3DRMFrame3 *iface,
1982 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
1984 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
1985 iface, reference, x, y, z, with_rotation);
1987 return E_NOTIMPL;
1990 static HRESULT WINAPI d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3 *iface, D3DRMZBUFFERMODE mode)
1992 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1994 return E_NOTIMPL;
1997 static HRESULT WINAPI d3drm_frame3_Transform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
1999 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2001 return E_NOTIMPL;
2004 static HRESULT WINAPI d3drm_frame3_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2006 FIXME("iface %p, box %p stub!\n", iface, box);
2008 return E_NOTIMPL;
2011 static BOOL WINAPI d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3 *iface)
2013 FIXME("iface %p stub!\n", iface);
2015 return E_NOTIMPL;
2018 static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2020 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2022 return E_NOTIMPL;
2025 static HRESULT WINAPI d3drm_frame3_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material)
2027 FIXME("iface %p, material %p stub!\n", iface, material);
2029 return E_NOTIMPL;
2032 static BOOL WINAPI d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3 *iface)
2034 FIXME("iface %p stub!\n", iface);
2036 return E_NOTIMPL;
2039 static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2041 FIXME("iface %p, box %p stub!\n", iface, box);
2043 return E_NOTIMPL;
2046 static HRESULT WINAPI d3drm_frame3_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2048 FIXME("iface %p, box %p stub!\n", iface, box);
2050 return E_NOTIMPL;
2053 static HRESULT WINAPI d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2055 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2057 return E_NOTIMPL;
2060 static HRESULT WINAPI d3drm_frame3_SetAxes(IDirect3DRMFrame3 *iface,
2061 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2063 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2064 iface, dx, dy, dz, ux, uy, uz);
2066 return E_NOTIMPL;
2069 static HRESULT WINAPI d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3 *iface, BOOL inherit)
2071 FIXME("iface %p, inherit %#x stub!\n", iface, inherit);
2073 return E_NOTIMPL;
2076 static HRESULT WINAPI d3drm_frame3_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material)
2078 FIXME("iface %p, material %p stub!\n", iface, material);
2080 return E_NOTIMPL;
2083 static HRESULT WINAPI d3drm_frame3_SetQuaternion(IDirect3DRMFrame3 *iface,
2084 IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q)
2086 FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q);
2088 return E_NOTIMPL;
2091 static HRESULT WINAPI d3drm_frame3_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2092 D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **visuals)
2094 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2095 iface, reference, ray, flags, visuals);
2097 return E_NOTIMPL;
2100 static HRESULT WINAPI d3drm_frame3_Save(IDirect3DRMFrame3 *iface,
2101 const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags)
2103 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2104 iface, debugstr_a(filename), format, flags);
2106 return E_NOTIMPL;
2109 static HRESULT WINAPI d3drm_frame3_TransformVectors(IDirect3DRMFrame3 *iface,
2110 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2112 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2114 return E_NOTIMPL;
2117 static HRESULT WINAPI d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3 *iface,
2118 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2120 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2122 return E_NOTIMPL;
2125 static HRESULT WINAPI d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD flags)
2127 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2129 return E_NOTIMPL;
2132 static HRESULT WINAPI d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *flags)
2134 FIXME("iface %p, flags %p stub!\n", iface, flags);
2136 return E_NOTIMPL;
2139 static HRESULT WINAPI d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD flags)
2141 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2143 return E_NOTIMPL;
2146 static HRESULT WINAPI d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode)
2148 FIXME("iface %p, fog_mode %p stub!\n", iface, fog_mode);
2150 return E_NOTIMPL;
2153 static HRESULT WINAPI d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3 *iface,
2154 D3DRMMATERIALOVERRIDE *override)
2156 FIXME("iface %p, override %p stub!\n", iface, override);
2158 return E_NOTIMPL;
2161 static HRESULT WINAPI d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3 *iface,
2162 D3DRMMATERIALOVERRIDE *override)
2164 FIXME("iface %p, override %p stub!\n", iface, override);
2166 return E_NOTIMPL;
2169 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl =
2171 d3drm_frame3_QueryInterface,
2172 d3drm_frame3_AddRef,
2173 d3drm_frame3_Release,
2174 d3drm_frame3_Clone,
2175 d3drm_frame3_AddDestroyCallback,
2176 d3drm_frame3_DeleteDestroyCallback,
2177 d3drm_frame3_SetAppData,
2178 d3drm_frame3_GetAppData,
2179 d3drm_frame3_SetName,
2180 d3drm_frame3_GetName,
2181 d3drm_frame3_GetClassName,
2182 d3drm_frame3_AddChild,
2183 d3drm_frame3_AddLight,
2184 d3drm_frame3_AddMoveCallback,
2185 d3drm_frame3_AddTransform,
2186 d3drm_frame3_AddTranslation,
2187 d3drm_frame3_AddScale,
2188 d3drm_frame3_AddRotation,
2189 d3drm_frame3_AddVisual,
2190 d3drm_frame3_GetChildren,
2191 d3drm_frame3_GetColor,
2192 d3drm_frame3_GetLights,
2193 d3drm_frame3_GetMaterialMode,
2194 d3drm_frame3_GetParent,
2195 d3drm_frame3_GetPosition,
2196 d3drm_frame3_GetRotation,
2197 d3drm_frame3_GetScene,
2198 d3drm_frame3_GetSortMode,
2199 d3drm_frame3_GetTexture,
2200 d3drm_frame3_GetTransform,
2201 d3drm_frame3_GetVelocity,
2202 d3drm_frame3_GetOrientation,
2203 d3drm_frame3_GetVisuals,
2204 d3drm_frame3_InverseTransform,
2205 d3drm_frame3_Load,
2206 d3drm_frame3_LookAt,
2207 d3drm_frame3_Move,
2208 d3drm_frame3_DeleteChild,
2209 d3drm_frame3_DeleteLight,
2210 d3drm_frame3_DeleteMoveCallback,
2211 d3drm_frame3_DeleteVisual,
2212 d3drm_frame3_GetSceneBackground,
2213 d3drm_frame3_GetSceneBackgroundDepth,
2214 d3drm_frame3_GetSceneFogColor,
2215 d3drm_frame3_GetSceneFogEnable,
2216 d3drm_frame3_GetSceneFogMode,
2217 d3drm_frame3_GetSceneFogParams,
2218 d3drm_frame3_SetSceneBackground,
2219 d3drm_frame3_SetSceneBackgroundRGB,
2220 d3drm_frame3_SetSceneBackgroundDepth,
2221 d3drm_frame3_SetSceneBackgroundImage,
2222 d3drm_frame3_SetSceneFogEnable,
2223 d3drm_frame3_SetSceneFogColor,
2224 d3drm_frame3_SetSceneFogMode,
2225 d3drm_frame3_SetSceneFogParams,
2226 d3drm_frame3_SetColor,
2227 d3drm_frame3_SetColorRGB,
2228 d3drm_frame3_GetZbufferMode,
2229 d3drm_frame3_SetMaterialMode,
2230 d3drm_frame3_SetOrientation,
2231 d3drm_frame3_SetPosition,
2232 d3drm_frame3_SetRotation,
2233 d3drm_frame3_SetSortMode,
2234 d3drm_frame3_SetTexture,
2235 d3drm_frame3_SetVelocity,
2236 d3drm_frame3_SetZbufferMode,
2237 d3drm_frame3_Transform,
2238 d3drm_frame3_GetBox,
2239 d3drm_frame3_GetBoxEnable,
2240 d3drm_frame3_GetAxes,
2241 d3drm_frame3_GetMaterial,
2242 d3drm_frame3_GetInheritAxes,
2243 d3drm_frame3_GetHierarchyBox,
2244 d3drm_frame3_SetBox,
2245 d3drm_frame3_SetBoxEnable,
2246 d3drm_frame3_SetAxes,
2247 d3drm_frame3_SetInheritAxes,
2248 d3drm_frame3_SetMaterial,
2249 d3drm_frame3_SetQuaternion,
2250 d3drm_frame3_RayPick,
2251 d3drm_frame3_Save,
2252 d3drm_frame3_TransformVectors,
2253 d3drm_frame3_InverseTransformVectors,
2254 d3drm_frame3_SetTraversalOptions,
2255 d3drm_frame3_GetTraversalOptions,
2256 d3drm_frame3_SetSceneFogMethod,
2257 d3drm_frame3_GetSceneFogMethod,
2258 d3drm_frame3_SetMaterialOverride,
2259 d3drm_frame3_GetMaterialOverride,
2262 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2264 if (!iface)
2265 return NULL;
2266 assert(iface->lpVtbl == &d3drm_frame3_vtbl);
2268 return impl_from_IDirect3DRMFrame3(iface);
2271 HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown *parent, IUnknown **out)
2273 struct d3drm_frame *object;
2274 HRESULT hr;
2276 TRACE("riid %s, parent %p, out %p.\n", debugstr_guid(riid), parent, out);
2278 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
2279 return E_OUTOFMEMORY;
2281 object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
2282 object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
2283 object->ref = 1;
2284 object->scenebackground = RGBA_MAKE(0, 0, 0, 0xff);
2286 memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2288 if (parent)
2290 IDirect3DRMFrame3 *p;
2292 hr = IDirect3DRMFrame_QueryInterface(parent, &IID_IDirect3DRMFrame3, (void**)&p);
2293 if (hr != S_OK)
2295 HeapFree(GetProcessHeap(), 0, object);
2296 return hr;
2298 IDirect3DRMFrame_Release(parent);
2299 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
2302 hr = IDirect3DRMFrame3_QueryInterface(&object->IDirect3DRMFrame3_iface, riid, (void **)out);
2303 IDirect3DRMFrame3_Release(&object->IDirect3DRMFrame3_iface);
2304 return S_OK;