wined3d: Don't bother with glGetError() if we have ARB_DEBUG_OUTPUT.
[wine.git] / dlls / d3drm / frame.c
blobe58dd0514c04587d05d026a9ff26e0896b091eec
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_array
43 IDirect3DRMFrameArray IDirect3DRMFrameArray_iface;
44 LONG ref;
45 ULONG size;
46 IDirect3DRMFrame **frames;
49 struct d3drm_visual_array
51 IDirect3DRMVisualArray IDirect3DRMVisualArray_iface;
52 LONG ref;
53 ULONG size;
54 IDirect3DRMVisual **visuals;
57 struct d3drm_light_array
59 IDirect3DRMLightArray IDirect3DRMLightArray_iface;
60 LONG ref;
61 ULONG size;
62 IDirect3DRMLight **lights;
65 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
67 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame_iface);
70 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface)
72 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame2_iface);
75 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
77 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame3_iface);
80 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface);
82 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface);
84 static inline struct d3drm_frame_array *impl_from_IDirect3DRMFrameArray(IDirect3DRMFrameArray *iface)
86 return CONTAINING_RECORD(iface, struct d3drm_frame_array, IDirect3DRMFrameArray_iface);
89 static inline struct d3drm_visual_array *impl_from_IDirect3DRMVisualArray(IDirect3DRMVisualArray *iface)
91 return CONTAINING_RECORD(iface, struct d3drm_visual_array, IDirect3DRMVisualArray_iface);
94 static inline struct d3drm_light_array *impl_from_IDirect3DRMLightArray(IDirect3DRMLightArray *iface)
96 return CONTAINING_RECORD(iface, struct d3drm_light_array, IDirect3DRMLightArray_iface);
99 static HRESULT WINAPI d3drm_frame_array_QueryInterface(IDirect3DRMFrameArray *iface, REFIID riid, void **out)
101 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
103 if (IsEqualGUID(riid, &IID_IDirect3DRMFrameArray)
104 || IsEqualGUID(riid, &IID_IUnknown))
106 IDirect3DRMFrameArray_AddRef(iface);
107 *out = iface;
108 return S_OK;
111 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
113 *out = NULL;
114 return E_NOINTERFACE;
117 static ULONG WINAPI d3drm_frame_array_AddRef(IDirect3DRMFrameArray *iface)
119 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
120 ULONG refcount = InterlockedIncrement(&array->ref);
122 TRACE("%p increasing refcount to %u.\n", iface, refcount);
124 return refcount;
127 static ULONG WINAPI d3drm_frame_array_Release(IDirect3DRMFrameArray *iface)
129 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
130 ULONG refcount = InterlockedDecrement(&array->ref);
131 ULONG i;
133 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
135 if (!refcount)
137 for (i = 0; i < array->size; ++i)
139 IDirect3DRMFrame_Release(array->frames[i]);
141 HeapFree(GetProcessHeap(), 0, array->frames);
142 HeapFree(GetProcessHeap(), 0, array);
145 return refcount;
148 static DWORD WINAPI d3drm_frame_array_GetSize(IDirect3DRMFrameArray *iface)
150 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
152 TRACE("iface %p.\n", iface);
154 return array->size;
157 static HRESULT WINAPI d3drm_frame_array_GetElement(IDirect3DRMFrameArray *iface,
158 DWORD index, IDirect3DRMFrame **frame)
160 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
162 TRACE("iface %p, index %u, frame %p.\n", iface, index, frame);
164 if (!frame)
165 return D3DRMERR_BADVALUE;
167 if (index >= array->size)
169 *frame = NULL;
170 return D3DRMERR_BADVALUE;
173 IDirect3DRMFrame_AddRef(array->frames[index]);
174 *frame = array->frames[index];
176 return D3DRM_OK;
179 static const struct IDirect3DRMFrameArrayVtbl d3drm_frame_array_vtbl =
181 d3drm_frame_array_QueryInterface,
182 d3drm_frame_array_AddRef,
183 d3drm_frame_array_Release,
184 d3drm_frame_array_GetSize,
185 d3drm_frame_array_GetElement,
188 static struct d3drm_frame_array *d3drm_frame_array_create(unsigned int frame_count, IDirect3DRMFrame3 **frames)
190 struct d3drm_frame_array *array;
191 unsigned int i;
193 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
194 return NULL;
196 array->IDirect3DRMFrameArray_iface.lpVtbl = &d3drm_frame_array_vtbl;
197 array->ref = 1;
198 array->size = frame_count;
200 if (frame_count)
202 if (!(array->frames = HeapAlloc(GetProcessHeap(), 0, frame_count * sizeof(*array->frames))))
204 HeapFree(GetProcessHeap(), 0, array);
205 return NULL;
208 for (i = 0; i < frame_count; ++i)
210 IDirect3DRMFrame3_QueryInterface(frames[i], &IID_IDirect3DRMFrame, (void **)&array->frames[i]);
214 return array;
217 static HRESULT WINAPI d3drm_visual_array_QueryInterface(IDirect3DRMVisualArray *iface, REFIID riid, void **out)
219 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
221 if (IsEqualGUID(riid, &IID_IDirect3DRMVisualArray)
222 || IsEqualGUID(riid, &IID_IUnknown))
224 IDirect3DRMVisualArray_AddRef(iface);
225 *out = iface;
226 return S_OK;
229 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
231 *out = NULL;
232 return E_NOINTERFACE;
235 static ULONG WINAPI d3drm_visual_array_AddRef(IDirect3DRMVisualArray *iface)
237 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
238 ULONG refcount = InterlockedIncrement(&array->ref);
240 TRACE("%p increasing refcount to %u.\n", iface, refcount);
242 return refcount;
245 static ULONG WINAPI d3drm_visual_array_Release(IDirect3DRMVisualArray *iface)
247 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
248 ULONG refcount = InterlockedDecrement(&array->ref);
249 ULONG i;
251 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
253 if (!refcount)
255 for (i = 0; i < array->size; ++i)
257 IDirect3DRMVisual_Release(array->visuals[i]);
259 HeapFree(GetProcessHeap(), 0, array->visuals);
260 HeapFree(GetProcessHeap(), 0, array);
263 return refcount;
266 static DWORD WINAPI d3drm_visual_array_GetSize(IDirect3DRMVisualArray *iface)
268 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
270 TRACE("iface %p.\n", iface);
272 return array->size;
275 static HRESULT WINAPI d3drm_visual_array_GetElement(IDirect3DRMVisualArray *iface,
276 DWORD index, IDirect3DRMVisual **visual)
278 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
280 TRACE("iface %p, index %u, visual %p.\n", iface, index, visual);
282 if (!visual)
283 return D3DRMERR_BADVALUE;
285 if (index >= array->size)
287 *visual = NULL;
288 return D3DRMERR_BADVALUE;
291 IDirect3DRMVisual_AddRef(array->visuals[index]);
292 *visual = array->visuals[index];
294 return D3DRM_OK;
297 static const struct IDirect3DRMVisualArrayVtbl d3drm_visual_array_vtbl =
299 d3drm_visual_array_QueryInterface,
300 d3drm_visual_array_AddRef,
301 d3drm_visual_array_Release,
302 d3drm_visual_array_GetSize,
303 d3drm_visual_array_GetElement,
306 static struct d3drm_visual_array *d3drm_visual_array_create(unsigned int visual_count, IDirect3DRMVisual **visuals)
308 struct d3drm_visual_array *array;
309 unsigned int i;
311 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
312 return NULL;
314 array->IDirect3DRMVisualArray_iface.lpVtbl = &d3drm_visual_array_vtbl;
315 array->ref = 1;
316 array->size = visual_count;
318 if (visual_count)
320 if (!(array->visuals = HeapAlloc(GetProcessHeap(), 0, visual_count * sizeof(*array->visuals))))
322 HeapFree(GetProcessHeap(), 0, array);
323 return NULL;
326 for (i = 0; i < visual_count; ++i)
328 array->visuals[i] = visuals[i];
329 IDirect3DRMVisual_AddRef(array->visuals[i]);
333 return array;
336 static HRESULT WINAPI d3drm_light_array_QueryInterface(IDirect3DRMLightArray *iface, REFIID riid, void **out)
338 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
340 if (IsEqualGUID(riid, &IID_IDirect3DRMLightArray)
341 || IsEqualGUID(riid, &IID_IUnknown))
343 IDirect3DRMLightArray_AddRef(iface);
344 *out = iface;
345 return S_OK;
348 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
350 *out = NULL;
351 return E_NOINTERFACE;
354 static ULONG WINAPI d3drm_light_array_AddRef(IDirect3DRMLightArray *iface)
356 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
357 ULONG refcount = InterlockedIncrement(&array->ref);
359 TRACE("%p increasing refcount to %u.\n", iface, refcount);
361 return refcount;
364 static ULONG WINAPI d3drm_light_array_Release(IDirect3DRMLightArray *iface)
366 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
367 ULONG refcount = InterlockedDecrement(&array->ref);
368 ULONG i;
370 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
372 if (!refcount)
374 for (i = 0; i < array->size; ++i)
376 IDirect3DRMLight_Release(array->lights[i]);
378 HeapFree(GetProcessHeap(), 0, array->lights);
379 HeapFree(GetProcessHeap(), 0, array);
382 return refcount;
385 static DWORD WINAPI d3drm_light_array_GetSize(IDirect3DRMLightArray *iface)
387 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
389 TRACE("iface %p.\n", iface);
391 return array->size;
394 static HRESULT WINAPI d3drm_light_array_GetElement(IDirect3DRMLightArray *iface,
395 DWORD index, IDirect3DRMLight **light)
397 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
399 TRACE("iface %p, index %u, light %p.\n", iface, index, light);
401 if (!light)
402 return D3DRMERR_BADVALUE;
404 if (index >= array->size)
406 *light = NULL;
407 return D3DRMERR_BADVALUE;
410 IDirect3DRMLight_AddRef(array->lights[index]);
411 *light = array->lights[index];
413 return D3DRM_OK;
416 static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl =
418 d3drm_light_array_QueryInterface,
419 d3drm_light_array_AddRef,
420 d3drm_light_array_Release,
421 d3drm_light_array_GetSize,
422 d3drm_light_array_GetElement,
425 static struct d3drm_light_array *d3drm_light_array_create(unsigned int light_count, IDirect3DRMLight **lights)
427 struct d3drm_light_array *array;
428 unsigned int i;
430 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
431 return NULL;
433 array->IDirect3DRMLightArray_iface.lpVtbl = &d3drm_light_array_vtbl;
434 array->ref = 1;
435 array->size = light_count;
437 if (light_count)
439 if (!(array->lights = HeapAlloc(GetProcessHeap(), 0, light_count * sizeof(*array->lights))))
441 HeapFree(GetProcessHeap(), 0, array);
442 return NULL;
445 for (i = 0; i < light_count; ++i)
447 array->lights[i] = lights[i];
448 IDirect3DRMLight_AddRef(array->lights[i]);
452 return array;
455 static HRESULT WINAPI d3drm_frame3_QueryInterface(IDirect3DRMFrame3 *iface, REFIID riid, void **out)
457 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
459 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
461 if (IsEqualGUID(riid, &IID_IDirect3DRMFrame)
462 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
463 || IsEqualGUID(riid, &IID_IDirect3DRMVisual)
464 || IsEqualGUID(riid, &IID_IUnknown))
466 *out = &frame->IDirect3DRMFrame_iface;
468 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2))
470 *out = &frame->IDirect3DRMFrame2_iface;
472 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
474 *out = &frame->IDirect3DRMFrame3_iface;
476 else
478 *out = NULL;
479 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
480 return CLASS_E_CLASSNOTAVAILABLE;
483 IUnknown_AddRef((IUnknown *)*out);
484 return S_OK;
487 static HRESULT WINAPI d3drm_frame2_QueryInterface(IDirect3DRMFrame2 *iface, REFIID riid, void **out)
489 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
491 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
493 return d3drm_frame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
496 static HRESULT WINAPI d3drm_frame1_QueryInterface(IDirect3DRMFrame *iface, REFIID riid, void **out)
498 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
500 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
502 return d3drm_frame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
505 static ULONG WINAPI d3drm_frame3_AddRef(IDirect3DRMFrame3 *iface)
507 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
508 ULONG refcount = InterlockedIncrement(&frame->ref);
510 TRACE("%p increasing refcount to %u.\n", iface, refcount);
512 return refcount;
515 static ULONG WINAPI d3drm_frame2_AddRef(IDirect3DRMFrame2 *iface)
517 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
519 TRACE("iface %p.\n", iface);
521 return d3drm_frame3_AddRef(&frame->IDirect3DRMFrame3_iface);
524 static ULONG WINAPI d3drm_frame1_AddRef(IDirect3DRMFrame *iface)
526 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
528 TRACE("iface %p.\n", iface);
530 return d3drm_frame3_AddRef(&frame->IDirect3DRMFrame3_iface);
533 static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface)
535 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
536 ULONG refcount = InterlockedDecrement(&frame->ref);
537 ULONG i;
539 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
541 if (!refcount)
543 for (i = 0; i < frame->nb_children; ++i)
545 IDirect3DRMFrame3_Release(frame->children[i]);
547 HeapFree(GetProcessHeap(), 0, frame->children);
548 for (i = 0; i < frame->nb_visuals; ++i)
550 IDirect3DRMVisual_Release(frame->visuals[i]);
552 HeapFree(GetProcessHeap(), 0, frame->visuals);
553 for (i = 0; i < frame->nb_lights; ++i)
555 IDirect3DRMLight_Release(frame->lights[i]);
557 HeapFree(GetProcessHeap(), 0, frame->lights);
558 HeapFree(GetProcessHeap(), 0, frame);
561 return refcount;
564 static ULONG WINAPI d3drm_frame2_Release(IDirect3DRMFrame2 *iface)
566 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
568 TRACE("iface %p.\n", iface);
570 return d3drm_frame3_Release(&frame->IDirect3DRMFrame3_iface);
573 static ULONG WINAPI d3drm_frame1_Release(IDirect3DRMFrame *iface)
575 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
577 TRACE("iface %p.\n", iface);
579 return d3drm_frame3_Release(&frame->IDirect3DRMFrame3_iface);
582 static HRESULT WINAPI d3drm_frame3_Clone(IDirect3DRMFrame3 *iface,
583 IUnknown *outer, REFIID iid, void **out)
585 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
587 return E_NOTIMPL;
590 static HRESULT WINAPI d3drm_frame2_Clone(IDirect3DRMFrame2 *iface,
591 IUnknown *outer, REFIID iid, void **out)
593 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
595 return E_NOTIMPL;
598 static HRESULT WINAPI d3drm_frame1_Clone(IDirect3DRMFrame *iface,
599 IUnknown *outer, REFIID iid, void **out)
601 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
603 return E_NOTIMPL;
606 static HRESULT WINAPI d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3 *iface,
607 D3DRMOBJECTCALLBACK cb, void *ctx)
609 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
611 return E_NOTIMPL;
614 static HRESULT WINAPI d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2 *iface,
615 D3DRMOBJECTCALLBACK cb, void *ctx)
617 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
619 return E_NOTIMPL;
622 static HRESULT WINAPI d3drm_frame1_AddDestroyCallback(IDirect3DRMFrame *iface,
623 D3DRMOBJECTCALLBACK cb, void *ctx)
625 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
627 return E_NOTIMPL;
630 static HRESULT WINAPI d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3 *iface,
631 D3DRMOBJECTCALLBACK cb, void *ctx)
633 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
635 return E_NOTIMPL;
638 static HRESULT WINAPI d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2 *iface,
639 D3DRMOBJECTCALLBACK cb, void *ctx)
641 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
643 return E_NOTIMPL;
646 static HRESULT WINAPI d3drm_frame1_DeleteDestroyCallback(IDirect3DRMFrame *iface,
647 D3DRMOBJECTCALLBACK cb, void *ctx)
649 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
651 return E_NOTIMPL;
654 static HRESULT WINAPI d3drm_frame3_SetAppData(IDirect3DRMFrame3 *iface, DWORD data)
656 FIXME("iface %p, data %#x stub!\n", iface, data);
658 return E_NOTIMPL;
661 static HRESULT WINAPI d3drm_frame2_SetAppData(IDirect3DRMFrame2 *iface, DWORD data)
663 FIXME("iface %p, data %#x stub!\n", iface, data);
665 return E_NOTIMPL;
668 static HRESULT WINAPI d3drm_frame1_SetAppData(IDirect3DRMFrame *iface, DWORD data)
670 FIXME("iface %p, data %#x stub!\n", iface, data);
672 return E_NOTIMPL;
675 static DWORD WINAPI d3drm_frame3_GetAppData(IDirect3DRMFrame3 *iface)
677 FIXME("iface %p stub!\n", iface);
679 return 0;
682 static DWORD WINAPI d3drm_frame2_GetAppData(IDirect3DRMFrame2 *iface)
684 FIXME("iface %p stub!\n", iface);
686 return 0;
689 static DWORD WINAPI d3drm_frame1_GetAppData(IDirect3DRMFrame *iface)
691 FIXME("iface %p stub!\n", iface);
693 return 0;
696 static HRESULT WINAPI d3drm_frame3_SetName(IDirect3DRMFrame3 *iface, const char *name)
698 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
700 return E_NOTIMPL;
703 static HRESULT WINAPI d3drm_frame2_SetName(IDirect3DRMFrame2 *iface, const char *name)
705 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
707 return E_NOTIMPL;
710 static HRESULT WINAPI d3drm_frame1_SetName(IDirect3DRMFrame *iface, const char *name)
712 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
714 return E_NOTIMPL;
717 static HRESULT WINAPI d3drm_frame3_GetName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
719 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
721 return E_NOTIMPL;
724 static HRESULT WINAPI d3drm_frame2_GetName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
726 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
728 return E_NOTIMPL;
731 static HRESULT WINAPI d3drm_frame1_GetName(IDirect3DRMFrame *iface, DWORD *size, char *name)
733 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
735 return E_NOTIMPL;
738 static HRESULT WINAPI d3drm_frame3_GetClassName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
740 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
742 if (!size || *size < strlen("Frame") || !name)
743 return E_INVALIDARG;
745 strcpy(name, "Frame");
746 *size = sizeof("Frame");
748 return D3DRM_OK;
751 static HRESULT WINAPI d3drm_frame2_GetClassName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
753 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
755 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
757 return d3drm_frame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
760 static HRESULT WINAPI d3drm_frame1_GetClassName(IDirect3DRMFrame *iface, DWORD *size, char *name)
762 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
764 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
766 return d3drm_frame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
769 static HRESULT WINAPI d3drm_frame3_AddChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
771 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
772 struct d3drm_frame *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child);
774 TRACE("iface %p, child %p.\n", iface, child);
776 if (!child_obj)
777 return D3DRMERR_BADOBJECT;
779 if (child_obj->parent)
781 IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface;
783 if (parent == iface)
785 /* Passed frame is already a child so return success */
786 return D3DRM_OK;
788 else
790 /* Remove parent and continue */
791 IDirect3DRMFrame3_DeleteChild(parent, child);
795 if ((This->nb_children + 1) > This->children_capacity)
797 ULONG new_capacity;
798 IDirect3DRMFrame3** children;
800 if (!This->children_capacity)
802 new_capacity = 16;
803 children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*));
805 else
807 new_capacity = This->children_capacity * 2;
808 children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*));
811 if (!children)
812 return E_OUTOFMEMORY;
814 This->children_capacity = new_capacity;
815 This->children = children;
818 This->children[This->nb_children++] = child;
819 IDirect3DRMFrame3_AddRef(child);
820 child_obj->parent = This;
822 return D3DRM_OK;
825 static HRESULT WINAPI d3drm_frame2_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
827 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
828 IDirect3DRMFrame3 *child3;
829 HRESULT hr;
831 TRACE("iface %p, child %p.\n", iface, child);
833 if (!child)
834 return D3DRMERR_BADOBJECT;
835 hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3);
836 if (hr != S_OK)
837 return D3DRMERR_BADOBJECT;
838 IDirect3DRMFrame_Release(child);
840 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3);
843 static HRESULT WINAPI d3drm_frame1_AddChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
845 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
846 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
848 TRACE("iface %p, child %p.\n", iface, child);
850 if (!child_frame)
851 return D3DRMERR_BADOBJECT;
853 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
856 static HRESULT WINAPI d3drm_frame3_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
858 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
859 ULONG i;
860 IDirect3DRMLight** lights;
862 TRACE("iface %p, light %p.\n", iface, light);
864 if (!light)
865 return D3DRMERR_BADOBJECT;
867 /* Check if already existing and return gracefully without increasing ref count */
868 for (i = 0; i < This->nb_lights; i++)
869 if (This->lights[i] == light)
870 return D3DRM_OK;
872 if ((This->nb_lights + 1) > This->lights_capacity)
874 ULONG new_capacity;
876 if (!This->lights_capacity)
878 new_capacity = 16;
879 lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*));
881 else
883 new_capacity = This->lights_capacity * 2;
884 lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*));
887 if (!lights)
888 return E_OUTOFMEMORY;
890 This->lights_capacity = new_capacity;
891 This->lights = lights;
894 This->lights[This->nb_lights++] = light;
895 IDirect3DRMLight_AddRef(light);
897 return D3DRM_OK;
900 static HRESULT WINAPI d3drm_frame2_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
902 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
904 TRACE("iface %p, light %p.\n", iface, light);
906 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
909 static HRESULT WINAPI d3drm_frame1_AddLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
911 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
913 TRACE("iface %p, light %p.\n", iface, light);
915 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
918 static HRESULT WINAPI d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3 *iface,
919 D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags)
921 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags);
923 return E_NOTIMPL;
926 static HRESULT WINAPI d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2 *iface,
927 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
929 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
931 return E_NOTIMPL;
934 static HRESULT WINAPI d3drm_frame1_AddMoveCallback(IDirect3DRMFrame *iface,
935 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
937 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
939 return E_NOTIMPL;
942 static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface,
943 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
945 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
947 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
949 switch (type)
951 case D3DRMCOMBINE_REPLACE:
952 memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D));
953 break;
955 case D3DRMCOMBINE_BEFORE:
956 FIXME("D3DRMCOMBINE_BEFORE not supported yet\n");
957 break;
959 case D3DRMCOMBINE_AFTER:
960 FIXME("D3DRMCOMBINE_AFTER not supported yet\n");
961 break;
963 default:
964 WARN("Unknown Combine Type %u\n", type);
965 return D3DRMERR_BADVALUE;
968 return S_OK;
971 static HRESULT WINAPI d3drm_frame2_AddTransform(IDirect3DRMFrame2 *iface,
972 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
974 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
976 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
978 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
981 static HRESULT WINAPI d3drm_frame1_AddTransform(IDirect3DRMFrame *iface,
982 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
984 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
986 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
988 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
991 static HRESULT WINAPI d3drm_frame3_AddTranslation(IDirect3DRMFrame3 *iface,
992 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
994 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
996 return E_NOTIMPL;
999 static HRESULT WINAPI d3drm_frame2_AddTranslation(IDirect3DRMFrame2 *iface,
1000 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1002 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1004 return E_NOTIMPL;
1007 static HRESULT WINAPI d3drm_frame1_AddTranslation(IDirect3DRMFrame *iface,
1008 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1010 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1012 return E_NOTIMPL;
1015 static HRESULT WINAPI d3drm_frame3_AddScale(IDirect3DRMFrame3 *iface,
1016 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1018 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1020 return E_NOTIMPL;
1023 static HRESULT WINAPI d3drm_frame2_AddScale(IDirect3DRMFrame2 *iface,
1024 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1026 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1028 return E_NOTIMPL;
1031 static HRESULT WINAPI d3drm_frame1_AddScale(IDirect3DRMFrame *iface,
1032 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1034 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1036 return E_NOTIMPL;
1039 static HRESULT WINAPI d3drm_frame3_AddRotation(IDirect3DRMFrame3 *iface,
1040 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1042 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1043 iface, type, x, y, z, theta);
1045 return E_NOTIMPL;
1048 static HRESULT WINAPI d3drm_frame2_AddRotation(IDirect3DRMFrame2 *iface,
1049 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1051 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1053 return E_NOTIMPL;
1056 static HRESULT WINAPI d3drm_frame1_AddRotation(IDirect3DRMFrame *iface,
1057 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1059 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1061 return E_NOTIMPL;
1064 static HRESULT WINAPI d3drm_frame3_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1066 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1067 ULONG i;
1068 IDirect3DRMVisual** visuals;
1070 TRACE("iface %p, visual %p.\n", iface, visual);
1072 if (!visual)
1073 return D3DRMERR_BADOBJECT;
1075 /* Check if already existing and return gracefully without increasing ref count */
1076 for (i = 0; i < This->nb_visuals; i++)
1077 if (This->visuals[i] == (IDirect3DRMVisual *)visual)
1078 return D3DRM_OK;
1080 if ((This->nb_visuals + 1) > This->visuals_capacity)
1082 ULONG new_capacity;
1084 if (!This->visuals_capacity)
1086 new_capacity = 16;
1087 visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*));
1089 else
1091 new_capacity = This->visuals_capacity * 2;
1092 visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*));
1095 if (!visuals)
1096 return E_OUTOFMEMORY;
1098 This->visuals_capacity = new_capacity;
1099 This->visuals = visuals;
1102 This->visuals[This->nb_visuals++] = (IDirect3DRMVisual *)visual;
1103 IDirect3DRMVisual_AddRef(visual);
1105 return D3DRM_OK;
1108 static HRESULT WINAPI d3drm_frame2_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1110 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1112 TRACE("iface %p, visual %p.\n", iface, visual);
1114 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1117 static HRESULT WINAPI d3drm_frame1_AddVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1119 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1121 TRACE("iface %p, visual %p.\n", iface, visual);
1123 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1126 static HRESULT WINAPI d3drm_frame3_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children)
1128 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1129 struct d3drm_frame_array *array;
1131 TRACE("iface %p, children %p.\n", iface, children);
1133 if (!children)
1134 return D3DRMERR_BADVALUE;
1136 if (!(array = d3drm_frame_array_create(frame->nb_children, frame->children)))
1137 return E_OUTOFMEMORY;
1139 *children = &array->IDirect3DRMFrameArray_iface;
1141 return D3DRM_OK;
1144 static HRESULT WINAPI d3drm_frame2_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children)
1146 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1148 TRACE("iface %p, children %p.\n", iface, children);
1150 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1153 static HRESULT WINAPI d3drm_frame1_GetChildren(IDirect3DRMFrame *iface, IDirect3DRMFrameArray **children)
1155 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1157 TRACE("iface %p, children %p.\n", iface, children);
1159 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1162 static D3DCOLOR WINAPI d3drm_frame3_GetColor(IDirect3DRMFrame3 *iface)
1164 FIXME("iface %p stub!\n", iface);
1166 return 0;
1169 static D3DCOLOR WINAPI d3drm_frame2_GetColor(IDirect3DRMFrame2 *iface)
1171 FIXME("iface %p stub!\n", iface);
1173 return 0;
1176 static D3DCOLOR WINAPI d3drm_frame1_GetColor(IDirect3DRMFrame *iface)
1178 FIXME("iface %p stub!\n", iface);
1180 return 0;
1183 static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
1185 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1186 struct d3drm_light_array *array;
1188 TRACE("iface %p, lights %p.\n", iface, lights);
1190 if (!lights)
1191 return D3DRMERR_BADVALUE;
1193 if (!(array = d3drm_light_array_create(frame->nb_lights, frame->lights)))
1194 return E_OUTOFMEMORY;
1196 *lights = &array->IDirect3DRMLightArray_iface;
1198 return D3DRM_OK;
1201 static HRESULT WINAPI d3drm_frame2_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
1203 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1205 TRACE("iface %p, lights %p.\n", iface, lights);
1207 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1210 static HRESULT WINAPI d3drm_frame1_GetLights(IDirect3DRMFrame *iface, IDirect3DRMLightArray **lights)
1212 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1214 TRACE("iface %p, lights %p.\n", iface, lights);
1216 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1219 static D3DRMMATERIALMODE WINAPI d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3 *iface)
1221 FIXME("iface %p stub!\n", iface);
1223 return D3DRMMATERIAL_FROMPARENT;
1226 static D3DRMMATERIALMODE WINAPI d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2 *iface)
1228 FIXME("iface %p stub!\n", iface);
1230 return D3DRMMATERIAL_FROMPARENT;
1233 static D3DRMMATERIALMODE WINAPI d3drm_frame1_GetMaterialMode(IDirect3DRMFrame *iface)
1235 FIXME("iface %p stub!\n", iface);
1237 return D3DRMMATERIAL_FROMPARENT;
1240 static HRESULT WINAPI d3drm_frame3_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **parent)
1242 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1244 TRACE("iface %p, parent %p.\n", iface, parent);
1246 if (!parent)
1247 return D3DRMERR_BADVALUE;
1249 if (frame->parent)
1251 *parent = &frame->parent->IDirect3DRMFrame3_iface;
1252 IDirect3DRMFrame_AddRef(*parent);
1254 else
1256 *parent = NULL;
1259 return D3DRM_OK;
1262 static HRESULT WINAPI d3drm_frame2_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **parent)
1264 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1266 TRACE("iface %p, parent %p.\n", iface, parent);
1268 if (!parent)
1269 return D3DRMERR_BADVALUE;
1271 if (frame->parent)
1273 *parent = &frame->parent->IDirect3DRMFrame_iface;
1274 IDirect3DRMFrame_AddRef(*parent);
1276 else
1278 *parent = NULL;
1281 return D3DRM_OK;
1284 static HRESULT WINAPI d3drm_frame1_GetParent(IDirect3DRMFrame *iface, IDirect3DRMFrame **parent)
1286 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1288 TRACE("iface %p, parent %p.\n", iface, parent);
1290 return d3drm_frame2_GetParent(&frame->IDirect3DRMFrame2_iface, parent);
1293 static HRESULT WINAPI d3drm_frame3_GetPosition(IDirect3DRMFrame3 *iface,
1294 IDirect3DRMFrame3 *reference, D3DVECTOR *position)
1296 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1298 return E_NOTIMPL;
1301 static HRESULT WINAPI d3drm_frame2_GetPosition(IDirect3DRMFrame2 *iface,
1302 IDirect3DRMFrame *reference, D3DVECTOR *position)
1304 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1306 return E_NOTIMPL;
1309 static HRESULT WINAPI d3drm_frame1_GetPosition(IDirect3DRMFrame *iface,
1310 IDirect3DRMFrame *reference, D3DVECTOR *position)
1312 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1314 return E_NOTIMPL;
1318 static HRESULT WINAPI d3drm_frame3_GetRotation(IDirect3DRMFrame3 *iface,
1319 IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *theta)
1321 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1323 return E_NOTIMPL;
1326 static HRESULT WINAPI d3drm_frame2_GetRotation(IDirect3DRMFrame2 *iface,
1327 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1329 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1331 return E_NOTIMPL;
1334 static HRESULT WINAPI d3drm_frame1_GetRotation(IDirect3DRMFrame *iface,
1335 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1337 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1339 return E_NOTIMPL;
1342 static HRESULT WINAPI d3drm_frame3_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene)
1344 FIXME("iface %p, scene %p stub!\n", iface, scene);
1346 return E_NOTIMPL;
1349 static HRESULT WINAPI d3drm_frame2_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene)
1351 FIXME("iface %p, scene %p stub!\n", iface, scene);
1353 return E_NOTIMPL;
1356 static HRESULT WINAPI d3drm_frame1_GetScene(IDirect3DRMFrame *iface, IDirect3DRMFrame **scene)
1358 FIXME("iface %p, scene %p stub!\n", iface, scene);
1360 return E_NOTIMPL;
1363 static D3DRMSORTMODE WINAPI d3drm_frame3_GetSortMode(IDirect3DRMFrame3 *iface)
1365 FIXME("iface %p stub!\n", iface);
1367 return D3DRMSORT_FROMPARENT;
1370 static D3DRMSORTMODE WINAPI d3drm_frame2_GetSortMode(IDirect3DRMFrame2 *iface)
1372 FIXME("iface %p stub!\n", iface);
1374 return D3DRMSORT_FROMPARENT;
1377 static D3DRMSORTMODE WINAPI d3drm_frame1_GetSortMode(IDirect3DRMFrame *iface)
1379 FIXME("iface %p stub!\n", iface);
1381 return D3DRMSORT_FROMPARENT;
1384 static HRESULT WINAPI d3drm_frame3_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture)
1386 FIXME("iface %p, texture %p stub!\n", iface, texture);
1388 return E_NOTIMPL;
1391 static HRESULT WINAPI d3drm_frame2_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture)
1393 FIXME("iface %p, texture %p stub!\n", iface, texture);
1395 return E_NOTIMPL;
1398 static HRESULT WINAPI d3drm_frame1_GetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture **texture)
1400 FIXME("iface %p, texture %p stub!\n", iface, texture);
1402 return E_NOTIMPL;
1405 static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface,
1406 IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix)
1408 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1410 TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix);
1412 if (reference)
1413 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1415 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1417 return D3DRM_OK;
1420 static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix)
1422 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1424 TRACE("iface %p, matrix %p.\n", iface, matrix);
1426 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1428 return D3DRM_OK;
1431 static HRESULT WINAPI d3drm_frame1_GetTransform(IDirect3DRMFrame *iface, D3DRMMATRIX4D matrix)
1433 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1435 TRACE("iface %p, matrix %p.\n", iface, matrix);
1437 return d3drm_frame2_GetTransform(&frame->IDirect3DRMFrame2_iface, matrix);
1440 static HRESULT WINAPI d3drm_frame3_GetVelocity(IDirect3DRMFrame3 *iface,
1441 IDirect3DRMFrame3 *reference, D3DVECTOR *velocity, BOOL with_rotation)
1443 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1444 iface, reference, velocity, with_rotation);
1446 return E_NOTIMPL;
1449 static HRESULT WINAPI d3drm_frame2_GetVelocity(IDirect3DRMFrame2 *iface,
1450 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1452 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1453 iface, reference, velocity, with_rotation);
1455 return E_NOTIMPL;
1458 static HRESULT WINAPI d3drm_frame1_GetVelocity(IDirect3DRMFrame *iface,
1459 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1461 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1462 iface, reference, velocity, with_rotation);
1464 return E_NOTIMPL;
1467 static HRESULT WINAPI d3drm_frame3_GetOrientation(IDirect3DRMFrame3 *iface,
1468 IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up)
1470 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1472 return E_NOTIMPL;
1475 static HRESULT WINAPI d3drm_frame2_GetOrientation(IDirect3DRMFrame2 *iface,
1476 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1478 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1480 return E_NOTIMPL;
1483 static HRESULT WINAPI d3drm_frame1_GetOrientation(IDirect3DRMFrame *iface,
1484 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1486 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1488 return E_NOTIMPL;
1491 static HRESULT WINAPI d3drm_frame3_GetVisuals(IDirect3DRMFrame3 *iface, DWORD *count, IUnknown **visuals)
1493 FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals);
1495 return E_NOTIMPL;
1498 static HRESULT WINAPI d3drm_frame2_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals)
1500 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1501 struct d3drm_visual_array *array;
1503 TRACE("iface %p, visuals %p.\n", iface, visuals);
1505 if (!visuals)
1506 return D3DRMERR_BADVALUE;
1508 if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals)))
1509 return E_OUTOFMEMORY;
1511 *visuals = &array->IDirect3DRMVisualArray_iface;
1513 return D3DRM_OK;
1516 static HRESULT WINAPI d3drm_frame1_GetVisuals(IDirect3DRMFrame *iface, IDirect3DRMVisualArray **visuals)
1518 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1520 TRACE("iface %p, visuals %p.\n", iface, visuals);
1522 return d3drm_frame2_GetVisuals(&frame->IDirect3DRMFrame2_iface, visuals);
1525 static HRESULT WINAPI d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2 *iface, BOOL *wrap_u, BOOL *wrap_v)
1527 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1529 return E_NOTIMPL;
1532 static HRESULT WINAPI d3drm_frame1_GetTextureTopology(IDirect3DRMFrame *iface, BOOL *wrap_u, BOOL *wrap_v)
1534 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1536 return E_NOTIMPL;
1539 static HRESULT WINAPI d3drm_frame3_InverseTransform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
1541 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1543 return E_NOTIMPL;
1546 static HRESULT WINAPI d3drm_frame2_InverseTransform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
1548 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1550 return E_NOTIMPL;
1553 static HRESULT WINAPI d3drm_frame1_InverseTransform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
1555 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1557 return E_NOTIMPL;
1560 static HRESULT WINAPI d3drm_frame3_Load(IDirect3DRMFrame3 *iface, void *filename,
1561 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx)
1563 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1564 iface, filename, name, flags, cb, ctx);
1566 return E_NOTIMPL;
1569 static HRESULT WINAPI d3drm_frame2_Load(IDirect3DRMFrame2 *iface, void *filename,
1570 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1572 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1573 iface, filename, name, flags, cb, ctx);
1575 return E_NOTIMPL;
1578 static HRESULT WINAPI d3drm_frame1_Load(IDirect3DRMFrame *iface, void *filename,
1579 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1581 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1582 iface, filename, name, flags, cb, ctx);
1584 return E_NOTIMPL;
1587 static HRESULT WINAPI d3drm_frame3_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target,
1588 IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint)
1590 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1592 return E_NOTIMPL;
1595 static HRESULT WINAPI d3drm_frame2_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target,
1596 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1598 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1600 return E_NOTIMPL;
1603 static HRESULT WINAPI d3drm_frame1_LookAt(IDirect3DRMFrame *iface, IDirect3DRMFrame *target,
1604 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1606 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1608 return E_NOTIMPL;
1611 static HRESULT WINAPI d3drm_frame3_Move(IDirect3DRMFrame3 *iface, D3DVALUE delta)
1613 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1615 return E_NOTIMPL;
1618 static HRESULT WINAPI d3drm_frame2_Move(IDirect3DRMFrame2 *iface, D3DVALUE delta)
1620 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1622 return E_NOTIMPL;
1625 static HRESULT WINAPI d3drm_frame1_Move(IDirect3DRMFrame *iface, D3DVALUE delta)
1627 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1629 return E_NOTIMPL;
1632 static HRESULT WINAPI d3drm_frame3_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1634 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1635 struct d3drm_frame *child_impl = unsafe_impl_from_IDirect3DRMFrame3(child);
1636 ULONG i;
1638 TRACE("iface %p, child %p.\n", iface, child);
1640 if (!child_impl)
1641 return D3DRMERR_BADOBJECT;
1643 /* Check if child exists */
1644 for (i = 0; i < frame->nb_children; ++i)
1646 if (frame->children[i] == child)
1647 break;
1650 if (i == frame->nb_children)
1651 return D3DRMERR_BADVALUE;
1653 memmove(frame->children + i, frame->children + i + 1, sizeof(*frame->children) * (frame->nb_children - 1 - i));
1654 IDirect3DRMFrame3_Release(child);
1655 child_impl->parent = NULL;
1656 --frame->nb_children;
1658 return D3DRM_OK;
1661 static HRESULT WINAPI d3drm_frame2_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
1663 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1664 IDirect3DRMFrame3 *child3;
1665 HRESULT hr;
1667 TRACE("iface %p, child %p.\n", iface, child);
1669 if (!child)
1670 return D3DRMERR_BADOBJECT;
1671 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3)))
1672 return D3DRMERR_BADOBJECT;
1673 IDirect3DRMFrame_Release(child);
1675 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3);
1678 static HRESULT WINAPI d3drm_frame1_DeleteChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
1680 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1681 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
1683 TRACE("iface %p, child %p.\n", iface, child);
1685 if (!child_frame)
1686 return D3DRMERR_BADOBJECT;
1688 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
1691 static HRESULT WINAPI d3drm_frame3_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1693 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1694 ULONG i;
1696 TRACE("iface %p, light %p.\n", iface, light);
1698 if (!light)
1699 return D3DRMERR_BADOBJECT;
1701 /* Check if visual exists */
1702 for (i = 0; i < frame->nb_lights; ++i)
1704 if (frame->lights[i] == light)
1705 break;
1708 if (i == frame->nb_lights)
1709 return D3DRMERR_BADVALUE;
1711 memmove(frame->lights + i, frame->lights + i + 1, sizeof(*frame->lights) * (frame->nb_lights - 1 - i));
1712 IDirect3DRMLight_Release(light);
1713 --frame->nb_lights;
1715 return D3DRM_OK;
1718 static HRESULT WINAPI d3drm_frame2_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
1720 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1722 TRACE("iface %p, light %p.\n", iface, light);
1724 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1727 static HRESULT WINAPI d3drm_frame1_DeleteLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
1729 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1731 TRACE("iface %p, light %p.\n", iface, light);
1733 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1736 static HRESULT WINAPI d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3 *iface,
1737 D3DRMFRAME3MOVECALLBACK cb, void *ctx)
1739 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1741 return E_NOTIMPL;
1744 static HRESULT WINAPI d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2 *iface,
1745 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1747 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1749 return E_NOTIMPL;
1752 static HRESULT WINAPI d3drm_frame1_DeleteMoveCallback(IDirect3DRMFrame *iface,
1753 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1755 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1757 return E_NOTIMPL;
1760 static HRESULT WINAPI d3drm_frame3_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1762 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1763 ULONG i;
1765 TRACE("iface %p, visual %p.\n", iface, visual);
1767 if (!visual)
1768 return D3DRMERR_BADOBJECT;
1770 /* Check if visual exists */
1771 for (i = 0; i < frame->nb_visuals; ++i)
1773 if (frame->visuals[i] == (IDirect3DRMVisual *)visual)
1774 break;
1777 if (i == frame->nb_visuals)
1778 return D3DRMERR_BADVALUE;
1780 memmove(frame->visuals + i, frame->visuals + i + 1, sizeof(*frame->visuals) * (frame->nb_visuals - 1 - i));
1781 IDirect3DRMVisual_Release(visual);
1782 --frame->nb_visuals;
1784 return D3DRM_OK;
1787 static HRESULT WINAPI d3drm_frame2_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1789 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1791 TRACE("iface %p, visual %p.\n", iface, visual);
1793 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1796 static HRESULT WINAPI d3drm_frame1_DeleteVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1798 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1800 TRACE("iface %p, visual %p.\n", iface, visual);
1802 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1805 static D3DCOLOR WINAPI d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3 *iface)
1807 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1809 TRACE("iface %p.\n", iface);
1811 return frame->scenebackground;
1814 static D3DCOLOR WINAPI d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2 *iface)
1816 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1818 TRACE("iface %p.\n", iface);
1820 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1823 static D3DCOLOR WINAPI d3drm_frame1_GetSceneBackground(IDirect3DRMFrame *iface)
1825 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1827 TRACE("iface %p.\n", iface);
1829 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1832 static HRESULT WINAPI d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1833 IDirectDrawSurface **surface)
1835 FIXME("iface %p, surface %p stub!\n", iface, surface);
1837 return E_NOTIMPL;
1840 static HRESULT WINAPI d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
1841 IDirectDrawSurface **surface)
1843 FIXME("iface %p, surface %p stub!\n", iface, surface);
1845 return E_NOTIMPL;
1848 static HRESULT WINAPI d3drm_frame1_GetSceneBackgroundDepth(IDirect3DRMFrame *iface,
1849 IDirectDrawSurface **surface)
1851 FIXME("iface %p, surface %p stub!\n", iface, surface);
1853 return E_NOTIMPL;
1856 static D3DCOLOR WINAPI d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3 *iface)
1858 FIXME("iface %p stub!\n", iface);
1860 return 0;
1863 static D3DCOLOR WINAPI d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2 *iface)
1865 FIXME("iface %p stub!\n", iface);
1867 return 0;
1870 static D3DCOLOR WINAPI d3drm_frame1_GetSceneFogColor(IDirect3DRMFrame *iface)
1872 FIXME("iface %p stub!\n", iface);
1874 return 0;
1877 static BOOL WINAPI d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3 *iface)
1879 FIXME("iface %p stub!\n", iface);
1881 return FALSE;
1884 static BOOL WINAPI d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2 *iface)
1886 FIXME("iface %p stub!\n", iface);
1888 return FALSE;
1891 static BOOL WINAPI d3drm_frame1_GetSceneFogEnable(IDirect3DRMFrame *iface)
1893 FIXME("iface %p stub!\n", iface);
1895 return FALSE;
1898 static D3DRMFOGMODE WINAPI d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3 *iface)
1900 FIXME("iface %p stub!\n", iface);
1902 return D3DRMFOG_LINEAR;
1905 static D3DRMFOGMODE WINAPI d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2 *iface)
1907 FIXME("iface %p stub!\n", iface);
1909 return D3DRMFOG_LINEAR;
1912 static D3DRMFOGMODE WINAPI d3drm_frame1_GetSceneFogMode(IDirect3DRMFrame *iface)
1914 FIXME("iface %p stub!\n", iface);
1916 return D3DRMFOG_LINEAR;
1919 static HRESULT WINAPI d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3 *iface,
1920 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1922 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1924 return E_NOTIMPL;
1927 static HRESULT WINAPI d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2 *iface,
1928 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1930 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1932 return E_NOTIMPL;
1935 static HRESULT WINAPI d3drm_frame1_GetSceneFogParams(IDirect3DRMFrame *iface,
1936 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1938 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1940 return E_NOTIMPL;
1943 static HRESULT WINAPI d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1945 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1947 TRACE("iface %p, color 0x%08x.\n", iface, color);
1949 frame->scenebackground = color;
1951 return D3DRM_OK;
1954 static HRESULT WINAPI d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2 *iface, D3DCOLOR color)
1956 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1958 TRACE("iface %p, color 0x%08x.\n", iface, color);
1960 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
1963 static HRESULT WINAPI d3drm_frame1_SetSceneBackground(IDirect3DRMFrame *iface, D3DCOLOR color)
1965 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1967 TRACE("iface %p, color 0x%08x.\n", iface, color);
1969 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
1972 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3 *iface,
1973 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1975 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1977 TRACE("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
1979 frame->scenebackground = RGBA_MAKE((BYTE)(red * 255.0f),
1980 (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff);
1982 return D3DRM_OK;
1985 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2 *iface,
1986 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1988 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1990 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
1992 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
1995 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundRGB(IDirect3DRMFrame *iface,
1996 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1998 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
2000 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2002 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2005 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
2006 IDirectDrawSurface *surface)
2008 FIXME("iface %p, surface %p stub!\n", iface, surface);
2010 return E_NOTIMPL;
2013 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
2014 IDirectDrawSurface *surface)
2016 FIXME("iface %p, surface %p stub!\n", iface, surface);
2018 return E_NOTIMPL;
2021 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundDepth(IDirect3DRMFrame *iface,
2022 IDirectDrawSurface *surface)
2024 FIXME("iface %p, surface %p stub!\n", iface, surface);
2026 return E_NOTIMPL;
2029 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
2030 IDirect3DRMTexture3 *texture)
2032 FIXME("iface %p, texture %p stub!\n", iface, texture);
2034 return E_NOTIMPL;
2037 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface,
2038 IDirect3DRMTexture *texture)
2040 FIXME("iface %p, texture %p stub!\n", iface, texture);
2042 return E_NOTIMPL;
2045 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundImage(IDirect3DRMFrame *iface,
2046 IDirect3DRMTexture *texture)
2048 FIXME("iface %p, texture %p stub!\n", iface, texture);
2050 return E_NOTIMPL;
2053 static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2055 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2057 return E_NOTIMPL;
2060 static HRESULT WINAPI d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2 *iface, BOOL enable)
2062 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2064 return E_NOTIMPL;
2067 static HRESULT WINAPI d3drm_frame1_SetSceneFogEnable(IDirect3DRMFrame *iface, BOOL enable)
2069 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2071 return E_NOTIMPL;
2074 static HRESULT WINAPI d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2076 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2078 return E_NOTIMPL;
2081 static HRESULT WINAPI d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2083 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2085 return E_NOTIMPL;
2088 static HRESULT WINAPI d3drm_frame1_SetSceneFogColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2090 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2092 return E_NOTIMPL;
2095 static HRESULT WINAPI d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3 *iface, D3DRMFOGMODE mode)
2097 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2099 return E_NOTIMPL;
2102 static HRESULT WINAPI d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2 *iface, D3DRMFOGMODE mode)
2104 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2106 return E_NOTIMPL;
2109 static HRESULT WINAPI d3drm_frame1_SetSceneFogMode(IDirect3DRMFrame *iface, D3DRMFOGMODE mode)
2111 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2113 return E_NOTIMPL;
2116 static HRESULT WINAPI d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3 *iface,
2117 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2119 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2121 return E_NOTIMPL;
2124 static HRESULT WINAPI d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2 *iface,
2125 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2127 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2129 return E_NOTIMPL;
2132 static HRESULT WINAPI d3drm_frame1_SetSceneFogParams(IDirect3DRMFrame *iface,
2133 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2135 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2137 return E_NOTIMPL;
2140 static HRESULT WINAPI d3drm_frame3_SetColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2142 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2144 return E_NOTIMPL;
2147 static HRESULT WINAPI d3drm_frame2_SetColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2149 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2151 return E_NOTIMPL;
2154 static HRESULT WINAPI d3drm_frame1_SetColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2156 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2158 return E_NOTIMPL;
2161 static HRESULT WINAPI d3drm_frame3_SetColorRGB(IDirect3DRMFrame3 *iface,
2162 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2164 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2166 return E_NOTIMPL;
2169 static HRESULT WINAPI d3drm_frame2_SetColorRGB(IDirect3DRMFrame2 *iface,
2170 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2172 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2174 return E_NOTIMPL;
2177 static HRESULT WINAPI d3drm_frame1_SetColorRGB(IDirect3DRMFrame *iface,
2178 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2180 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2182 return E_NOTIMPL;
2185 static D3DRMZBUFFERMODE WINAPI d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3 *iface)
2187 FIXME("iface %p stub!\n", iface);
2189 return D3DRMZBUFFER_FROMPARENT;
2192 static D3DRMZBUFFERMODE WINAPI d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2 *iface)
2194 FIXME("iface %p stub!\n", iface);
2196 return D3DRMZBUFFER_FROMPARENT;
2199 static D3DRMZBUFFERMODE WINAPI d3drm_frame1_GetZbufferMode(IDirect3DRMFrame *iface)
2201 FIXME("iface %p stub!\n", iface);
2203 return D3DRMZBUFFER_FROMPARENT;
2206 static HRESULT WINAPI d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3 *iface, D3DRMMATERIALMODE mode)
2208 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2210 return E_NOTIMPL;
2213 static HRESULT WINAPI d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2 *iface, D3DRMMATERIALMODE mode)
2215 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2217 return E_NOTIMPL;
2220 static HRESULT WINAPI d3drm_frame1_SetMaterialMode(IDirect3DRMFrame *iface, D3DRMMATERIALMODE mode)
2222 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2224 return E_NOTIMPL;
2227 static HRESULT WINAPI d3drm_frame3_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2228 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2230 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2231 iface, reference, dx, dy, dz, ux, uy, uz);
2233 return E_NOTIMPL;
2236 static HRESULT WINAPI d3drm_frame2_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
2237 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2239 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2240 iface, reference, dx, dy, dz, ux, uy, uz);
2242 return E_NOTIMPL;
2245 static HRESULT WINAPI d3drm_frame1_SetOrientation(IDirect3DRMFrame *iface, IDirect3DRMFrame *reference,
2246 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2248 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2249 iface, reference, dx, dy, dz, ux, uy, uz);
2251 return E_NOTIMPL;
2254 static HRESULT WINAPI d3drm_frame3_SetPosition(IDirect3DRMFrame3 *iface,
2255 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2257 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2259 return E_NOTIMPL;
2262 static HRESULT WINAPI d3drm_frame2_SetPosition(IDirect3DRMFrame2 *iface,
2263 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2265 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2267 return E_NOTIMPL;
2270 static HRESULT WINAPI d3drm_frame1_SetPosition(IDirect3DRMFrame *iface,
2271 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2273 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2275 return E_NOTIMPL;
2278 static HRESULT WINAPI d3drm_frame3_SetRotation(IDirect3DRMFrame3 *iface,
2279 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2281 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2282 iface, reference, x, y, z, theta);
2284 return E_NOTIMPL;
2287 static HRESULT WINAPI d3drm_frame2_SetRotation(IDirect3DRMFrame2 *iface,
2288 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2290 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2291 iface, reference, x, y, z, theta);
2293 return E_NOTIMPL;
2296 static HRESULT WINAPI d3drm_frame1_SetRotation(IDirect3DRMFrame *iface,
2297 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2299 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2300 iface, reference, x, y, z, theta);
2302 return E_NOTIMPL;
2305 static HRESULT WINAPI d3drm_frame3_SetSortMode(IDirect3DRMFrame3 *iface, D3DRMSORTMODE mode)
2307 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2309 return E_NOTIMPL;
2312 static HRESULT WINAPI d3drm_frame2_SetSortMode(IDirect3DRMFrame2 *iface, D3DRMSORTMODE mode)
2314 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2316 return E_NOTIMPL;
2319 static HRESULT WINAPI d3drm_frame1_SetSortMode(IDirect3DRMFrame *iface, D3DRMSORTMODE mode)
2321 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2323 return E_NOTIMPL;
2326 static HRESULT WINAPI d3drm_frame3_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture)
2328 FIXME("iface %p, texture %p stub!\n", iface, texture);
2330 return E_NOTIMPL;
2333 static HRESULT WINAPI d3drm_frame2_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
2335 FIXME("iface %p, texture %p stub!\n", iface, texture);
2337 return E_NOTIMPL;
2340 static HRESULT WINAPI d3drm_frame1_SetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture *texture)
2342 FIXME("iface %p, texture %p stub!\n", iface, texture);
2344 return E_NOTIMPL;
2347 static HRESULT WINAPI d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2 *iface, BOOL wrap_u, BOOL wrap_v)
2349 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2351 return E_NOTIMPL;
2354 static HRESULT WINAPI d3drm_frame1_SetTextureTopology(IDirect3DRMFrame *iface, BOOL wrap_u, BOOL wrap_v)
2356 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2358 return E_NOTIMPL;
2361 static HRESULT WINAPI d3drm_frame3_SetVelocity(IDirect3DRMFrame3 *iface,
2362 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2364 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
2365 iface, reference, x, y, z, with_rotation);
2367 return E_NOTIMPL;
2370 static HRESULT WINAPI d3drm_frame2_SetVelocity(IDirect3DRMFrame2 *iface,
2371 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2373 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2374 iface, reference, x, y, z, with_rotation);
2376 return E_NOTIMPL;
2379 static HRESULT WINAPI d3drm_frame1_SetVelocity(IDirect3DRMFrame *iface,
2380 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2382 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2383 iface, reference, x, y, z, with_rotation);
2385 return E_NOTIMPL;
2388 static HRESULT WINAPI d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3 *iface, D3DRMZBUFFERMODE mode)
2390 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2392 return E_NOTIMPL;
2395 static HRESULT WINAPI d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2 *iface, D3DRMZBUFFERMODE mode)
2397 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2399 return E_NOTIMPL;
2402 static HRESULT WINAPI d3drm_frame1_SetZbufferMode(IDirect3DRMFrame *iface, D3DRMZBUFFERMODE mode)
2404 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2406 return E_NOTIMPL;
2409 static HRESULT WINAPI d3drm_frame3_Transform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
2411 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2413 return E_NOTIMPL;
2416 static HRESULT WINAPI d3drm_frame2_Transform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
2418 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2420 return E_NOTIMPL;
2423 static HRESULT WINAPI d3drm_frame1_Transform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
2425 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2427 return E_NOTIMPL;
2430 static HRESULT WINAPI d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2 *iface,
2431 D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags)
2433 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags);
2435 return E_NOTIMPL;
2438 static HRESULT WINAPI d3drm_frame3_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2440 FIXME("iface %p, box %p stub!\n", iface, box);
2442 return E_NOTIMPL;
2445 static HRESULT WINAPI d3drm_frame2_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2447 FIXME("iface %p, box %p stub!\n", iface, box);
2449 return E_NOTIMPL;
2452 static BOOL WINAPI d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3 *iface)
2454 FIXME("iface %p stub!\n", iface);
2456 return FALSE;
2459 static BOOL WINAPI d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2 *iface)
2461 FIXME("iface %p stub!\n", iface);
2463 return FALSE;
2466 static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2468 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2470 return E_NOTIMPL;
2473 static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2475 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2477 return E_NOTIMPL;
2480 static HRESULT WINAPI d3drm_frame3_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material)
2482 FIXME("iface %p, material %p stub!\n", iface, material);
2484 return E_NOTIMPL;
2487 static HRESULT WINAPI d3drm_frame2_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
2489 FIXME("iface %p, material %p stub!\n", iface, material);
2491 return E_NOTIMPL;
2494 static BOOL WINAPI d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3 *iface)
2496 FIXME("iface %p stub!\n", iface);
2498 return FALSE;
2501 static BOOL WINAPI d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2 *iface)
2503 FIXME("iface %p stub!\n", iface);
2505 return FALSE;
2508 static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2510 FIXME("iface %p, box %p stub!\n", iface, box);
2512 return E_NOTIMPL;
2515 static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2517 FIXME("iface %p, box %p stub!\n", iface, box);
2519 return E_NOTIMPL;
2522 static HRESULT WINAPI d3drm_frame3_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2524 FIXME("iface %p, box %p stub!\n", iface, box);
2526 return E_NOTIMPL;
2529 static HRESULT WINAPI d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2531 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2533 return E_NOTIMPL;
2536 static HRESULT WINAPI d3drm_frame3_SetAxes(IDirect3DRMFrame3 *iface,
2537 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2539 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2540 iface, dx, dy, dz, ux, uy, uz);
2542 return E_NOTIMPL;
2545 static HRESULT WINAPI d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3 *iface, BOOL inherit)
2547 FIXME("iface %p, inherit %#x stub!\n", iface, inherit);
2549 return E_NOTIMPL;
2552 static HRESULT WINAPI d3drm_frame3_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material)
2554 FIXME("iface %p, material %p stub!\n", iface, material);
2556 return E_NOTIMPL;
2559 static HRESULT WINAPI d3drm_frame3_SetQuaternion(IDirect3DRMFrame3 *iface,
2560 IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q)
2562 FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q);
2564 return E_NOTIMPL;
2567 static HRESULT WINAPI d3drm_frame3_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2568 D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **visuals)
2570 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2571 iface, reference, ray, flags, visuals);
2573 return E_NOTIMPL;
2576 static HRESULT WINAPI d3drm_frame3_Save(IDirect3DRMFrame3 *iface,
2577 const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags)
2579 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2580 iface, debugstr_a(filename), format, flags);
2582 return E_NOTIMPL;
2585 static HRESULT WINAPI d3drm_frame3_TransformVectors(IDirect3DRMFrame3 *iface,
2586 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2588 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2590 return E_NOTIMPL;
2593 static HRESULT WINAPI d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3 *iface,
2594 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2596 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2598 return E_NOTIMPL;
2601 static HRESULT WINAPI d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD flags)
2603 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2605 return E_NOTIMPL;
2608 static HRESULT WINAPI d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *flags)
2610 FIXME("iface %p, flags %p stub!\n", iface, flags);
2612 return E_NOTIMPL;
2615 static HRESULT WINAPI d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD flags)
2617 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2619 return E_NOTIMPL;
2622 static HRESULT WINAPI d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode)
2624 FIXME("iface %p, fog_mode %p stub!\n", iface, fog_mode);
2626 return E_NOTIMPL;
2629 static HRESULT WINAPI d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3 *iface,
2630 D3DRMMATERIALOVERRIDE *override)
2632 FIXME("iface %p, override %p stub!\n", iface, override);
2634 return E_NOTIMPL;
2637 static HRESULT WINAPI d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3 *iface,
2638 D3DRMMATERIALOVERRIDE *override)
2640 FIXME("iface %p, override %p stub!\n", iface, override);
2642 return E_NOTIMPL;
2645 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl =
2647 d3drm_frame3_QueryInterface,
2648 d3drm_frame3_AddRef,
2649 d3drm_frame3_Release,
2650 d3drm_frame3_Clone,
2651 d3drm_frame3_AddDestroyCallback,
2652 d3drm_frame3_DeleteDestroyCallback,
2653 d3drm_frame3_SetAppData,
2654 d3drm_frame3_GetAppData,
2655 d3drm_frame3_SetName,
2656 d3drm_frame3_GetName,
2657 d3drm_frame3_GetClassName,
2658 d3drm_frame3_AddChild,
2659 d3drm_frame3_AddLight,
2660 d3drm_frame3_AddMoveCallback,
2661 d3drm_frame3_AddTransform,
2662 d3drm_frame3_AddTranslation,
2663 d3drm_frame3_AddScale,
2664 d3drm_frame3_AddRotation,
2665 d3drm_frame3_AddVisual,
2666 d3drm_frame3_GetChildren,
2667 d3drm_frame3_GetColor,
2668 d3drm_frame3_GetLights,
2669 d3drm_frame3_GetMaterialMode,
2670 d3drm_frame3_GetParent,
2671 d3drm_frame3_GetPosition,
2672 d3drm_frame3_GetRotation,
2673 d3drm_frame3_GetScene,
2674 d3drm_frame3_GetSortMode,
2675 d3drm_frame3_GetTexture,
2676 d3drm_frame3_GetTransform,
2677 d3drm_frame3_GetVelocity,
2678 d3drm_frame3_GetOrientation,
2679 d3drm_frame3_GetVisuals,
2680 d3drm_frame3_InverseTransform,
2681 d3drm_frame3_Load,
2682 d3drm_frame3_LookAt,
2683 d3drm_frame3_Move,
2684 d3drm_frame3_DeleteChild,
2685 d3drm_frame3_DeleteLight,
2686 d3drm_frame3_DeleteMoveCallback,
2687 d3drm_frame3_DeleteVisual,
2688 d3drm_frame3_GetSceneBackground,
2689 d3drm_frame3_GetSceneBackgroundDepth,
2690 d3drm_frame3_GetSceneFogColor,
2691 d3drm_frame3_GetSceneFogEnable,
2692 d3drm_frame3_GetSceneFogMode,
2693 d3drm_frame3_GetSceneFogParams,
2694 d3drm_frame3_SetSceneBackground,
2695 d3drm_frame3_SetSceneBackgroundRGB,
2696 d3drm_frame3_SetSceneBackgroundDepth,
2697 d3drm_frame3_SetSceneBackgroundImage,
2698 d3drm_frame3_SetSceneFogEnable,
2699 d3drm_frame3_SetSceneFogColor,
2700 d3drm_frame3_SetSceneFogMode,
2701 d3drm_frame3_SetSceneFogParams,
2702 d3drm_frame3_SetColor,
2703 d3drm_frame3_SetColorRGB,
2704 d3drm_frame3_GetZbufferMode,
2705 d3drm_frame3_SetMaterialMode,
2706 d3drm_frame3_SetOrientation,
2707 d3drm_frame3_SetPosition,
2708 d3drm_frame3_SetRotation,
2709 d3drm_frame3_SetSortMode,
2710 d3drm_frame3_SetTexture,
2711 d3drm_frame3_SetVelocity,
2712 d3drm_frame3_SetZbufferMode,
2713 d3drm_frame3_Transform,
2714 d3drm_frame3_GetBox,
2715 d3drm_frame3_GetBoxEnable,
2716 d3drm_frame3_GetAxes,
2717 d3drm_frame3_GetMaterial,
2718 d3drm_frame3_GetInheritAxes,
2719 d3drm_frame3_GetHierarchyBox,
2720 d3drm_frame3_SetBox,
2721 d3drm_frame3_SetBoxEnable,
2722 d3drm_frame3_SetAxes,
2723 d3drm_frame3_SetInheritAxes,
2724 d3drm_frame3_SetMaterial,
2725 d3drm_frame3_SetQuaternion,
2726 d3drm_frame3_RayPick,
2727 d3drm_frame3_Save,
2728 d3drm_frame3_TransformVectors,
2729 d3drm_frame3_InverseTransformVectors,
2730 d3drm_frame3_SetTraversalOptions,
2731 d3drm_frame3_GetTraversalOptions,
2732 d3drm_frame3_SetSceneFogMethod,
2733 d3drm_frame3_GetSceneFogMethod,
2734 d3drm_frame3_SetMaterialOverride,
2735 d3drm_frame3_GetMaterialOverride,
2738 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl =
2740 d3drm_frame2_QueryInterface,
2741 d3drm_frame2_AddRef,
2742 d3drm_frame2_Release,
2743 d3drm_frame2_Clone,
2744 d3drm_frame2_AddDestroyCallback,
2745 d3drm_frame2_DeleteDestroyCallback,
2746 d3drm_frame2_SetAppData,
2747 d3drm_frame2_GetAppData,
2748 d3drm_frame2_SetName,
2749 d3drm_frame2_GetName,
2750 d3drm_frame2_GetClassName,
2751 d3drm_frame2_AddChild,
2752 d3drm_frame2_AddLight,
2753 d3drm_frame2_AddMoveCallback,
2754 d3drm_frame2_AddTransform,
2755 d3drm_frame2_AddTranslation,
2756 d3drm_frame2_AddScale,
2757 d3drm_frame2_AddRotation,
2758 d3drm_frame2_AddVisual,
2759 d3drm_frame2_GetChildren,
2760 d3drm_frame2_GetColor,
2761 d3drm_frame2_GetLights,
2762 d3drm_frame2_GetMaterialMode,
2763 d3drm_frame2_GetParent,
2764 d3drm_frame2_GetPosition,
2765 d3drm_frame2_GetRotation,
2766 d3drm_frame2_GetScene,
2767 d3drm_frame2_GetSortMode,
2768 d3drm_frame2_GetTexture,
2769 d3drm_frame2_GetTransform,
2770 d3drm_frame2_GetVelocity,
2771 d3drm_frame2_GetOrientation,
2772 d3drm_frame2_GetVisuals,
2773 d3drm_frame2_GetTextureTopology,
2774 d3drm_frame2_InverseTransform,
2775 d3drm_frame2_Load,
2776 d3drm_frame2_LookAt,
2777 d3drm_frame2_Move,
2778 d3drm_frame2_DeleteChild,
2779 d3drm_frame2_DeleteLight,
2780 d3drm_frame2_DeleteMoveCallback,
2781 d3drm_frame2_DeleteVisual,
2782 d3drm_frame2_GetSceneBackground,
2783 d3drm_frame2_GetSceneBackgroundDepth,
2784 d3drm_frame2_GetSceneFogColor,
2785 d3drm_frame2_GetSceneFogEnable,
2786 d3drm_frame2_GetSceneFogMode,
2787 d3drm_frame2_GetSceneFogParams,
2788 d3drm_frame2_SetSceneBackground,
2789 d3drm_frame2_SetSceneBackgroundRGB,
2790 d3drm_frame2_SetSceneBackgroundDepth,
2791 d3drm_frame2_SetSceneBackgroundImage,
2792 d3drm_frame2_SetSceneFogEnable,
2793 d3drm_frame2_SetSceneFogColor,
2794 d3drm_frame2_SetSceneFogMode,
2795 d3drm_frame2_SetSceneFogParams,
2796 d3drm_frame2_SetColor,
2797 d3drm_frame2_SetColorRGB,
2798 d3drm_frame2_GetZbufferMode,
2799 d3drm_frame2_SetMaterialMode,
2800 d3drm_frame2_SetOrientation,
2801 d3drm_frame2_SetPosition,
2802 d3drm_frame2_SetRotation,
2803 d3drm_frame2_SetSortMode,
2804 d3drm_frame2_SetTexture,
2805 d3drm_frame2_SetTextureTopology,
2806 d3drm_frame2_SetVelocity,
2807 d3drm_frame2_SetZbufferMode,
2808 d3drm_frame2_Transform,
2809 d3drm_frame2_AddMoveCallback2,
2810 d3drm_frame2_GetBox,
2811 d3drm_frame2_GetBoxEnable,
2812 d3drm_frame2_GetAxes,
2813 d3drm_frame2_GetMaterial,
2814 d3drm_frame2_GetInheritAxes,
2815 d3drm_frame2_GetHierarchyBox,
2818 static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl =
2820 d3drm_frame1_QueryInterface,
2821 d3drm_frame1_AddRef,
2822 d3drm_frame1_Release,
2823 d3drm_frame1_Clone,
2824 d3drm_frame1_AddDestroyCallback,
2825 d3drm_frame1_DeleteDestroyCallback,
2826 d3drm_frame1_SetAppData,
2827 d3drm_frame1_GetAppData,
2828 d3drm_frame1_SetName,
2829 d3drm_frame1_GetName,
2830 d3drm_frame1_GetClassName,
2831 d3drm_frame1_AddChild,
2832 d3drm_frame1_AddLight,
2833 d3drm_frame1_AddMoveCallback,
2834 d3drm_frame1_AddTransform,
2835 d3drm_frame1_AddTranslation,
2836 d3drm_frame1_AddScale,
2837 d3drm_frame1_AddRotation,
2838 d3drm_frame1_AddVisual,
2839 d3drm_frame1_GetChildren,
2840 d3drm_frame1_GetColor,
2841 d3drm_frame1_GetLights,
2842 d3drm_frame1_GetMaterialMode,
2843 d3drm_frame1_GetParent,
2844 d3drm_frame1_GetPosition,
2845 d3drm_frame1_GetRotation,
2846 d3drm_frame1_GetScene,
2847 d3drm_frame1_GetSortMode,
2848 d3drm_frame1_GetTexture,
2849 d3drm_frame1_GetTransform,
2850 d3drm_frame1_GetVelocity,
2851 d3drm_frame1_GetOrientation,
2852 d3drm_frame1_GetVisuals,
2853 d3drm_frame1_GetTextureTopology,
2854 d3drm_frame1_InverseTransform,
2855 d3drm_frame1_Load,
2856 d3drm_frame1_LookAt,
2857 d3drm_frame1_Move,
2858 d3drm_frame1_DeleteChild,
2859 d3drm_frame1_DeleteLight,
2860 d3drm_frame1_DeleteMoveCallback,
2861 d3drm_frame1_DeleteVisual,
2862 d3drm_frame1_GetSceneBackground,
2863 d3drm_frame1_GetSceneBackgroundDepth,
2864 d3drm_frame1_GetSceneFogColor,
2865 d3drm_frame1_GetSceneFogEnable,
2866 d3drm_frame1_GetSceneFogMode,
2867 d3drm_frame1_GetSceneFogParams,
2868 d3drm_frame1_SetSceneBackground,
2869 d3drm_frame1_SetSceneBackgroundRGB,
2870 d3drm_frame1_SetSceneBackgroundDepth,
2871 d3drm_frame1_SetSceneBackgroundImage,
2872 d3drm_frame1_SetSceneFogEnable,
2873 d3drm_frame1_SetSceneFogColor,
2874 d3drm_frame1_SetSceneFogMode,
2875 d3drm_frame1_SetSceneFogParams,
2876 d3drm_frame1_SetColor,
2877 d3drm_frame1_SetColorRGB,
2878 d3drm_frame1_GetZbufferMode,
2879 d3drm_frame1_SetMaterialMode,
2880 d3drm_frame1_SetOrientation,
2881 d3drm_frame1_SetPosition,
2882 d3drm_frame1_SetRotation,
2883 d3drm_frame1_SetSortMode,
2884 d3drm_frame1_SetTexture,
2885 d3drm_frame1_SetTextureTopology,
2886 d3drm_frame1_SetVelocity,
2887 d3drm_frame1_SetZbufferMode,
2888 d3drm_frame1_Transform,
2891 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2893 if (!iface)
2894 return NULL;
2895 assert(iface->lpVtbl == &d3drm_frame3_vtbl);
2897 return impl_from_IDirect3DRMFrame3(iface);
2900 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
2902 if (!iface)
2903 return NULL;
2904 assert(iface->lpVtbl == &d3drm_frame1_vtbl);
2906 return impl_from_IDirect3DRMFrame(iface);
2909 HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm)
2911 struct d3drm_frame *object;
2912 HRESULT hr = D3DRM_OK;
2914 TRACE("frame %p, parent_frame %p, d3drm %p.\n", frame, parent_frame, d3drm);
2916 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
2917 return E_OUTOFMEMORY;
2919 object->IDirect3DRMFrame_iface.lpVtbl = &d3drm_frame1_vtbl;
2920 object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
2921 object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
2922 object->d3drm = d3drm;
2923 object->ref = 1;
2924 object->scenebackground = RGBA_MAKE(0, 0, 0, 0xff);
2926 memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2928 if (parent_frame)
2930 IDirect3DRMFrame3 *p;
2932 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&p)))
2934 HeapFree(GetProcessHeap(), 0, object);
2935 return hr;
2937 IDirect3DRMFrame_Release(parent_frame);
2938 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
2941 *frame = object;
2943 return hr;