wined3d: Only set GL_DEPTH_TEXTURE_MODE_ARB if ARB_depth_texture is supported.
[wine.git] / dlls / d3drm / frame.c
blobf20040bb79008981a219a8c1cd8555c3cebf2e8c
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 return IDirect3DRMFrame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
476 static ULONG WINAPI d3drm_frame2_AddRef(IDirect3DRMFrame2 *iface)
478 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
480 TRACE("iface %p.\n", iface);
482 return IDirect3DRMFrame3_AddRef(&frame->IDirect3DRMFrame3_iface);
485 static ULONG WINAPI d3drm_frame2_Release(IDirect3DRMFrame2 *iface)
487 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
489 TRACE("iface %p.\n", iface);
491 return IDirect3DRMFrame3_Release(&frame->IDirect3DRMFrame3_iface);
494 static HRESULT WINAPI d3drm_frame2_Clone(IDirect3DRMFrame2 *iface,
495 IUnknown *outer, REFIID iid, void **out)
497 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
499 return E_NOTIMPL;
502 static HRESULT WINAPI d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2 *iface,
503 D3DRMOBJECTCALLBACK cb, void *ctx)
505 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
507 return E_NOTIMPL;
510 static HRESULT WINAPI d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2 *iface,
511 D3DRMOBJECTCALLBACK cb, void *ctx)
513 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
515 return E_NOTIMPL;
518 static HRESULT WINAPI d3drm_frame2_SetAppData(IDirect3DRMFrame2 *iface, DWORD data)
520 FIXME("iface %p, data %#x stub!\n", iface, data);
522 return E_NOTIMPL;
525 static DWORD WINAPI d3drm_frame2_GetAppData(IDirect3DRMFrame2 *iface)
527 FIXME("iface %p stub!\n", iface);
529 return 0;
532 static HRESULT WINAPI d3drm_frame2_SetName(IDirect3DRMFrame2 *iface, const char *name)
534 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
536 return E_NOTIMPL;
539 static HRESULT WINAPI d3drm_frame2_GetName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
541 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
543 return E_NOTIMPL;
546 static HRESULT WINAPI d3drm_frame2_GetClassName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
548 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
550 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
552 return IDirect3DRMFrame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
555 static HRESULT WINAPI d3drm_frame2_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
557 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
558 IDirect3DRMFrame3 *child3;
559 HRESULT hr;
561 TRACE("iface %p, child %p.\n", iface, child);
563 if (!child)
564 return D3DRMERR_BADOBJECT;
565 hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3);
566 if (hr != S_OK)
567 return D3DRMERR_BADOBJECT;
568 IDirect3DRMFrame_Release(child);
570 return IDirect3DRMFrame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3);
573 static HRESULT WINAPI d3drm_frame2_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
575 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
577 TRACE("iface %p, light %p.\n", iface, light);
579 return IDirect3DRMFrame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
582 static HRESULT WINAPI d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2 *iface,
583 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
585 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
587 return E_NOTIMPL;
590 static HRESULT WINAPI d3drm_frame2_AddTransform(IDirect3DRMFrame2 *iface, D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
592 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
594 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
596 return IDirect3DRMFrame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
599 static HRESULT WINAPI d3drm_frame2_AddTranslation(IDirect3DRMFrame2 *iface,
600 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
602 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
604 return E_NOTIMPL;
607 static HRESULT WINAPI d3drm_frame2_AddScale(IDirect3DRMFrame2 *iface,
608 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
610 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
612 return E_NOTIMPL;
615 static HRESULT WINAPI d3drm_frame2_AddRotation(IDirect3DRMFrame2 *iface,
616 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
618 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
620 return E_NOTIMPL;
623 static HRESULT WINAPI d3drm_frame2_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
625 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
627 TRACE("iface %p, visual %p.\n", iface, visual);
629 return IDirect3DRMFrame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
632 static HRESULT WINAPI d3drm_frame2_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children)
634 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
636 TRACE("iface %p, children %p.\n", iface, children);
638 return IDirect3DRMFrame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
641 static D3DCOLOR WINAPI d3drm_frame2_GetColor(IDirect3DRMFrame2 *iface)
643 FIXME("iface %p stub!\n", iface);
645 return 0;
648 static HRESULT WINAPI d3drm_frame2_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
650 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
652 TRACE("iface %p, lights %p.\n", iface, lights);
654 return IDirect3DRMFrame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
657 static D3DRMMATERIALMODE WINAPI d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2 *iface)
659 FIXME("iface %p stub!\n", iface);
661 return D3DRMMATERIAL_FROMPARENT;
664 static HRESULT WINAPI d3drm_frame2_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **parent)
666 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
668 TRACE("iface %p, parent %p.\n", iface, parent);
670 if (!parent)
671 return D3DRMERR_BADVALUE;
673 if (frame->parent)
675 *parent = (IDirect3DRMFrame *)&frame->parent->IDirect3DRMFrame2_iface;
676 IDirect3DRMFrame_AddRef(*parent);
678 else
680 *parent = NULL;
683 return D3DRM_OK;
686 static HRESULT WINAPI d3drm_frame2_GetPosition(IDirect3DRMFrame2 *iface,
687 IDirect3DRMFrame *reference, D3DVECTOR *position)
689 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
691 return E_NOTIMPL;
694 static HRESULT WINAPI d3drm_frame2_GetRotation(IDirect3DRMFrame2 *iface,
695 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
697 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
699 return E_NOTIMPL;
702 static HRESULT WINAPI d3drm_frame2_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene)
704 FIXME("iface %p, scene %p stub!\n", iface, scene);
706 return E_NOTIMPL;
709 static D3DRMSORTMODE WINAPI d3drm_frame2_GetSortMode(IDirect3DRMFrame2 *iface)
711 FIXME("iface %p stub!\n", iface);
713 return D3DRMSORT_FROMPARENT;
716 static HRESULT WINAPI d3drm_frame2_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture)
718 FIXME("iface %p, texture %p stub!\n", iface, texture);
720 return E_NOTIMPL;
723 static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix)
725 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
727 TRACE("iface %p, matrix %p.\n", iface, matrix);
729 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
731 return D3DRM_OK;
734 static HRESULT WINAPI d3drm_frame2_GetVelocity(IDirect3DRMFrame2 *iface,
735 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
737 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
738 iface, reference, velocity, with_rotation);
740 return E_NOTIMPL;
743 static HRESULT WINAPI d3drm_frame2_GetOrientation(IDirect3DRMFrame2 *iface,
744 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
746 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
748 return E_NOTIMPL;
751 static HRESULT WINAPI d3drm_frame2_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals)
753 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
754 struct d3drm_visual_array *array;
756 TRACE("iface %p, visuals %p.\n", iface, visuals);
758 if (!visuals)
759 return D3DRMERR_BADVALUE;
761 if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals)))
762 return E_OUTOFMEMORY;
764 *visuals = &array->IDirect3DRMVisualArray_iface;
766 return D3DRM_OK;
769 static HRESULT WINAPI d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2 *iface, BOOL *wrap_u, BOOL *wrap_v)
771 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
773 return E_NOTIMPL;
776 static HRESULT WINAPI d3drm_frame2_InverseTransform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
778 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
780 return E_NOTIMPL;
783 static HRESULT WINAPI d3drm_frame2_Load(IDirect3DRMFrame2 *iface, void *filename,
784 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
786 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
787 iface, filename, name, flags, cb, ctx);
789 return E_NOTIMPL;
792 static HRESULT WINAPI d3drm_frame2_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target,
793 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
795 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
797 return E_NOTIMPL;
800 static HRESULT WINAPI d3drm_frame2_Move(IDirect3DRMFrame2 *iface, D3DVALUE delta)
802 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
804 return E_NOTIMPL;
807 static HRESULT WINAPI d3drm_frame2_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
809 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
810 IDirect3DRMFrame3 *child3;
811 HRESULT hr;
813 TRACE("iface %p, child %p.\n", iface, child);
815 if (!child)
816 return D3DRMERR_BADOBJECT;
817 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3)))
818 return D3DRMERR_BADOBJECT;
819 IDirect3DRMFrame_Release(child);
821 return IDirect3DRMFrame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3);
824 static HRESULT WINAPI d3drm_frame2_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
826 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
828 TRACE("iface %p, light %p.\n", iface, light);
830 return IDirect3DRMFrame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
833 static HRESULT WINAPI d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2 *iface,
834 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
836 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
838 return E_NOTIMPL;
841 static HRESULT WINAPI d3drm_frame2_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
843 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
845 TRACE("iface %p, visual %p.\n", iface, visual);
847 return IDirect3DRMFrame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
850 static D3DCOLOR WINAPI d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2 *iface)
852 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
854 TRACE("iface %p.\n", iface);
856 return IDirect3DRMFrame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
859 static HRESULT WINAPI d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
860 IDirectDrawSurface **surface)
862 FIXME("iface %p, surface %p stub!\n", iface, surface);
864 return E_NOTIMPL;
867 static D3DCOLOR WINAPI d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2 *iface)
869 FIXME("iface %p stub!\n", iface);
871 return 0;
874 static BOOL WINAPI d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2 *iface)
876 FIXME("iface %p stub!\n", iface);
878 return FALSE;
881 static D3DRMFOGMODE WINAPI d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2 *iface)
883 FIXME("iface %p stub!\n", iface);
885 return D3DRMFOG_LINEAR;
888 static HRESULT WINAPI d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2 *iface,
889 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
891 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
893 return E_NOTIMPL;
896 static HRESULT WINAPI d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2 *iface, D3DCOLOR color)
898 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
900 TRACE("iface %p, color 0x%08x.\n", iface, color);
902 return IDirect3DRMFrame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
905 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2 *iface,
906 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
908 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
910 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
912 return IDirect3DRMFrame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
915 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface, IDirectDrawSurface *surface)
917 FIXME("iface %p, surface %p stub!\n", iface, surface);
919 return E_NOTIMPL;
922 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
924 FIXME("iface %p, texture %p stub!\n", iface, texture);
926 return E_NOTIMPL;
929 static HRESULT WINAPI d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2 *iface, BOOL enable)
931 FIXME("iface %p, enable %#x stub!\n", iface, enable);
933 return E_NOTIMPL;
936 static HRESULT WINAPI d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
938 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
940 return E_NOTIMPL;
943 static HRESULT WINAPI d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2 *iface, D3DRMFOGMODE mode)
945 FIXME("iface %p, mode %#x stub!\n", iface, mode);
947 return E_NOTIMPL;
950 static HRESULT WINAPI d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2 *iface,
951 D3DVALUE start, D3DVALUE end, D3DVALUE density)
953 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
955 return E_NOTIMPL;
958 static HRESULT WINAPI d3drm_frame2_SetColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
960 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
962 return E_NOTIMPL;
965 static HRESULT WINAPI d3drm_frame2_SetColorRGB(IDirect3DRMFrame2 *iface,
966 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
968 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
970 return E_NOTIMPL;
973 static D3DRMZBUFFERMODE WINAPI d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2 *iface)
975 FIXME("iface %p stub!\n", iface);
977 return D3DRMZBUFFER_FROMPARENT;
980 static HRESULT WINAPI d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2 *iface, D3DRMMATERIALMODE mode)
982 FIXME("iface %p, mode %#x stub!\n", iface, mode);
984 return E_NOTIMPL;
987 static HRESULT WINAPI d3drm_frame2_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
988 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
990 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
991 iface, reference, dx, dy, dz, ux, uy, uz);
993 return E_NOTIMPL;
996 static HRESULT WINAPI d3drm_frame2_SetPosition(IDirect3DRMFrame2 *iface,
997 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
999 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
1001 return E_NOTIMPL;
1004 static HRESULT WINAPI d3drm_frame2_SetRotation(IDirect3DRMFrame2 *iface,
1005 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1007 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1008 iface, reference, x, y, z, theta);
1010 return E_NOTIMPL;
1013 static HRESULT WINAPI d3drm_frame2_SetSortMode(IDirect3DRMFrame2 *iface, D3DRMSORTMODE mode)
1015 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1017 return E_NOTIMPL;
1020 static HRESULT WINAPI d3drm_frame2_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
1022 FIXME("iface %p, texture %p stub!\n", iface, texture);
1024 return E_NOTIMPL;
1027 static HRESULT WINAPI d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2 *iface, BOOL wrap_u, BOOL wrap_v)
1029 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
1031 return E_NOTIMPL;
1034 static HRESULT WINAPI d3drm_frame2_SetVelocity(IDirect3DRMFrame2 *iface,
1035 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
1037 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
1038 iface, reference, x, y, z, with_rotation);
1040 return E_NOTIMPL;
1043 static HRESULT WINAPI d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2 *iface, D3DRMZBUFFERMODE mode)
1045 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1047 return E_NOTIMPL;
1050 static HRESULT WINAPI d3drm_frame2_Transform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
1052 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1054 return E_NOTIMPL;
1057 static HRESULT WINAPI d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2 *iface,
1058 D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags)
1060 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags);
1062 return E_NOTIMPL;
1065 static HRESULT WINAPI d3drm_frame2_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
1067 FIXME("iface %p, box %p stub!\n", iface, box);
1069 return E_NOTIMPL;
1072 static BOOL WINAPI d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2 *iface)
1074 FIXME("iface %p stub!\n", iface);
1076 return FALSE;
1079 static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up)
1081 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
1083 return E_NOTIMPL;
1086 static HRESULT WINAPI d3drm_frame2_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
1088 FIXME("iface %p, material %p stub!\n", iface, material);
1090 return E_NOTIMPL;
1093 static BOOL WINAPI d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2 *iface)
1095 FIXME("iface %p stub!\n", iface);
1097 return FALSE;
1100 static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
1102 FIXME("iface %p, box %p stub!\n", iface, box);
1104 return E_NOTIMPL;
1107 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl =
1109 d3drm_frame2_QueryInterface,
1110 d3drm_frame2_AddRef,
1111 d3drm_frame2_Release,
1112 d3drm_frame2_Clone,
1113 d3drm_frame2_AddDestroyCallback,
1114 d3drm_frame2_DeleteDestroyCallback,
1115 d3drm_frame2_SetAppData,
1116 d3drm_frame2_GetAppData,
1117 d3drm_frame2_SetName,
1118 d3drm_frame2_GetName,
1119 d3drm_frame2_GetClassName,
1120 d3drm_frame2_AddChild,
1121 d3drm_frame2_AddLight,
1122 d3drm_frame2_AddMoveCallback,
1123 d3drm_frame2_AddTransform,
1124 d3drm_frame2_AddTranslation,
1125 d3drm_frame2_AddScale,
1126 d3drm_frame2_AddRotation,
1127 d3drm_frame2_AddVisual,
1128 d3drm_frame2_GetChildren,
1129 d3drm_frame2_GetColor,
1130 d3drm_frame2_GetLights,
1131 d3drm_frame2_GetMaterialMode,
1132 d3drm_frame2_GetParent,
1133 d3drm_frame2_GetPosition,
1134 d3drm_frame2_GetRotation,
1135 d3drm_frame2_GetScene,
1136 d3drm_frame2_GetSortMode,
1137 d3drm_frame2_GetTexture,
1138 d3drm_frame2_GetTransform,
1139 d3drm_frame2_GetVelocity,
1140 d3drm_frame2_GetOrientation,
1141 d3drm_frame2_GetVisuals,
1142 d3drm_frame2_GetTextureTopology,
1143 d3drm_frame2_InverseTransform,
1144 d3drm_frame2_Load,
1145 d3drm_frame2_LookAt,
1146 d3drm_frame2_Move,
1147 d3drm_frame2_DeleteChild,
1148 d3drm_frame2_DeleteLight,
1149 d3drm_frame2_DeleteMoveCallback,
1150 d3drm_frame2_DeleteVisual,
1151 d3drm_frame2_GetSceneBackground,
1152 d3drm_frame2_GetSceneBackgroundDepth,
1153 d3drm_frame2_GetSceneFogColor,
1154 d3drm_frame2_GetSceneFogEnable,
1155 d3drm_frame2_GetSceneFogMode,
1156 d3drm_frame2_GetSceneFogParams,
1157 d3drm_frame2_SetSceneBackground,
1158 d3drm_frame2_SetSceneBackgroundRGB,
1159 d3drm_frame2_SetSceneBackgroundDepth,
1160 d3drm_frame2_SetSceneBackgroundImage,
1161 d3drm_frame2_SetSceneFogEnable,
1162 d3drm_frame2_SetSceneFogColor,
1163 d3drm_frame2_SetSceneFogMode,
1164 d3drm_frame2_SetSceneFogParams,
1165 d3drm_frame2_SetColor,
1166 d3drm_frame2_SetColorRGB,
1167 d3drm_frame2_GetZbufferMode,
1168 d3drm_frame2_SetMaterialMode,
1169 d3drm_frame2_SetOrientation,
1170 d3drm_frame2_SetPosition,
1171 d3drm_frame2_SetRotation,
1172 d3drm_frame2_SetSortMode,
1173 d3drm_frame2_SetTexture,
1174 d3drm_frame2_SetTextureTopology,
1175 d3drm_frame2_SetVelocity,
1176 d3drm_frame2_SetZbufferMode,
1177 d3drm_frame2_Transform,
1178 d3drm_frame2_AddMoveCallback2,
1179 d3drm_frame2_GetBox,
1180 d3drm_frame2_GetBoxEnable,
1181 d3drm_frame2_GetAxes,
1182 d3drm_frame2_GetMaterial,
1183 d3drm_frame2_GetInheritAxes,
1184 d3drm_frame2_GetHierarchyBox,
1187 static HRESULT WINAPI d3drm_frame3_QueryInterface(IDirect3DRMFrame3 *iface, REFIID riid, void **out)
1189 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1191 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
1193 if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2)
1194 || IsEqualGUID(riid, &IID_IDirect3DRMFrame)
1195 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
1196 || IsEqualGUID(riid, &IID_IDirect3DRMVisual)
1197 || IsEqualGUID(riid, &IID_IUnknown))
1199 *out = &frame->IDirect3DRMFrame2_iface;
1201 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
1203 *out = &frame->IDirect3DRMFrame3_iface;
1205 else
1207 *out = NULL;
1208 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
1209 return CLASS_E_CLASSNOTAVAILABLE;
1212 IUnknown_AddRef((IUnknown *)*out);
1213 return S_OK;
1216 static ULONG WINAPI d3drm_frame3_AddRef(IDirect3DRMFrame3 *iface)
1218 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1219 ULONG refcount = InterlockedIncrement(&frame->ref);
1221 TRACE("%p increasing refcount to %u.\n", iface, refcount);
1223 return refcount;
1226 static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface)
1228 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1229 ULONG refcount = InterlockedDecrement(&frame->ref);
1230 ULONG i;
1232 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
1234 if (!refcount)
1236 for (i = 0; i < frame->nb_children; ++i)
1238 IDirect3DRMFrame3_Release(frame->children[i]);
1240 HeapFree(GetProcessHeap(), 0, frame->children);
1241 for (i = 0; i < frame->nb_visuals; ++i)
1243 IDirect3DRMVisual_Release(frame->visuals[i]);
1245 HeapFree(GetProcessHeap(), 0, frame->visuals);
1246 for (i = 0; i < frame->nb_lights; ++i)
1248 IDirect3DRMLight_Release(frame->lights[i]);
1250 HeapFree(GetProcessHeap(), 0, frame->lights);
1251 HeapFree(GetProcessHeap(), 0, frame);
1254 return refcount;
1257 static HRESULT WINAPI d3drm_frame3_Clone(IDirect3DRMFrame3 *iface,
1258 IUnknown *outer, REFIID iid, void **out)
1260 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
1262 return E_NOTIMPL;
1265 static HRESULT WINAPI d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3 *iface,
1266 D3DRMOBJECTCALLBACK cb, void *ctx)
1268 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1270 return E_NOTIMPL;
1273 static HRESULT WINAPI d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3 *iface,
1274 D3DRMOBJECTCALLBACK cb, void *ctx)
1276 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1278 return E_NOTIMPL;
1281 static HRESULT WINAPI d3drm_frame3_SetAppData(IDirect3DRMFrame3 *iface, DWORD data)
1283 FIXME("iface %p, data %#x stub!\n", iface, data);
1285 return E_NOTIMPL;
1288 static DWORD WINAPI d3drm_frame3_GetAppData(IDirect3DRMFrame3 *iface)
1290 FIXME("iface %p stub!\n", iface);
1292 return 0;
1295 static HRESULT WINAPI d3drm_frame3_SetName(IDirect3DRMFrame3 *iface, const char *name)
1297 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1299 return E_NOTIMPL;
1302 static HRESULT WINAPI d3drm_frame3_GetName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
1304 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
1306 return E_NOTIMPL;
1309 static HRESULT WINAPI d3drm_frame3_GetClassName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
1311 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
1313 if (!size || *size < strlen("Frame") || !name)
1314 return E_INVALIDARG;
1316 strcpy(name, "Frame");
1317 *size = sizeof("Frame");
1319 return D3DRM_OK;
1322 static HRESULT WINAPI d3drm_frame3_AddChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1324 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1325 struct d3drm_frame *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child);
1327 TRACE("iface %p, child %p.\n", iface, child);
1329 if (!child_obj)
1330 return D3DRMERR_BADOBJECT;
1332 if (child_obj->parent)
1334 IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface;
1336 if (parent == iface)
1338 /* Passed frame is already a child so return success */
1339 return D3DRM_OK;
1341 else
1343 /* Remove parent and continue */
1344 IDirect3DRMFrame3_DeleteChild(parent, child);
1348 if ((This->nb_children + 1) > This->children_capacity)
1350 ULONG new_capacity;
1351 IDirect3DRMFrame3** children;
1353 if (!This->children_capacity)
1355 new_capacity = 16;
1356 children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*));
1358 else
1360 new_capacity = This->children_capacity * 2;
1361 children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*));
1364 if (!children)
1365 return E_OUTOFMEMORY;
1367 This->children_capacity = new_capacity;
1368 This->children = children;
1371 This->children[This->nb_children++] = child;
1372 IDirect3DRMFrame3_AddRef(child);
1373 child_obj->parent = This;
1375 return D3DRM_OK;
1378 static HRESULT WINAPI d3drm_frame3_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1380 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1381 ULONG i;
1382 IDirect3DRMLight** lights;
1384 TRACE("iface %p, light %p.\n", iface, light);
1386 if (!light)
1387 return D3DRMERR_BADOBJECT;
1389 /* Check if already existing and return gracefully without increasing ref count */
1390 for (i = 0; i < This->nb_lights; i++)
1391 if (This->lights[i] == light)
1392 return D3DRM_OK;
1394 if ((This->nb_lights + 1) > This->lights_capacity)
1396 ULONG new_capacity;
1398 if (!This->lights_capacity)
1400 new_capacity = 16;
1401 lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*));
1403 else
1405 new_capacity = This->lights_capacity * 2;
1406 lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*));
1409 if (!lights)
1410 return E_OUTOFMEMORY;
1412 This->lights_capacity = new_capacity;
1413 This->lights = lights;
1416 This->lights[This->nb_lights++] = light;
1417 IDirect3DRMLight_AddRef(light);
1419 return D3DRM_OK;
1422 static HRESULT WINAPI d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3 *iface,
1423 D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags)
1425 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags);
1427 return E_NOTIMPL;
1430 static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface,
1431 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
1433 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1435 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
1437 switch (type)
1439 case D3DRMCOMBINE_REPLACE:
1440 memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D));
1441 break;
1443 case D3DRMCOMBINE_BEFORE:
1444 FIXME("D3DRMCOMBINE_BEFORE not supported yet\n");
1445 break;
1447 case D3DRMCOMBINE_AFTER:
1448 FIXME("D3DRMCOMBINE_AFTER not supported yet\n");
1449 break;
1451 default:
1452 WARN("Unknown Combine Type %u\n", type);
1453 return D3DRMERR_BADVALUE;
1456 return S_OK;
1459 static HRESULT WINAPI d3drm_frame3_AddTranslation(IDirect3DRMFrame3 *iface,
1460 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1462 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1464 return E_NOTIMPL;
1467 static HRESULT WINAPI d3drm_frame3_AddScale(IDirect3DRMFrame3 *iface,
1468 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1470 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1472 return E_NOTIMPL;
1475 static HRESULT WINAPI d3drm_frame3_AddRotation(IDirect3DRMFrame3 *iface,
1476 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1478 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1479 iface, type, x, y, z, theta);
1481 return E_NOTIMPL;
1484 static HRESULT WINAPI d3drm_frame3_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1486 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1487 ULONG i;
1488 IDirect3DRMVisual** visuals;
1490 TRACE("iface %p, visual %p.\n", iface, visual);
1492 if (!visual)
1493 return D3DRMERR_BADOBJECT;
1495 /* Check if already existing and return gracefully without increasing ref count */
1496 for (i = 0; i < This->nb_visuals; i++)
1497 if (This->visuals[i] == (IDirect3DRMVisual *)visual)
1498 return D3DRM_OK;
1500 if ((This->nb_visuals + 1) > This->visuals_capacity)
1502 ULONG new_capacity;
1504 if (!This->visuals_capacity)
1506 new_capacity = 16;
1507 visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*));
1509 else
1511 new_capacity = This->visuals_capacity * 2;
1512 visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*));
1515 if (!visuals)
1516 return E_OUTOFMEMORY;
1518 This->visuals_capacity = new_capacity;
1519 This->visuals = visuals;
1522 This->visuals[This->nb_visuals++] = (IDirect3DRMVisual *)visual;
1523 IDirect3DRMVisual_AddRef(visual);
1525 return D3DRM_OK;
1528 static HRESULT WINAPI d3drm_frame3_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children)
1530 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1531 struct d3drm_frame_array *array;
1533 TRACE("iface %p, children %p.\n", iface, children);
1535 if (!children)
1536 return D3DRMERR_BADVALUE;
1538 if (!(array = d3drm_frame_array_create(frame->nb_children, frame->children)))
1539 return E_OUTOFMEMORY;
1541 *children = &array->IDirect3DRMFrameArray_iface;
1543 return D3DRM_OK;
1546 static D3DCOLOR WINAPI d3drm_frame3_GetColor(IDirect3DRMFrame3 *iface)
1548 FIXME("iface %p stub!\n", iface);
1550 return 0;
1553 static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
1555 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1556 struct d3drm_light_array *array;
1558 TRACE("iface %p, lights %p.\n", iface, lights);
1560 if (!lights)
1561 return D3DRMERR_BADVALUE;
1563 if (!(array = d3drm_light_array_create(frame->nb_lights, frame->lights)))
1564 return E_OUTOFMEMORY;
1566 *lights = &array->IDirect3DRMLightArray_iface;
1568 return D3DRM_OK;
1571 static D3DRMMATERIALMODE WINAPI d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3 *iface)
1573 FIXME("iface %p stub!\n", iface);
1575 return D3DRMMATERIAL_FROMPARENT;
1578 static HRESULT WINAPI d3drm_frame3_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **parent)
1580 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1582 TRACE("iface %p, parent %p.\n", iface, parent);
1584 if (!parent)
1585 return D3DRMERR_BADVALUE;
1587 if (frame->parent)
1589 *parent = &frame->parent->IDirect3DRMFrame3_iface;
1590 IDirect3DRMFrame_AddRef(*parent);
1592 else
1594 *parent = NULL;
1597 return D3DRM_OK;
1600 static HRESULT WINAPI d3drm_frame3_GetPosition(IDirect3DRMFrame3 *iface,
1601 IDirect3DRMFrame3 *reference, D3DVECTOR *position)
1603 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1605 return E_NOTIMPL;
1608 static HRESULT WINAPI d3drm_frame3_GetRotation(IDirect3DRMFrame3 *iface,
1609 IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *theta)
1611 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1613 return E_NOTIMPL;
1616 static HRESULT WINAPI d3drm_frame3_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene)
1618 FIXME("iface %p, scene %p stub!\n", iface, scene);
1620 return E_NOTIMPL;
1623 static D3DRMSORTMODE WINAPI d3drm_frame3_GetSortMode(IDirect3DRMFrame3 *iface)
1625 FIXME("iface %p stub!\n", iface);
1627 return D3DRMSORT_FROMPARENT;
1630 static HRESULT WINAPI d3drm_frame3_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture)
1632 FIXME("iface %p, texture %p stub!\n", iface, texture);
1634 return E_NOTIMPL;
1637 static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface,
1638 IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix)
1640 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1642 TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix);
1644 if (reference)
1645 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1647 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1649 return D3DRM_OK;
1652 static HRESULT WINAPI d3drm_frame3_GetVelocity(IDirect3DRMFrame3 *iface,
1653 IDirect3DRMFrame3 *reference, D3DVECTOR *velocity, BOOL with_rotation)
1655 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1656 iface, reference, velocity, with_rotation);
1658 return E_NOTIMPL;
1661 static HRESULT WINAPI d3drm_frame3_GetOrientation(IDirect3DRMFrame3 *iface,
1662 IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up)
1664 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1666 return E_NOTIMPL;
1669 static HRESULT WINAPI d3drm_frame3_GetVisuals(IDirect3DRMFrame3 *iface,
1670 DWORD *count, IUnknown **visuals)
1672 FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals);
1674 return E_NOTIMPL;
1677 static HRESULT WINAPI d3drm_frame3_InverseTransform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
1679 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1681 return E_NOTIMPL;
1684 static HRESULT WINAPI d3drm_frame3_Load(IDirect3DRMFrame3 *iface, void *filename,
1685 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx)
1687 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1688 iface, filename, name, flags, cb, ctx);
1690 return E_NOTIMPL;
1693 static HRESULT WINAPI d3drm_frame3_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target,
1694 IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint)
1696 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1698 return E_NOTIMPL;
1701 static HRESULT WINAPI d3drm_frame3_Move(IDirect3DRMFrame3 *iface, D3DVALUE delta)
1703 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1705 return E_NOTIMPL;
1708 static HRESULT WINAPI d3drm_frame3_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1710 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1711 struct d3drm_frame *child_impl = unsafe_impl_from_IDirect3DRMFrame3(child);
1712 ULONG i;
1714 TRACE("iface %p, child %p.\n", iface, child);
1716 if (!child_impl)
1717 return D3DRMERR_BADOBJECT;
1719 /* Check if child exists */
1720 for (i = 0; i < frame->nb_children; ++i)
1722 if (frame->children[i] == child)
1723 break;
1726 if (i == frame->nb_children)
1727 return D3DRMERR_BADVALUE;
1729 memmove(frame->children + i, frame->children + i + 1, sizeof(*frame->children) * (frame->nb_children - 1 - i));
1730 IDirect3DRMFrame3_Release(child);
1731 child_impl->parent = NULL;
1732 --frame->nb_children;
1734 return D3DRM_OK;
1737 static HRESULT WINAPI d3drm_frame3_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1739 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1740 ULONG i;
1742 TRACE("iface %p, light %p.\n", iface, light);
1744 if (!light)
1745 return D3DRMERR_BADOBJECT;
1747 /* Check if visual exists */
1748 for (i = 0; i < frame->nb_lights; ++i)
1750 if (frame->lights[i] == light)
1751 break;
1754 if (i == frame->nb_lights)
1755 return D3DRMERR_BADVALUE;
1757 memmove(frame->lights + i, frame->lights + i + 1, sizeof(*frame->lights) * (frame->nb_lights - 1 - i));
1758 IDirect3DRMLight_Release(light);
1759 --frame->nb_lights;
1761 return D3DRM_OK;
1764 static HRESULT WINAPI d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3 *iface,
1765 D3DRMFRAME3MOVECALLBACK cb, void *ctx)
1767 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1769 return E_NOTIMPL;
1772 static HRESULT WINAPI d3drm_frame3_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1774 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1775 ULONG i;
1777 TRACE("iface %p, visual %p.\n", iface, visual);
1779 if (!visual)
1780 return D3DRMERR_BADOBJECT;
1782 /* Check if visual exists */
1783 for (i = 0; i < frame->nb_visuals; ++i)
1785 if (frame->visuals[i] == (IDirect3DRMVisual *)visual)
1786 break;
1789 if (i == frame->nb_visuals)
1790 return D3DRMERR_BADVALUE;
1792 memmove(frame->visuals + i, frame->visuals + i + 1, sizeof(*frame->visuals) * (frame->nb_visuals - 1 - i));
1793 IDirect3DRMVisual_Release(visual);
1794 --frame->nb_visuals;
1796 return D3DRM_OK;
1799 static D3DCOLOR WINAPI d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3 *iface)
1801 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1803 TRACE("iface %p.\n", iface);
1805 return frame->scenebackground;
1808 static HRESULT WINAPI d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1809 IDirectDrawSurface **surface)
1811 FIXME("iface %p, surface %p stub!\n", iface, surface);
1813 return E_NOTIMPL;
1816 static D3DCOLOR WINAPI d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3 *iface)
1818 FIXME("iface %p stub!\n", iface);
1820 return 0;
1823 static BOOL WINAPI d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3 *iface)
1825 FIXME("iface %p stub!\n", iface);
1827 return FALSE;
1830 static D3DRMFOGMODE WINAPI d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3 *iface)
1832 FIXME("iface %p stub!\n", iface);
1834 return D3DRMFOG_LINEAR;
1837 static HRESULT WINAPI d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3 *iface,
1838 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1840 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1842 return E_NOTIMPL;
1845 static HRESULT WINAPI d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1847 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1849 TRACE("iface %p, color 0x%08x.\n", iface, color);
1851 frame->scenebackground = color;
1853 return D3DRM_OK;
1856 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3 *iface,
1857 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1859 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1861 TRACE("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
1863 frame->scenebackground = RGBA_MAKE((BYTE)(red * 255.0f),
1864 (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff);
1866 return D3DRM_OK;
1869 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1870 IDirectDrawSurface *surface)
1872 FIXME("iface %p, surface %p stub!\n", iface, surface);
1874 return E_NOTIMPL;
1877 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
1878 IDirect3DRMTexture3 *texture)
1880 FIXME("iface %p, texture %p stub!\n", iface, texture);
1882 return E_NOTIMPL;
1885 static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable)
1887 FIXME("iface %p, enable %#x stub!\n", iface, enable);
1889 return E_NOTIMPL;
1892 static HRESULT WINAPI d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1894 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
1896 return E_NOTIMPL;
1899 static HRESULT WINAPI d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3 *iface, D3DRMFOGMODE mode)
1901 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1903 return E_NOTIMPL;
1906 static HRESULT WINAPI d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3 *iface,
1907 D3DVALUE start, D3DVALUE end, D3DVALUE density)
1909 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
1911 return E_NOTIMPL;
1914 static HRESULT WINAPI d3drm_frame3_SetColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1916 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
1918 return E_NOTIMPL;
1921 static HRESULT WINAPI d3drm_frame3_SetColorRGB(IDirect3DRMFrame3 *iface,
1922 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1924 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
1926 return E_NOTIMPL;
1929 static D3DRMZBUFFERMODE WINAPI d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3 *iface)
1931 FIXME("iface %p stub!\n", iface);
1933 return D3DRMZBUFFER_FROMPARENT;
1936 static HRESULT WINAPI d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3 *iface, D3DRMMATERIALMODE mode)
1938 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1940 return E_NOTIMPL;
1943 static HRESULT WINAPI d3drm_frame3_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
1944 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
1946 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
1947 iface, reference, dx, dy, dz, ux, uy, uz);
1949 return E_NOTIMPL;
1952 static HRESULT WINAPI d3drm_frame3_SetPosition(IDirect3DRMFrame3 *iface,
1953 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1955 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
1957 return E_NOTIMPL;
1960 static HRESULT WINAPI d3drm_frame3_SetRotation(IDirect3DRMFrame3 *iface,
1961 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1963 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1964 iface, reference, x, y, z, theta);
1966 return E_NOTIMPL;
1969 static HRESULT WINAPI d3drm_frame3_SetSortMode(IDirect3DRMFrame3 *iface, D3DRMSORTMODE mode)
1971 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1973 return E_NOTIMPL;
1976 static HRESULT WINAPI d3drm_frame3_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture)
1978 FIXME("iface %p, texture %p stub!\n", iface, texture);
1980 return E_NOTIMPL;
1983 static HRESULT WINAPI d3drm_frame3_SetVelocity(IDirect3DRMFrame3 *iface,
1984 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
1986 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
1987 iface, reference, x, y, z, with_rotation);
1989 return E_NOTIMPL;
1992 static HRESULT WINAPI d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3 *iface, D3DRMZBUFFERMODE mode)
1994 FIXME("iface %p, mode %#x stub!\n", iface, mode);
1996 return E_NOTIMPL;
1999 static HRESULT WINAPI d3drm_frame3_Transform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
2001 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2003 return E_NOTIMPL;
2006 static HRESULT WINAPI d3drm_frame3_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2008 FIXME("iface %p, box %p stub!\n", iface, box);
2010 return E_NOTIMPL;
2013 static BOOL WINAPI d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3 *iface)
2015 FIXME("iface %p stub!\n", iface);
2017 return FALSE;
2020 static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2022 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2024 return E_NOTIMPL;
2027 static HRESULT WINAPI d3drm_frame3_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material)
2029 FIXME("iface %p, material %p stub!\n", iface, material);
2031 return E_NOTIMPL;
2034 static BOOL WINAPI d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3 *iface)
2036 FIXME("iface %p stub!\n", iface);
2038 return FALSE;
2041 static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2043 FIXME("iface %p, box %p stub!\n", iface, box);
2045 return E_NOTIMPL;
2048 static HRESULT WINAPI d3drm_frame3_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2050 FIXME("iface %p, box %p stub!\n", iface, box);
2052 return E_NOTIMPL;
2055 static HRESULT WINAPI d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2057 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2059 return E_NOTIMPL;
2062 static HRESULT WINAPI d3drm_frame3_SetAxes(IDirect3DRMFrame3 *iface,
2063 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2065 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2066 iface, dx, dy, dz, ux, uy, uz);
2068 return E_NOTIMPL;
2071 static HRESULT WINAPI d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3 *iface, BOOL inherit)
2073 FIXME("iface %p, inherit %#x stub!\n", iface, inherit);
2075 return E_NOTIMPL;
2078 static HRESULT WINAPI d3drm_frame3_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material)
2080 FIXME("iface %p, material %p stub!\n", iface, material);
2082 return E_NOTIMPL;
2085 static HRESULT WINAPI d3drm_frame3_SetQuaternion(IDirect3DRMFrame3 *iface,
2086 IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q)
2088 FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q);
2090 return E_NOTIMPL;
2093 static HRESULT WINAPI d3drm_frame3_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2094 D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **visuals)
2096 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2097 iface, reference, ray, flags, visuals);
2099 return E_NOTIMPL;
2102 static HRESULT WINAPI d3drm_frame3_Save(IDirect3DRMFrame3 *iface,
2103 const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags)
2105 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2106 iface, debugstr_a(filename), format, flags);
2108 return E_NOTIMPL;
2111 static HRESULT WINAPI d3drm_frame3_TransformVectors(IDirect3DRMFrame3 *iface,
2112 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2114 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2116 return E_NOTIMPL;
2119 static HRESULT WINAPI d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3 *iface,
2120 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2122 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2124 return E_NOTIMPL;
2127 static HRESULT WINAPI d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD flags)
2129 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2131 return E_NOTIMPL;
2134 static HRESULT WINAPI d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *flags)
2136 FIXME("iface %p, flags %p stub!\n", iface, flags);
2138 return E_NOTIMPL;
2141 static HRESULT WINAPI d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD flags)
2143 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2145 return E_NOTIMPL;
2148 static HRESULT WINAPI d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode)
2150 FIXME("iface %p, fog_mode %p stub!\n", iface, fog_mode);
2152 return E_NOTIMPL;
2155 static HRESULT WINAPI d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3 *iface,
2156 D3DRMMATERIALOVERRIDE *override)
2158 FIXME("iface %p, override %p stub!\n", iface, override);
2160 return E_NOTIMPL;
2163 static HRESULT WINAPI d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3 *iface,
2164 D3DRMMATERIALOVERRIDE *override)
2166 FIXME("iface %p, override %p stub!\n", iface, override);
2168 return E_NOTIMPL;
2171 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl =
2173 d3drm_frame3_QueryInterface,
2174 d3drm_frame3_AddRef,
2175 d3drm_frame3_Release,
2176 d3drm_frame3_Clone,
2177 d3drm_frame3_AddDestroyCallback,
2178 d3drm_frame3_DeleteDestroyCallback,
2179 d3drm_frame3_SetAppData,
2180 d3drm_frame3_GetAppData,
2181 d3drm_frame3_SetName,
2182 d3drm_frame3_GetName,
2183 d3drm_frame3_GetClassName,
2184 d3drm_frame3_AddChild,
2185 d3drm_frame3_AddLight,
2186 d3drm_frame3_AddMoveCallback,
2187 d3drm_frame3_AddTransform,
2188 d3drm_frame3_AddTranslation,
2189 d3drm_frame3_AddScale,
2190 d3drm_frame3_AddRotation,
2191 d3drm_frame3_AddVisual,
2192 d3drm_frame3_GetChildren,
2193 d3drm_frame3_GetColor,
2194 d3drm_frame3_GetLights,
2195 d3drm_frame3_GetMaterialMode,
2196 d3drm_frame3_GetParent,
2197 d3drm_frame3_GetPosition,
2198 d3drm_frame3_GetRotation,
2199 d3drm_frame3_GetScene,
2200 d3drm_frame3_GetSortMode,
2201 d3drm_frame3_GetTexture,
2202 d3drm_frame3_GetTransform,
2203 d3drm_frame3_GetVelocity,
2204 d3drm_frame3_GetOrientation,
2205 d3drm_frame3_GetVisuals,
2206 d3drm_frame3_InverseTransform,
2207 d3drm_frame3_Load,
2208 d3drm_frame3_LookAt,
2209 d3drm_frame3_Move,
2210 d3drm_frame3_DeleteChild,
2211 d3drm_frame3_DeleteLight,
2212 d3drm_frame3_DeleteMoveCallback,
2213 d3drm_frame3_DeleteVisual,
2214 d3drm_frame3_GetSceneBackground,
2215 d3drm_frame3_GetSceneBackgroundDepth,
2216 d3drm_frame3_GetSceneFogColor,
2217 d3drm_frame3_GetSceneFogEnable,
2218 d3drm_frame3_GetSceneFogMode,
2219 d3drm_frame3_GetSceneFogParams,
2220 d3drm_frame3_SetSceneBackground,
2221 d3drm_frame3_SetSceneBackgroundRGB,
2222 d3drm_frame3_SetSceneBackgroundDepth,
2223 d3drm_frame3_SetSceneBackgroundImage,
2224 d3drm_frame3_SetSceneFogEnable,
2225 d3drm_frame3_SetSceneFogColor,
2226 d3drm_frame3_SetSceneFogMode,
2227 d3drm_frame3_SetSceneFogParams,
2228 d3drm_frame3_SetColor,
2229 d3drm_frame3_SetColorRGB,
2230 d3drm_frame3_GetZbufferMode,
2231 d3drm_frame3_SetMaterialMode,
2232 d3drm_frame3_SetOrientation,
2233 d3drm_frame3_SetPosition,
2234 d3drm_frame3_SetRotation,
2235 d3drm_frame3_SetSortMode,
2236 d3drm_frame3_SetTexture,
2237 d3drm_frame3_SetVelocity,
2238 d3drm_frame3_SetZbufferMode,
2239 d3drm_frame3_Transform,
2240 d3drm_frame3_GetBox,
2241 d3drm_frame3_GetBoxEnable,
2242 d3drm_frame3_GetAxes,
2243 d3drm_frame3_GetMaterial,
2244 d3drm_frame3_GetInheritAxes,
2245 d3drm_frame3_GetHierarchyBox,
2246 d3drm_frame3_SetBox,
2247 d3drm_frame3_SetBoxEnable,
2248 d3drm_frame3_SetAxes,
2249 d3drm_frame3_SetInheritAxes,
2250 d3drm_frame3_SetMaterial,
2251 d3drm_frame3_SetQuaternion,
2252 d3drm_frame3_RayPick,
2253 d3drm_frame3_Save,
2254 d3drm_frame3_TransformVectors,
2255 d3drm_frame3_InverseTransformVectors,
2256 d3drm_frame3_SetTraversalOptions,
2257 d3drm_frame3_GetTraversalOptions,
2258 d3drm_frame3_SetSceneFogMethod,
2259 d3drm_frame3_GetSceneFogMethod,
2260 d3drm_frame3_SetMaterialOverride,
2261 d3drm_frame3_GetMaterialOverride,
2264 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2266 if (!iface)
2267 return NULL;
2268 assert(iface->lpVtbl == &d3drm_frame3_vtbl);
2270 return impl_from_IDirect3DRMFrame3(iface);
2273 HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown *parent, IUnknown **out)
2275 struct d3drm_frame *object;
2276 HRESULT hr;
2278 TRACE("riid %s, parent %p, out %p.\n", debugstr_guid(riid), parent, out);
2280 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
2281 return E_OUTOFMEMORY;
2283 object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
2284 object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
2285 object->ref = 1;
2286 object->scenebackground = RGBA_MAKE(0, 0, 0, 0xff);
2288 memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2290 if (parent)
2292 IDirect3DRMFrame3 *p;
2294 hr = IDirect3DRMFrame_QueryInterface(parent, &IID_IDirect3DRMFrame3, (void**)&p);
2295 if (hr != S_OK)
2297 HeapFree(GetProcessHeap(), 0, object);
2298 return hr;
2300 IDirect3DRMFrame_Release(parent);
2301 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
2304 hr = IDirect3DRMFrame3_QueryInterface(&object->IDirect3DRMFrame3_iface, riid, (void **)out);
2305 IDirect3DRMFrame3_Release(&object->IDirect3DRMFrame3_iface);
2306 return hr;