d3drm: Move IUnknown methods of viewports from version 1->2.
[wine.git] / dlls / d3drm / viewport.c
blob9fd627d94c3e439284ec183a3839a701e4c8ffa6
1 /*
2 * Implementation of IDirect3DRMViewport Interface
4 * Copyright 2012 André Hentschel
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/debug.h"
23 #define COBJMACROS
25 #include "winbase.h"
26 #include "wingdi.h"
28 #include "d3drm_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
32 static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport(IDirect3DRMViewport *iface)
34 return CONTAINING_RECORD(iface, struct d3drm_viewport, IDirect3DRMViewport_iface);
37 static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport2(IDirect3DRMViewport2 *iface)
39 return CONTAINING_RECORD(iface, struct d3drm_viewport, IDirect3DRMViewport2_iface);
42 static void d3drm_viewport_destroy(struct d3drm_viewport *viewport)
44 TRACE("viewport %p.\n", viewport);
46 d3drm_object_cleanup((IDirect3DRMObject *)&viewport->IDirect3DRMViewport_iface, &viewport->obj);
47 HeapFree(GetProcessHeap(), 0, viewport);
50 static HRESULT WINAPI d3drm_viewport2_QueryInterface(IDirect3DRMViewport2 *iface, REFIID riid, void **out)
52 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
54 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
56 if (IsEqualGUID(riid, &IID_IDirect3DRMViewport)
57 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
58 || IsEqualGUID(riid, &IID_IUnknown))
60 *out = &viewport->IDirect3DRMViewport_iface;
62 else if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2))
64 *out = &viewport->IDirect3DRMViewport2_iface;
66 else
68 *out = NULL;
69 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
70 return E_NOINTERFACE;
73 IUnknown_AddRef((IUnknown *)*out);
74 return S_OK;
77 static HRESULT WINAPI d3drm_viewport1_QueryInterface(IDirect3DRMViewport *iface, REFIID riid, void **out)
79 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
81 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
83 return d3drm_viewport2_QueryInterface(&viewport->IDirect3DRMViewport2_iface, riid, out);
86 static ULONG WINAPI d3drm_viewport2_AddRef(IDirect3DRMViewport2 *iface)
88 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
89 ULONG refcount = InterlockedIncrement(&viewport->obj.ref);
91 TRACE("%p increasing refcount to %u.\n", iface, refcount);
93 return refcount;
96 static ULONG WINAPI d3drm_viewport1_AddRef(IDirect3DRMViewport *iface)
98 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
100 TRACE("iface %p.\n", iface);
102 return d3drm_viewport2_AddRef(&viewport->IDirect3DRMViewport2_iface);
105 static ULONG WINAPI d3drm_viewport2_Release(IDirect3DRMViewport2 *iface)
107 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
108 ULONG refcount = InterlockedDecrement(&viewport->obj.ref);
110 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
112 if (!refcount)
113 d3drm_viewport_destroy(viewport);
115 return refcount;
118 static ULONG WINAPI d3drm_viewport1_Release(IDirect3DRMViewport *iface)
120 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
122 TRACE("iface %p.\n", iface);
124 return d3drm_viewport2_Release(&viewport->IDirect3DRMViewport2_iface);
127 static HRESULT WINAPI d3drm_viewport2_Clone(IDirect3DRMViewport2 *iface,
128 IUnknown *outer, REFIID iid, void **out)
130 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
132 return E_NOTIMPL;
135 static HRESULT WINAPI d3drm_viewport1_Clone(IDirect3DRMViewport *iface,
136 IUnknown *outer, REFIID iid, void **out)
138 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
140 return E_NOTIMPL;
143 static HRESULT WINAPI d3drm_viewport2_AddDestroyCallback(IDirect3DRMViewport2 *iface,
144 D3DRMOBJECTCALLBACK cb, void *ctx)
146 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
148 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
150 return d3drm_object_add_destroy_callback(&viewport->obj, cb, ctx);
153 static HRESULT WINAPI d3drm_viewport1_AddDestroyCallback(IDirect3DRMViewport *iface,
154 D3DRMOBJECTCALLBACK cb, void *ctx)
156 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
158 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
160 return d3drm_viewport2_AddDestroyCallback(&viewport->IDirect3DRMViewport2_iface, cb, ctx);
163 static HRESULT WINAPI d3drm_viewport2_DeleteDestroyCallback(IDirect3DRMViewport2 *iface,
164 D3DRMOBJECTCALLBACK cb, void *ctx)
166 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
168 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
170 return d3drm_object_delete_destroy_callback(&viewport->obj, cb, ctx);
173 static HRESULT WINAPI d3drm_viewport1_DeleteDestroyCallback(IDirect3DRMViewport *iface,
174 D3DRMOBJECTCALLBACK cb, void *ctx)
176 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
178 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
180 return d3drm_viewport2_DeleteDestroyCallback(&viewport->IDirect3DRMViewport2_iface, cb, ctx);
183 static HRESULT WINAPI d3drm_viewport2_SetAppData(IDirect3DRMViewport2 *iface, DWORD data)
185 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
187 TRACE("iface %p, data %#x\n", iface, data);
189 viewport->obj.appdata = data;
190 return S_OK;
193 static HRESULT WINAPI d3drm_viewport1_SetAppData(IDirect3DRMViewport *iface, DWORD data)
195 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
197 TRACE("iface %p, data %#x\n", iface, data);
199 return d3drm_viewport2_SetAppData(&viewport->IDirect3DRMViewport2_iface, data);
202 static DWORD WINAPI d3drm_viewport2_GetAppData(IDirect3DRMViewport2 *iface)
204 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
206 TRACE("iface %p\n", iface);
208 return viewport->obj.appdata;
211 static DWORD WINAPI d3drm_viewport1_GetAppData(IDirect3DRMViewport *iface)
213 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
215 TRACE("iface %p.\n", iface);
217 return d3drm_viewport2_GetAppData(&viewport->IDirect3DRMViewport2_iface);
220 static HRESULT WINAPI d3drm_viewport2_SetName(IDirect3DRMViewport2 *iface, const char *name)
222 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
224 return E_NOTIMPL;
227 static HRESULT WINAPI d3drm_viewport1_SetName(IDirect3DRMViewport *iface, const char *name)
229 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
231 return E_NOTIMPL;
234 static HRESULT WINAPI d3drm_viewport2_GetName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
236 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
238 return E_NOTIMPL;
241 static HRESULT WINAPI d3drm_viewport1_GetName(IDirect3DRMViewport *iface, DWORD *size, char *name)
243 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
245 return E_NOTIMPL;
248 static HRESULT WINAPI d3drm_viewport2_GetClassName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
250 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
252 if (!size || *size < strlen("Viewport") || !name)
253 return E_INVALIDARG;
255 strcpy(name, "Viewport");
256 *size = sizeof("Viewport");
258 return D3DRM_OK;
261 static HRESULT WINAPI d3drm_viewport1_GetClassName(IDirect3DRMViewport *iface, DWORD *size, char *name)
263 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
265 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
267 return d3drm_viewport2_GetClassName(&viewport->IDirect3DRMViewport2_iface, size, name);
270 static HRESULT WINAPI d3drm_viewport2_Init(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 *device,
271 IDirect3DRMFrame3 *camera, DWORD x, DWORD y, DWORD width, DWORD height)
273 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n",
274 iface, device, camera, x, y, width, height);
276 return E_NOTIMPL;
279 static HRESULT WINAPI d3drm_viewport1_Init(IDirect3DRMViewport *iface, IDirect3DRMDevice *device,
280 IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height)
282 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n",
283 iface, device, camera, x, y, width, height);
285 return E_NOTIMPL;
288 static HRESULT WINAPI d3drm_viewport2_Clear(IDirect3DRMViewport2 *iface, DWORD flags)
290 FIXME("iface %p, flags %#x.\n", iface, flags);
292 return D3DRM_OK;
295 static HRESULT WINAPI d3drm_viewport1_Clear(IDirect3DRMViewport *iface)
297 FIXME("iface %p.\n", iface);
299 return D3DRM_OK;
302 static HRESULT WINAPI d3drm_viewport2_Render(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *frame)
304 FIXME("iface %p, frame %p stub!\n", iface, frame);
306 return D3DRM_OK;
309 static HRESULT WINAPI d3drm_viewport1_Render(IDirect3DRMViewport *iface, IDirect3DRMFrame *frame)
311 FIXME("iface %p, frame %p stub!\n", iface, frame);
313 return D3DRM_OK;
316 static HRESULT WINAPI d3drm_viewport2_SetFront(IDirect3DRMViewport2 *iface, D3DVALUE front)
318 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
320 TRACE("iface %p, front %.8e.\n", iface, front);
322 viewport->front = front;
324 return D3DRM_OK;
327 static HRESULT WINAPI d3drm_viewport1_SetFront(IDirect3DRMViewport *iface, D3DVALUE front)
329 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
331 TRACE("iface %p, front %.8e.\n", iface, front);
333 return d3drm_viewport2_SetFront(&viewport->IDirect3DRMViewport2_iface, front);
336 static HRESULT WINAPI d3drm_viewport2_SetBack(IDirect3DRMViewport2 *iface, D3DVALUE back)
338 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
340 TRACE("iface %p, back %.8e.\n", iface, back);
342 viewport->back = back;
344 return D3DRM_OK;
347 static HRESULT WINAPI d3drm_viewport1_SetBack(IDirect3DRMViewport *iface, D3DVALUE back)
349 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
351 TRACE("iface %p, back %.8e.\n", iface, back);
353 return d3drm_viewport2_SetBack(&viewport->IDirect3DRMViewport2_iface, back);
356 static HRESULT WINAPI d3drm_viewport2_SetField(IDirect3DRMViewport2 *iface, D3DVALUE field)
358 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
360 TRACE("iface %p, field %.8e.\n", iface, field);
362 viewport->field = field;
364 return D3DRM_OK;
367 static HRESULT WINAPI d3drm_viewport1_SetField(IDirect3DRMViewport *iface, D3DVALUE field)
369 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
371 TRACE("iface %p, field %.8e.\n", iface, field);
373 return d3drm_viewport2_SetField(&viewport->IDirect3DRMViewport2_iface, field);
376 static HRESULT WINAPI d3drm_viewport2_SetUniformScaling(IDirect3DRMViewport2 *iface, BOOL b)
378 FIXME("iface %p, b %#x stub!\n", iface, b);
380 return E_NOTIMPL;
383 static HRESULT WINAPI d3drm_viewport1_SetUniformScaling(IDirect3DRMViewport *iface, BOOL b)
385 FIXME("iface %p, b %#x stub!\n", iface, b);
387 return E_NOTIMPL;
390 static HRESULT WINAPI d3drm_viewport2_SetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *camera)
392 FIXME("iface %p, camera %p stub!\n", iface, camera);
394 return E_NOTIMPL;
397 static HRESULT WINAPI d3drm_viewport1_SetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame *camera)
399 FIXME("iface %p, camera %p stub!\n", iface, camera);
401 return E_NOTIMPL;
404 static HRESULT WINAPI d3drm_viewport2_SetProjection(IDirect3DRMViewport2 *iface, D3DRMPROJECTIONTYPE type)
406 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
408 TRACE("iface %p, type %#x.\n", iface, type);
410 viewport->projection = type;
412 return D3DRM_OK;
415 static HRESULT WINAPI d3drm_viewport1_SetProjection(IDirect3DRMViewport *iface, D3DRMPROJECTIONTYPE type)
417 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
419 TRACE("iface %p, type %#x.\n", iface, type);
421 return d3drm_viewport2_SetProjection(&viewport->IDirect3DRMViewport2_iface, type);
424 static HRESULT WINAPI d3drm_viewport2_Transform(IDirect3DRMViewport2 *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
426 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
428 return E_NOTIMPL;
431 static HRESULT WINAPI d3drm_viewport1_Transform(IDirect3DRMViewport *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
433 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
435 return E_NOTIMPL;
438 static HRESULT WINAPI d3drm_viewport2_InverseTransform(IDirect3DRMViewport2 *iface, D3DVECTOR *d, D3DRMVECTOR4D *s)
440 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
442 return E_NOTIMPL;
445 static HRESULT WINAPI d3drm_viewport1_InverseTransform(IDirect3DRMViewport *iface, D3DVECTOR *d, D3DRMVECTOR4D *s)
447 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
449 return E_NOTIMPL;
452 static HRESULT WINAPI d3drm_viewport2_Configure(IDirect3DRMViewport2 *iface,
453 LONG x, LONG y, DWORD width, DWORD height)
455 FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height);
457 return E_NOTIMPL;
460 static HRESULT WINAPI d3drm_viewport1_Configure(IDirect3DRMViewport *iface,
461 LONG x, LONG y, DWORD width, DWORD height)
463 FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height);
465 return E_NOTIMPL;
468 static HRESULT WINAPI d3drm_viewport2_ForceUpdate(IDirect3DRMViewport2* iface,
469 DWORD x1, DWORD y1, DWORD x2, DWORD y2)
471 FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2);
473 return E_NOTIMPL;
476 static HRESULT WINAPI d3drm_viewport1_ForceUpdate(IDirect3DRMViewport *iface,
477 DWORD x1, DWORD y1, DWORD x2, DWORD y2)
479 FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2);
481 return E_NOTIMPL;
484 static HRESULT WINAPI d3drm_viewport2_SetPlane(IDirect3DRMViewport2 *iface,
485 D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top)
487 FIXME("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e stub!\n",
488 iface, left, right, bottom, top);
490 return E_NOTIMPL;
493 static HRESULT WINAPI d3drm_viewport1_SetPlane(IDirect3DRMViewport *iface,
494 D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top)
496 FIXME("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e stub!\n",
497 iface, left, right, bottom, top);
499 return E_NOTIMPL;
502 static HRESULT WINAPI d3drm_viewport2_GetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 **camera)
504 FIXME("iface %p, camera %p stub!\n", iface, camera);
506 return E_NOTIMPL;
509 static HRESULT WINAPI d3drm_viewport1_GetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame **camera)
511 FIXME("iface %p, camera %p stub!\n", iface, camera);
513 return E_NOTIMPL;
516 static HRESULT WINAPI d3drm_viewport2_GetDevice(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 **device)
518 FIXME("iface %p, device %p stub!\n", iface, device);
520 return E_NOTIMPL;
523 static HRESULT WINAPI d3drm_viewport1_GetDevice(IDirect3DRMViewport *iface, IDirect3DRMDevice **device)
525 FIXME("iface %p, device %p stub!\n", iface, device);
527 return E_NOTIMPL;
530 static HRESULT WINAPI d3drm_viewport2_GetPlane(IDirect3DRMViewport2 *iface,
531 D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top)
533 FIXME("iface %p, left %p, right %p, bottom %p, top %p stub!\n",
534 iface, left, right, bottom, top);
536 return E_NOTIMPL;
539 static HRESULT WINAPI d3drm_viewport1_GetPlane(IDirect3DRMViewport *iface,
540 D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top)
542 FIXME("iface %p, left %p, right %p, bottom %p, top %p stub!\n",
543 iface, left, right, bottom, top);
545 return E_NOTIMPL;
548 static HRESULT WINAPI d3drm_viewport2_Pick(IDirect3DRMViewport2 *iface,
549 LONG x, LONG y, IDirect3DRMPickedArray **visuals)
551 FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals);
553 return E_NOTIMPL;
556 static HRESULT WINAPI d3drm_viewport1_Pick(IDirect3DRMViewport *iface,
557 LONG x, LONG y, IDirect3DRMPickedArray **visuals)
559 FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals);
561 return E_NOTIMPL;
564 static BOOL WINAPI d3drm_viewport2_GetUniformScaling(IDirect3DRMViewport2 *iface)
566 FIXME("iface %p stub!\n", iface);
568 return FALSE;
571 static BOOL WINAPI d3drm_viewport1_GetUniformScaling(IDirect3DRMViewport *iface)
573 FIXME("iface %p stub!\n", iface);
575 return FALSE;
578 static LONG WINAPI d3drm_viewport2_GetX(IDirect3DRMViewport2 *iface)
580 FIXME("iface %p stub!\n", iface);
582 return E_NOTIMPL;
585 static LONG WINAPI d3drm_viewport1_GetX(IDirect3DRMViewport *iface)
587 FIXME("iface %p stub!\n", iface);
589 return E_NOTIMPL;
592 static LONG WINAPI d3drm_viewport2_GetY(IDirect3DRMViewport2 *iface)
594 FIXME("iface %p stub!\n", iface);
596 return E_NOTIMPL;
599 static LONG WINAPI d3drm_viewport1_GetY(IDirect3DRMViewport *iface)
601 FIXME("iface %p stub!\n", iface);
603 return E_NOTIMPL;
606 static DWORD WINAPI d3drm_viewport2_GetWidth(IDirect3DRMViewport2 *iface)
608 FIXME("iface %p stub!\n", iface);
610 return E_NOTIMPL;
613 static DWORD WINAPI d3drm_viewport1_GetWidth(IDirect3DRMViewport *iface)
615 FIXME("iface %p stub!\n", iface);
617 return E_NOTIMPL;
620 static DWORD WINAPI d3drm_viewport2_GetHeight(IDirect3DRMViewport2 *iface)
622 FIXME("iface %p stub!\n", iface);
624 return E_NOTIMPL;
627 static DWORD WINAPI d3drm_viewport1_GetHeight(IDirect3DRMViewport *iface)
629 FIXME("iface %p stub!\n", iface);
631 return E_NOTIMPL;
634 static D3DVALUE WINAPI d3drm_viewport2_GetField(IDirect3DRMViewport2 *iface)
636 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
638 TRACE("iface %p.\n", iface);
640 return viewport->field;
643 static D3DVALUE WINAPI d3drm_viewport1_GetField(IDirect3DRMViewport *iface)
645 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
647 TRACE("iface %p.\n", iface);
649 return d3drm_viewport2_GetField(&viewport->IDirect3DRMViewport2_iface);
652 static D3DVALUE WINAPI d3drm_viewport2_GetBack(IDirect3DRMViewport2 *iface)
654 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
656 TRACE("iface %p.\n", iface);
658 return viewport->back;
661 static D3DVALUE WINAPI d3drm_viewport1_GetBack(IDirect3DRMViewport *iface)
663 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
665 TRACE("iface %p.\n", iface);
667 return d3drm_viewport2_GetBack(&viewport->IDirect3DRMViewport2_iface);
670 static D3DVALUE WINAPI d3drm_viewport2_GetFront(IDirect3DRMViewport2 *iface)
672 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
674 TRACE("iface %p.\n", iface);
676 return viewport->front;
679 static D3DVALUE WINAPI d3drm_viewport1_GetFront(IDirect3DRMViewport *iface)
681 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
683 TRACE("iface %p.\n", iface);
685 return d3drm_viewport2_GetFront(&viewport->IDirect3DRMViewport2_iface);
688 static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport2_GetProjection(IDirect3DRMViewport2 *iface)
690 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
692 TRACE("iface %p.\n", iface);
694 return viewport->projection;
697 static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport1_GetProjection(IDirect3DRMViewport *iface)
699 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
701 TRACE("iface %p.\n", iface);
703 return d3drm_viewport2_GetProjection(&viewport->IDirect3DRMViewport2_iface);
706 static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 *iface,
707 IDirect3DViewport **viewport)
709 FIXME("iface %p, viewport %p stub!\n", iface, viewport);
711 return E_NOTIMPL;
714 static HRESULT WINAPI d3drm_viewport1_GetDirect3DViewport(IDirect3DRMViewport *iface,
715 IDirect3DViewport **viewport)
717 FIXME("iface %p, viewport %p stub!\n", iface, viewport);
719 return E_NOTIMPL;
722 static HRESULT WINAPI d3drm_viewport2_TransformVectors(IDirect3DRMViewport2 *iface,
723 DWORD vector_count, D3DRMVECTOR4D *dst, D3DVECTOR *src)
725 FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src);
727 return E_NOTIMPL;
730 static HRESULT WINAPI d3drm_viewport2_InverseTransformVectors(IDirect3DRMViewport2 *iface,
731 DWORD vector_count, D3DVECTOR *dst, D3DRMVECTOR4D *src)
733 FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src);
735 return E_NOTIMPL;
738 static const struct IDirect3DRMViewport2Vtbl d3drm_viewport2_vtbl =
740 d3drm_viewport2_QueryInterface,
741 d3drm_viewport2_AddRef,
742 d3drm_viewport2_Release,
743 d3drm_viewport2_Clone,
744 d3drm_viewport2_AddDestroyCallback,
745 d3drm_viewport2_DeleteDestroyCallback,
746 d3drm_viewport2_SetAppData,
747 d3drm_viewport2_GetAppData,
748 d3drm_viewport2_SetName,
749 d3drm_viewport2_GetName,
750 d3drm_viewport2_GetClassName,
751 d3drm_viewport2_Init,
752 d3drm_viewport2_Clear,
753 d3drm_viewport2_Render,
754 d3drm_viewport2_SetFront,
755 d3drm_viewport2_SetBack,
756 d3drm_viewport2_SetField,
757 d3drm_viewport2_SetUniformScaling,
758 d3drm_viewport2_SetCamera,
759 d3drm_viewport2_SetProjection,
760 d3drm_viewport2_Transform,
761 d3drm_viewport2_InverseTransform,
762 d3drm_viewport2_Configure,
763 d3drm_viewport2_ForceUpdate,
764 d3drm_viewport2_SetPlane,
765 d3drm_viewport2_GetCamera,
766 d3drm_viewport2_GetDevice,
767 d3drm_viewport2_GetPlane,
768 d3drm_viewport2_Pick,
769 d3drm_viewport2_GetUniformScaling,
770 d3drm_viewport2_GetX,
771 d3drm_viewport2_GetY,
772 d3drm_viewport2_GetWidth,
773 d3drm_viewport2_GetHeight,
774 d3drm_viewport2_GetField,
775 d3drm_viewport2_GetBack,
776 d3drm_viewport2_GetFront,
777 d3drm_viewport2_GetProjection,
778 d3drm_viewport2_GetDirect3DViewport,
779 d3drm_viewport2_TransformVectors,
780 d3drm_viewport2_InverseTransformVectors,
783 static const struct IDirect3DRMViewportVtbl d3drm_viewport1_vtbl =
785 d3drm_viewport1_QueryInterface,
786 d3drm_viewport1_AddRef,
787 d3drm_viewport1_Release,
788 d3drm_viewport1_Clone,
789 d3drm_viewport1_AddDestroyCallback,
790 d3drm_viewport1_DeleteDestroyCallback,
791 d3drm_viewport1_SetAppData,
792 d3drm_viewport1_GetAppData,
793 d3drm_viewport1_SetName,
794 d3drm_viewport1_GetName,
795 d3drm_viewport1_GetClassName,
796 d3drm_viewport1_Init,
797 d3drm_viewport1_Clear,
798 d3drm_viewport1_Render,
799 d3drm_viewport1_SetFront,
800 d3drm_viewport1_SetBack,
801 d3drm_viewport1_SetField,
802 d3drm_viewport1_SetUniformScaling,
803 d3drm_viewport1_SetCamera,
804 d3drm_viewport1_SetProjection,
805 d3drm_viewport1_Transform,
806 d3drm_viewport1_InverseTransform,
807 d3drm_viewport1_Configure,
808 d3drm_viewport1_ForceUpdate,
809 d3drm_viewport1_SetPlane,
810 d3drm_viewport1_GetCamera,
811 d3drm_viewport1_GetDevice,
812 d3drm_viewport1_GetPlane,
813 d3drm_viewport1_Pick,
814 d3drm_viewport1_GetUniformScaling,
815 d3drm_viewport1_GetX,
816 d3drm_viewport1_GetY,
817 d3drm_viewport1_GetWidth,
818 d3drm_viewport1_GetHeight,
819 d3drm_viewport1_GetField,
820 d3drm_viewport1_GetBack,
821 d3drm_viewport1_GetFront,
822 d3drm_viewport1_GetProjection,
823 d3drm_viewport1_GetDirect3DViewport,
826 HRESULT d3drm_viewport_create(struct d3drm_viewport **viewport, IDirect3DRM *d3drm)
828 struct d3drm_viewport *object;
830 TRACE("viewport %p, d3drm %p.\n", viewport, d3drm);
832 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
833 return E_OUTOFMEMORY;
835 object->IDirect3DRMViewport_iface.lpVtbl = &d3drm_viewport1_vtbl;
836 object->IDirect3DRMViewport2_iface.lpVtbl = &d3drm_viewport2_vtbl;
837 object->d3drm = d3drm;
838 d3drm_object_init(&object->obj);
840 *viewport = object;
842 return S_OK;