cmd: Fix invalid "else if" execution.
[wine.git] / dlls / d3drm / viewport.c
blob498b764c10ff2a4ddeb364b5723f20825fb2cfe0
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 struct d3drm_viewport
34 IDirect3DRMViewport IDirect3DRMViewport_iface;
35 IDirect3DRMViewport2 IDirect3DRMViewport2_iface;
36 LONG ref;
37 D3DVALUE back;
38 D3DVALUE front;
39 D3DVALUE field;
40 D3DRMPROJECTIONTYPE projection;
43 static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport(IDirect3DRMViewport *iface)
45 return CONTAINING_RECORD(iface, struct d3drm_viewport, IDirect3DRMViewport_iface);
48 static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport2(IDirect3DRMViewport2 *iface)
50 return CONTAINING_RECORD(iface, struct d3drm_viewport, IDirect3DRMViewport2_iface);
53 static HRESULT WINAPI d3drm_viewport1_QueryInterface(IDirect3DRMViewport *iface, REFIID riid, void **out)
55 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
57 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
59 if (IsEqualGUID(riid, &IID_IDirect3DRMViewport)
60 || IsEqualGUID(riid, &IID_IUnknown))
62 *out = &viewport->IDirect3DRMViewport_iface;
64 else if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2))
66 *out = &viewport->IDirect3DRMViewport2_iface;
68 else
70 *out = NULL;
71 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
72 return E_NOINTERFACE;
75 IUnknown_AddRef((IUnknown *)*out);
76 return S_OK;
79 static ULONG WINAPI d3drm_viewport1_AddRef(IDirect3DRMViewport *iface)
81 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
82 ULONG refcount = InterlockedIncrement(&viewport->ref);
84 TRACE("%p increasing refcount to %u.\n", iface, refcount);
86 return refcount;
89 static ULONG WINAPI d3drm_viewport1_Release(IDirect3DRMViewport *iface)
91 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
92 ULONG refcount = InterlockedDecrement(&viewport->ref);
94 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
96 if (!refcount)
97 HeapFree(GetProcessHeap(), 0, viewport);
99 return refcount;
102 static HRESULT WINAPI d3drm_viewport1_Clone(IDirect3DRMViewport *iface,
103 IUnknown *outer, REFIID iid, void **out)
105 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
107 return E_NOTIMPL;
110 static HRESULT WINAPI d3drm_viewport1_AddDestroyCallback(IDirect3DRMViewport *iface,
111 D3DRMOBJECTCALLBACK cb, void *ctx)
113 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
115 return E_NOTIMPL;
118 static HRESULT WINAPI d3drm_viewport1_DeleteDestroyCallback(IDirect3DRMViewport *iface,
119 D3DRMOBJECTCALLBACK cb, void *ctx)
121 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
123 return E_NOTIMPL;
126 static HRESULT WINAPI d3drm_viewport1_SetAppData(IDirect3DRMViewport *iface, DWORD data)
128 FIXME("iface %p, data %#x stub!\n", iface, data);
130 return E_NOTIMPL;
133 static DWORD WINAPI d3drm_viewport1_GetAppData(IDirect3DRMViewport *iface)
135 FIXME("iface %p.\n", iface);
137 return 0;
140 static HRESULT WINAPI d3drm_viewport1_SetName(IDirect3DRMViewport *iface, const char *name)
142 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
144 return E_NOTIMPL;
147 static HRESULT WINAPI d3drm_viewport1_GetName(IDirect3DRMViewport *iface, DWORD *size, char *name)
149 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
151 return E_NOTIMPL;
154 static HRESULT WINAPI d3drm_viewport1_GetClassName(IDirect3DRMViewport *iface, DWORD *size, char *name)
156 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
158 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
160 return IDirect3DRMViewport2_GetClassName(&viewport->IDirect3DRMViewport2_iface, size, name);
163 static HRESULT WINAPI d3drm_viewport1_Init(IDirect3DRMViewport *iface, IDirect3DRMDevice *device,
164 IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height)
166 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n",
167 iface, device, camera, x, y, width, height);
169 return E_NOTIMPL;
172 static HRESULT WINAPI d3drm_viewport1_Clear(IDirect3DRMViewport *iface)
174 FIXME("iface %p.\n", iface);
176 return D3DRM_OK;
179 static HRESULT WINAPI d3drm_viewport1_Render(IDirect3DRMViewport *iface, IDirect3DRMFrame *frame)
181 FIXME("iface %p, frame %p stub!\n", iface, frame);
183 return D3DRM_OK;
186 static HRESULT WINAPI d3drm_viewport1_SetFront(IDirect3DRMViewport *iface, D3DVALUE front)
188 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
190 TRACE("iface %p, front %.8e.\n", iface, front);
192 return IDirect3DRMViewport2_SetFront(&viewport->IDirect3DRMViewport2_iface, front);
195 static HRESULT WINAPI d3drm_viewport1_SetBack(IDirect3DRMViewport *iface, D3DVALUE back)
197 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
199 TRACE("iface %p, back %.8e.\n", iface, back);
201 return IDirect3DRMViewport2_SetBack(&viewport->IDirect3DRMViewport2_iface, back);
204 static HRESULT WINAPI d3drm_viewport1_SetField(IDirect3DRMViewport *iface, D3DVALUE field)
206 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
208 TRACE("iface %p, field %.8e.\n", iface, field);
210 return IDirect3DRMViewport2_SetField(&viewport->IDirect3DRMViewport2_iface, field);
213 static HRESULT WINAPI d3drm_viewport1_SetUniformScaling(IDirect3DRMViewport *iface, BOOL b)
215 FIXME("iface %p, b %#x stub!\n", iface, b);
217 return E_NOTIMPL;
220 static HRESULT WINAPI d3drm_viewport1_SetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame *camera)
222 FIXME("iface %p, camera %p stub!\n", iface, camera);
224 return E_NOTIMPL;
227 static HRESULT WINAPI d3drm_viewport1_SetProjection(IDirect3DRMViewport *iface, D3DRMPROJECTIONTYPE type)
229 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
231 TRACE("iface %p, type %#x.\n", iface, type);
233 return IDirect3DRMViewport2_SetProjection(&viewport->IDirect3DRMViewport2_iface, type);
236 static HRESULT WINAPI d3drm_viewport1_Transform(IDirect3DRMViewport *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
238 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
240 return E_NOTIMPL;
243 static HRESULT WINAPI d3drm_viewport1_InverseTransform(IDirect3DRMViewport *iface, D3DVECTOR *d, D3DRMVECTOR4D *s)
245 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
247 return E_NOTIMPL;
250 static HRESULT WINAPI d3drm_viewport1_Configure(IDirect3DRMViewport *iface,
251 LONG x, LONG y, DWORD width, DWORD height)
253 FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height);
255 return E_NOTIMPL;
258 static HRESULT WINAPI d3drm_viewport1_ForceUpdate(IDirect3DRMViewport *iface,
259 DWORD x1, DWORD y1, DWORD x2, DWORD y2)
261 FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2);
263 return E_NOTIMPL;
266 static HRESULT WINAPI d3drm_viewport1_SetPlane(IDirect3DRMViewport *iface,
267 D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top)
269 FIXME("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e stub!\n",
270 iface, left, right, bottom, top);
272 return E_NOTIMPL;
275 static HRESULT WINAPI d3drm_viewport1_GetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame **camera)
277 FIXME("iface %p, camera %p stub!\n", iface, camera);
279 return E_NOTIMPL;
282 static HRESULT WINAPI d3drm_viewport1_GetDevice(IDirect3DRMViewport *iface, IDirect3DRMDevice **device)
284 FIXME("iface %p, device %p stub!\n", iface, device);
286 return E_NOTIMPL;
289 static HRESULT WINAPI d3drm_viewport1_GetPlane(IDirect3DRMViewport *iface,
290 D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top)
292 FIXME("iface %p, left %p, right %p, bottom %p, top %p stub!\n",
293 iface, left, right, bottom, top);
295 return E_NOTIMPL;
298 static HRESULT WINAPI d3drm_viewport1_Pick(IDirect3DRMViewport *iface,
299 LONG x, LONG y, IDirect3DRMPickedArray **visuals)
301 FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals);
303 return E_NOTIMPL;
306 static BOOL WINAPI d3drm_viewport1_GetUniformScaling(IDirect3DRMViewport *iface)
308 FIXME("iface %p stub!\n", iface);
310 return E_NOTIMPL;
313 static LONG WINAPI d3drm_viewport1_GetX(IDirect3DRMViewport *iface)
315 FIXME("iface %p stub!\n", iface);
317 return E_NOTIMPL;
320 static LONG WINAPI d3drm_viewport1_GetY(IDirect3DRMViewport *iface)
322 FIXME("iface %p stub!\n", iface);
324 return E_NOTIMPL;
327 static DWORD WINAPI d3drm_viewport1_GetWidth(IDirect3DRMViewport *iface)
329 FIXME("iface %p stub!\n", iface);
331 return E_NOTIMPL;
334 static DWORD WINAPI d3drm_viewport1_GetHeight(IDirect3DRMViewport *iface)
336 FIXME("iface %p stub!\n", iface);
338 return E_NOTIMPL;
341 static D3DVALUE WINAPI d3drm_viewport1_GetField(IDirect3DRMViewport *iface)
343 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
345 TRACE("iface %p.\n", iface);
347 return IDirect3DRMViewport2_GetField(&viewport->IDirect3DRMViewport2_iface);
350 static D3DVALUE WINAPI d3drm_viewport1_GetBack(IDirect3DRMViewport *iface)
352 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
354 TRACE("iface %p.\n", iface);
356 return IDirect3DRMViewport2_GetBack(&viewport->IDirect3DRMViewport2_iface);
359 static D3DVALUE WINAPI d3drm_viewport1_GetFront(IDirect3DRMViewport *iface)
361 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
363 TRACE("iface %p.\n", iface);
365 return IDirect3DRMViewport2_GetFront(&viewport->IDirect3DRMViewport2_iface);
368 static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport1_GetProjection(IDirect3DRMViewport *iface)
370 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
372 TRACE("iface %p.\n", iface);
374 return IDirect3DRMViewport2_GetProjection(&viewport->IDirect3DRMViewport2_iface);
377 static HRESULT WINAPI d3drm_viewport1_GetDirect3DViewport(IDirect3DRMViewport *iface,
378 IDirect3DViewport **viewport)
380 FIXME("iface %p, viewport %p stub!\n", iface, viewport);
382 return E_NOTIMPL;
385 static const struct IDirect3DRMViewportVtbl d3drm_viewport1_vtbl =
387 d3drm_viewport1_QueryInterface,
388 d3drm_viewport1_AddRef,
389 d3drm_viewport1_Release,
390 d3drm_viewport1_Clone,
391 d3drm_viewport1_AddDestroyCallback,
392 d3drm_viewport1_DeleteDestroyCallback,
393 d3drm_viewport1_SetAppData,
394 d3drm_viewport1_GetAppData,
395 d3drm_viewport1_SetName,
396 d3drm_viewport1_GetName,
397 d3drm_viewport1_GetClassName,
398 d3drm_viewport1_Init,
399 d3drm_viewport1_Clear,
400 d3drm_viewport1_Render,
401 d3drm_viewport1_SetFront,
402 d3drm_viewport1_SetBack,
403 d3drm_viewport1_SetField,
404 d3drm_viewport1_SetUniformScaling,
405 d3drm_viewport1_SetCamera,
406 d3drm_viewport1_SetProjection,
407 d3drm_viewport1_Transform,
408 d3drm_viewport1_InverseTransform,
409 d3drm_viewport1_Configure,
410 d3drm_viewport1_ForceUpdate,
411 d3drm_viewport1_SetPlane,
412 d3drm_viewport1_GetCamera,
413 d3drm_viewport1_GetDevice,
414 d3drm_viewport1_GetPlane,
415 d3drm_viewport1_Pick,
416 d3drm_viewport1_GetUniformScaling,
417 d3drm_viewport1_GetX,
418 d3drm_viewport1_GetY,
419 d3drm_viewport1_GetWidth,
420 d3drm_viewport1_GetHeight,
421 d3drm_viewport1_GetField,
422 d3drm_viewport1_GetBack,
423 d3drm_viewport1_GetFront,
424 d3drm_viewport1_GetProjection,
425 d3drm_viewport1_GetDirect3DViewport,
428 static HRESULT WINAPI d3drm_viewport2_QueryInterface(IDirect3DRMViewport2 *iface, REFIID riid, void **out)
430 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
432 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
434 return d3drm_viewport1_QueryInterface(&viewport->IDirect3DRMViewport_iface, riid, out);
437 static ULONG WINAPI d3drm_viewport2_AddRef(IDirect3DRMViewport2 *iface)
439 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
441 TRACE("iface %p.\n", iface);
443 return d3drm_viewport1_AddRef(&viewport->IDirect3DRMViewport_iface);
446 static ULONG WINAPI d3drm_viewport2_Release(IDirect3DRMViewport2 *iface)
448 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
450 TRACE("iface %p.\n", iface);
452 return d3drm_viewport1_Release(&viewport->IDirect3DRMViewport_iface);
455 static HRESULT WINAPI d3drm_viewport2_Clone(IDirect3DRMViewport2 *iface,
456 IUnknown *outer, REFIID iid, void **out)
458 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
460 return E_NOTIMPL;
463 static HRESULT WINAPI d3drm_viewport2_AddDestroyCallback(IDirect3DRMViewport2 *iface,
464 D3DRMOBJECTCALLBACK cb, void *ctx)
466 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
468 return E_NOTIMPL;
471 static HRESULT WINAPI d3drm_viewport2_DeleteDestroyCallback(IDirect3DRMViewport2 *iface,
472 D3DRMOBJECTCALLBACK cb, void *ctx)
474 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
476 return E_NOTIMPL;
479 static HRESULT WINAPI d3drm_viewport2_SetAppData(IDirect3DRMViewport2 *iface, DWORD data)
481 FIXME("iface %p, data %#x stub!\n", iface, data);
483 return E_NOTIMPL;
486 static DWORD WINAPI d3drm_viewport2_GetAppData(IDirect3DRMViewport2 *iface)
488 FIXME("iface %p stub!\n", iface);
490 return 0;
493 static HRESULT WINAPI d3drm_viewport2_SetName(IDirect3DRMViewport2 *iface, const char *name)
495 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
497 return E_NOTIMPL;
500 static HRESULT WINAPI d3drm_viewport2_GetName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
502 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
504 return E_NOTIMPL;
507 static HRESULT WINAPI d3drm_viewport2_GetClassName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
509 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
511 if (!size || *size < strlen("Viewport") || !name)
512 return E_INVALIDARG;
514 strcpy(name, "Viewport");
515 *size = sizeof("Viewport");
517 return D3DRM_OK;
520 static HRESULT WINAPI d3drm_viewport2_Init(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 *device,
521 IDirect3DRMFrame3 *camera, DWORD x, DWORD y, DWORD width, DWORD height)
523 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n",
524 iface, device, camera, x, y, width, height);
526 return E_NOTIMPL;
529 static HRESULT WINAPI d3drm_viewport2_Clear(IDirect3DRMViewport2 *iface, DWORD flags)
531 FIXME("iface %p, flags %#x.\n", iface, flags);
533 return D3DRM_OK;
536 static HRESULT WINAPI d3drm_viewport2_Render(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *frame)
538 FIXME("iface %p, frame %p stub!\n", iface, frame);
540 return D3DRM_OK;
543 static HRESULT WINAPI d3drm_viewport2_SetFront(IDirect3DRMViewport2 *iface, D3DVALUE front)
545 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
547 TRACE("iface %p, front %.8e.\n", iface, front);
549 viewport->front = front;
551 return D3DRM_OK;
554 static HRESULT WINAPI d3drm_viewport2_SetBack(IDirect3DRMViewport2 *iface, D3DVALUE back)
556 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
558 TRACE("iface %p, back %.8e.\n", iface, back);
560 viewport->back = back;
562 return D3DRM_OK;
565 static HRESULT WINAPI d3drm_viewport2_SetField(IDirect3DRMViewport2 *iface, D3DVALUE field)
567 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
569 TRACE("iface %p, field %.8e.\n", iface, field);
571 viewport->field = field;
573 return D3DRM_OK;
576 static HRESULT WINAPI d3drm_viewport2_SetUniformScaling(IDirect3DRMViewport2 *iface, BOOL b)
578 FIXME("iface %p, b %#x stub!\n", iface, b);
580 return E_NOTIMPL;
583 static HRESULT WINAPI d3drm_viewport2_SetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *camera)
585 FIXME("iface %p, camera %p stub!\n", iface, camera);
587 return E_NOTIMPL;
590 static HRESULT WINAPI d3drm_viewport2_SetProjection(IDirect3DRMViewport2 *iface, D3DRMPROJECTIONTYPE type)
592 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
594 TRACE("iface %p, type %#x.\n", iface, type);
596 viewport->projection = type;
598 return D3DRM_OK;
601 static HRESULT WINAPI d3drm_viewport2_Transform(IDirect3DRMViewport2 *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
603 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
605 return E_NOTIMPL;
608 static HRESULT WINAPI d3drm_viewport2_InverseTransform(IDirect3DRMViewport2 *iface, D3DVECTOR *d, D3DRMVECTOR4D *s)
610 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
612 return E_NOTIMPL;
615 static HRESULT WINAPI d3drm_viewport2_Configure(IDirect3DRMViewport2 *iface,
616 LONG x, LONG y, DWORD width, DWORD height)
618 FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height);
620 return E_NOTIMPL;
623 static HRESULT WINAPI d3drm_viewport2_ForceUpdate(IDirect3DRMViewport2* iface,
624 DWORD x1, DWORD y1, DWORD x2, DWORD y2)
626 FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2);
628 return E_NOTIMPL;
631 static HRESULT WINAPI d3drm_viewport2_SetPlane(IDirect3DRMViewport2 *iface,
632 D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top)
634 FIXME("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e stub!\n",
635 iface, left, right, bottom, top);
637 return E_NOTIMPL;
640 static HRESULT WINAPI d3drm_viewport2_GetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 **camera)
642 FIXME("iface %p, camera %p stub!\n", iface, camera);
644 return E_NOTIMPL;
647 static HRESULT WINAPI d3drm_viewport2_GetDevice(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 **device)
649 FIXME("iface %p, device %p stub!\n", iface, device);
651 return E_NOTIMPL;
654 static HRESULT WINAPI d3drm_viewport2_GetPlane(IDirect3DRMViewport2 *iface,
655 D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top)
657 FIXME("iface %p, left %p, right %p, bottom %p, top %p stub!\n",
658 iface, left, right, bottom, top);
660 return E_NOTIMPL;
663 static HRESULT WINAPI d3drm_viewport2_Pick(IDirect3DRMViewport2 *iface,
664 LONG x, LONG y, IDirect3DRMPickedArray **visuals)
666 FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals);
668 return E_NOTIMPL;
671 static BOOL WINAPI d3drm_viewport2_GetUniformScaling(IDirect3DRMViewport2 *iface)
673 FIXME("iface %p stub!\n", iface);
675 return E_NOTIMPL;
678 static LONG WINAPI d3drm_viewport2_GetX(IDirect3DRMViewport2 *iface)
680 FIXME("iface %p stub!\n", iface);
682 return E_NOTIMPL;
685 static LONG WINAPI d3drm_viewport2_GetY(IDirect3DRMViewport2 *iface)
687 FIXME("iface %p stub!\n", iface);
689 return E_NOTIMPL;
692 static DWORD WINAPI d3drm_viewport2_GetWidth(IDirect3DRMViewport2 *iface)
694 FIXME("iface %p stub!\n", iface);
696 return E_NOTIMPL;
699 static DWORD WINAPI d3drm_viewport2_GetHeight(IDirect3DRMViewport2 *iface)
701 FIXME("iface %p stub!\n", iface);
703 return E_NOTIMPL;
706 static D3DVALUE WINAPI d3drm_viewport2_GetField(IDirect3DRMViewport2 *iface)
708 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
710 TRACE("iface %p.\n", iface);
712 return viewport->field;
715 static D3DVALUE WINAPI d3drm_viewport2_GetBack(IDirect3DRMViewport2 *iface)
717 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
719 TRACE("iface %p.\n", iface);
721 return viewport->back;
724 static D3DVALUE WINAPI d3drm_viewport2_GetFront(IDirect3DRMViewport2 *iface)
726 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
728 TRACE("iface %p.\n", iface);
730 return viewport->front;
733 static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport2_GetProjection(IDirect3DRMViewport2 *iface)
735 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
737 TRACE("iface %p.\n", iface);
739 return viewport->projection;
742 static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 *iface,
743 IDirect3DViewport **viewport)
745 FIXME("iface %p, viewport %p stub!\n", iface, viewport);
747 return E_NOTIMPL;
750 static HRESULT WINAPI d3drm_viewport2_TransformVectors(IDirect3DRMViewport2 *iface,
751 DWORD vector_count, D3DRMVECTOR4D *dst, D3DVECTOR *src)
753 FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src);
755 return E_NOTIMPL;
758 static HRESULT WINAPI d3drm_viewport2_InverseTransformVectors(IDirect3DRMViewport2 *iface,
759 DWORD vector_count, D3DVECTOR *dst, D3DRMVECTOR4D *src)
761 FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src);
763 return E_NOTIMPL;
766 static const struct IDirect3DRMViewport2Vtbl d3drm_viewport2_vtbl =
768 d3drm_viewport2_QueryInterface,
769 d3drm_viewport2_AddRef,
770 d3drm_viewport2_Release,
771 d3drm_viewport2_Clone,
772 d3drm_viewport2_AddDestroyCallback,
773 d3drm_viewport2_DeleteDestroyCallback,
774 d3drm_viewport2_SetAppData,
775 d3drm_viewport2_GetAppData,
776 d3drm_viewport2_SetName,
777 d3drm_viewport2_GetName,
778 d3drm_viewport2_GetClassName,
779 d3drm_viewport2_Init,
780 d3drm_viewport2_Clear,
781 d3drm_viewport2_Render,
782 d3drm_viewport2_SetFront,
783 d3drm_viewport2_SetBack,
784 d3drm_viewport2_SetField,
785 d3drm_viewport2_SetUniformScaling,
786 d3drm_viewport2_SetCamera,
787 d3drm_viewport2_SetProjection,
788 d3drm_viewport2_Transform,
789 d3drm_viewport2_InverseTransform,
790 d3drm_viewport2_Configure,
791 d3drm_viewport2_ForceUpdate,
792 d3drm_viewport2_SetPlane,
793 d3drm_viewport2_GetCamera,
794 d3drm_viewport2_GetDevice,
795 d3drm_viewport2_GetPlane,
796 d3drm_viewport2_Pick,
797 d3drm_viewport2_GetUniformScaling,
798 d3drm_viewport2_GetX,
799 d3drm_viewport2_GetY,
800 d3drm_viewport2_GetWidth,
801 d3drm_viewport2_GetHeight,
802 d3drm_viewport2_GetField,
803 d3drm_viewport2_GetBack,
804 d3drm_viewport2_GetFront,
805 d3drm_viewport2_GetProjection,
806 d3drm_viewport2_GetDirect3DViewport,
807 d3drm_viewport2_TransformVectors,
808 d3drm_viewport2_InverseTransformVectors,
811 HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown **out)
813 struct d3drm_viewport *object;
815 TRACE("riid %s, out %p.\n", debugstr_guid(riid), out);
817 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
818 return E_OUTOFMEMORY;
820 object->IDirect3DRMViewport_iface.lpVtbl = &d3drm_viewport1_vtbl;
821 object->IDirect3DRMViewport2_iface.lpVtbl = &d3drm_viewport2_vtbl;
822 object->ref = 1;
824 if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2))
825 *out = (IUnknown *)&object->IDirect3DRMViewport2_iface;
826 else
827 *out = (IUnknown *)&object->IDirect3DRMViewport_iface;
829 return S_OK;