[D3DRM] Sync with Wine Staging 1.7.55. CORE-10536
[reactos.git] / reactos / dll / directx / wine / d3drm / viewport.c
1 /*
2 * Implementation of IDirect3DRMViewport Interface
3 *
4 * Copyright 2012 André Hentschel
5 *
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.
10 *
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.
15 *
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
19 */
20
21 #include "d3drm_private.h"
22
23 struct d3drm_viewport
24 {
25 IDirect3DRMViewport IDirect3DRMViewport_iface;
26 IDirect3DRMViewport2 IDirect3DRMViewport2_iface;
27 LONG ref;
28 D3DVALUE back;
29 D3DVALUE front;
30 D3DVALUE field;
31 D3DRMPROJECTIONTYPE projection;
32 };
33
34 static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport(IDirect3DRMViewport *iface)
35 {
36 return CONTAINING_RECORD(iface, struct d3drm_viewport, IDirect3DRMViewport_iface);
37 }
38
39 static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport2(IDirect3DRMViewport2 *iface)
40 {
41 return CONTAINING_RECORD(iface, struct d3drm_viewport, IDirect3DRMViewport2_iface);
42 }
43
44 static HRESULT WINAPI d3drm_viewport1_QueryInterface(IDirect3DRMViewport *iface, REFIID riid, void **out)
45 {
46 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
47
48 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
49
50 if (IsEqualGUID(riid, &IID_IDirect3DRMViewport)
51 || IsEqualGUID(riid, &IID_IUnknown))
52 {
53 *out = &viewport->IDirect3DRMViewport_iface;
54 }
55 else if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2))
56 {
57 *out = &viewport->IDirect3DRMViewport2_iface;
58 }
59 else
60 {
61 *out = NULL;
62 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
63 return E_NOINTERFACE;
64 }
65
66 IUnknown_AddRef((IUnknown *)*out);
67 return S_OK;
68 }
69
70 static ULONG WINAPI d3drm_viewport1_AddRef(IDirect3DRMViewport *iface)
71 {
72 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
73 ULONG refcount = InterlockedIncrement(&viewport->ref);
74
75 TRACE("%p increasing refcount to %u.\n", iface, refcount);
76
77 return refcount;
78 }
79
80 static ULONG WINAPI d3drm_viewport1_Release(IDirect3DRMViewport *iface)
81 {
82 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
83 ULONG refcount = InterlockedDecrement(&viewport->ref);
84
85 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
86
87 if (!refcount)
88 HeapFree(GetProcessHeap(), 0, viewport);
89
90 return refcount;
91 }
92
93 static HRESULT WINAPI d3drm_viewport1_Clone(IDirect3DRMViewport *iface,
94 IUnknown *outer, REFIID iid, void **out)
95 {
96 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
97
98 return E_NOTIMPL;
99 }
100
101 static HRESULT WINAPI d3drm_viewport1_AddDestroyCallback(IDirect3DRMViewport *iface,
102 D3DRMOBJECTCALLBACK cb, void *ctx)
103 {
104 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
105
106 return E_NOTIMPL;
107 }
108
109 static HRESULT WINAPI d3drm_viewport1_DeleteDestroyCallback(IDirect3DRMViewport *iface,
110 D3DRMOBJECTCALLBACK cb, void *ctx)
111 {
112 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
113
114 return E_NOTIMPL;
115 }
116
117 static HRESULT WINAPI d3drm_viewport1_SetAppData(IDirect3DRMViewport *iface, DWORD data)
118 {
119 FIXME("iface %p, data %#x stub!\n", iface, data);
120
121 return E_NOTIMPL;
122 }
123
124 static DWORD WINAPI d3drm_viewport1_GetAppData(IDirect3DRMViewport *iface)
125 {
126 FIXME("iface %p.\n", iface);
127
128 return 0;
129 }
130
131 static HRESULT WINAPI d3drm_viewport1_SetName(IDirect3DRMViewport *iface, const char *name)
132 {
133 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
134
135 return E_NOTIMPL;
136 }
137
138 static HRESULT WINAPI d3drm_viewport1_GetName(IDirect3DRMViewport *iface, DWORD *size, char *name)
139 {
140 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
141
142 return E_NOTIMPL;
143 }
144
145 static HRESULT WINAPI d3drm_viewport1_GetClassName(IDirect3DRMViewport *iface, DWORD *size, char *name)
146 {
147 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
148
149 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
150
151 return IDirect3DRMViewport2_GetClassName(&viewport->IDirect3DRMViewport2_iface, size, name);
152 }
153
154 static HRESULT WINAPI d3drm_viewport1_Init(IDirect3DRMViewport *iface, IDirect3DRMDevice *device,
155 IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height)
156 {
157 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n",
158 iface, device, camera, x, y, width, height);
159
160 return E_NOTIMPL;
161 }
162
163 static HRESULT WINAPI d3drm_viewport1_Clear(IDirect3DRMViewport *iface)
164 {
165 FIXME("iface %p.\n", iface);
166
167 return D3DRM_OK;
168 }
169
170 static HRESULT WINAPI d3drm_viewport1_Render(IDirect3DRMViewport *iface, IDirect3DRMFrame *frame)
171 {
172 FIXME("iface %p, frame %p stub!\n", iface, frame);
173
174 return D3DRM_OK;
175 }
176
177 static HRESULT WINAPI d3drm_viewport1_SetFront(IDirect3DRMViewport *iface, D3DVALUE front)
178 {
179 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
180
181 TRACE("iface %p, front %.8e.\n", iface, front);
182
183 return IDirect3DRMViewport2_SetFront(&viewport->IDirect3DRMViewport2_iface, front);
184 }
185
186 static HRESULT WINAPI d3drm_viewport1_SetBack(IDirect3DRMViewport *iface, D3DVALUE back)
187 {
188 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
189
190 TRACE("iface %p, back %.8e.\n", iface, back);
191
192 return IDirect3DRMViewport2_SetBack(&viewport->IDirect3DRMViewport2_iface, back);
193 }
194
195 static HRESULT WINAPI d3drm_viewport1_SetField(IDirect3DRMViewport *iface, D3DVALUE field)
196 {
197 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
198
199 TRACE("iface %p, field %.8e.\n", iface, field);
200
201 return IDirect3DRMViewport2_SetField(&viewport->IDirect3DRMViewport2_iface, field);
202 }
203
204 static HRESULT WINAPI d3drm_viewport1_SetUniformScaling(IDirect3DRMViewport *iface, BOOL b)
205 {
206 FIXME("iface %p, b %#x stub!\n", iface, b);
207
208 return E_NOTIMPL;
209 }
210
211 static HRESULT WINAPI d3drm_viewport1_SetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame *camera)
212 {
213 FIXME("iface %p, camera %p stub!\n", iface, camera);
214
215 return E_NOTIMPL;
216 }
217
218 static HRESULT WINAPI d3drm_viewport1_SetProjection(IDirect3DRMViewport *iface, D3DRMPROJECTIONTYPE type)
219 {
220 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
221
222 TRACE("iface %p, type %#x.\n", iface, type);
223
224 return IDirect3DRMViewport2_SetProjection(&viewport->IDirect3DRMViewport2_iface, type);
225 }
226
227 static HRESULT WINAPI d3drm_viewport1_Transform(IDirect3DRMViewport *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
228 {
229 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
230
231 return E_NOTIMPL;
232 }
233
234 static HRESULT WINAPI d3drm_viewport1_InverseTransform(IDirect3DRMViewport *iface, D3DVECTOR *d, D3DRMVECTOR4D *s)
235 {
236 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
237
238 return E_NOTIMPL;
239 }
240
241 static HRESULT WINAPI d3drm_viewport1_Configure(IDirect3DRMViewport *iface,
242 LONG x, LONG y, DWORD width, DWORD height)
243 {
244 FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height);
245
246 return E_NOTIMPL;
247 }
248
249 static HRESULT WINAPI d3drm_viewport1_ForceUpdate(IDirect3DRMViewport *iface,
250 DWORD x1, DWORD y1, DWORD x2, DWORD y2)
251 {
252 FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2);
253
254 return E_NOTIMPL;
255 }
256
257 static HRESULT WINAPI d3drm_viewport1_SetPlane(IDirect3DRMViewport *iface,
258 D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top)
259 {
260 FIXME("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e stub!\n",
261 iface, left, right, bottom, top);
262
263 return E_NOTIMPL;
264 }
265
266 static HRESULT WINAPI d3drm_viewport1_GetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame **camera)
267 {
268 FIXME("iface %p, camera %p stub!\n", iface, camera);
269
270 return E_NOTIMPL;
271 }
272
273 static HRESULT WINAPI d3drm_viewport1_GetDevice(IDirect3DRMViewport *iface, IDirect3DRMDevice **device)
274 {
275 FIXME("iface %p, device %p stub!\n", iface, device);
276
277 return E_NOTIMPL;
278 }
279
280 static HRESULT WINAPI d3drm_viewport1_GetPlane(IDirect3DRMViewport *iface,
281 D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top)
282 {
283 FIXME("iface %p, left %p, right %p, bottom %p, top %p stub!\n",
284 iface, left, right, bottom, top);
285
286 return E_NOTIMPL;
287 }
288
289 static HRESULT WINAPI d3drm_viewport1_Pick(IDirect3DRMViewport *iface,
290 LONG x, LONG y, IDirect3DRMPickedArray **visuals)
291 {
292 FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals);
293
294 return E_NOTIMPL;
295 }
296
297 static BOOL WINAPI d3drm_viewport1_GetUniformScaling(IDirect3DRMViewport *iface)
298 {
299 FIXME("iface %p stub!\n", iface);
300
301 return FALSE;
302 }
303
304 static LONG WINAPI d3drm_viewport1_GetX(IDirect3DRMViewport *iface)
305 {
306 FIXME("iface %p stub!\n", iface);
307
308 return E_NOTIMPL;
309 }
310
311 static LONG WINAPI d3drm_viewport1_GetY(IDirect3DRMViewport *iface)
312 {
313 FIXME("iface %p stub!\n", iface);
314
315 return E_NOTIMPL;
316 }
317
318 static DWORD WINAPI d3drm_viewport1_GetWidth(IDirect3DRMViewport *iface)
319 {
320 FIXME("iface %p stub!\n", iface);
321
322 return E_NOTIMPL;
323 }
324
325 static DWORD WINAPI d3drm_viewport1_GetHeight(IDirect3DRMViewport *iface)
326 {
327 FIXME("iface %p stub!\n", iface);
328
329 return E_NOTIMPL;
330 }
331
332 static D3DVALUE WINAPI d3drm_viewport1_GetField(IDirect3DRMViewport *iface)
333 {
334 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
335
336 TRACE("iface %p.\n", iface);
337
338 return IDirect3DRMViewport2_GetField(&viewport->IDirect3DRMViewport2_iface);
339 }
340
341 static D3DVALUE WINAPI d3drm_viewport1_GetBack(IDirect3DRMViewport *iface)
342 {
343 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
344
345 TRACE("iface %p.\n", iface);
346
347 return IDirect3DRMViewport2_GetBack(&viewport->IDirect3DRMViewport2_iface);
348 }
349
350 static D3DVALUE WINAPI d3drm_viewport1_GetFront(IDirect3DRMViewport *iface)
351 {
352 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
353
354 TRACE("iface %p.\n", iface);
355
356 return IDirect3DRMViewport2_GetFront(&viewport->IDirect3DRMViewport2_iface);
357 }
358
359 static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport1_GetProjection(IDirect3DRMViewport *iface)
360 {
361 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
362
363 TRACE("iface %p.\n", iface);
364
365 return IDirect3DRMViewport2_GetProjection(&viewport->IDirect3DRMViewport2_iface);
366 }
367
368 static HRESULT WINAPI d3drm_viewport1_GetDirect3DViewport(IDirect3DRMViewport *iface,
369 IDirect3DViewport **viewport)
370 {
371 FIXME("iface %p, viewport %p stub!\n", iface, viewport);
372
373 return E_NOTIMPL;
374 }
375
376 static const struct IDirect3DRMViewportVtbl d3drm_viewport1_vtbl =
377 {
378 d3drm_viewport1_QueryInterface,
379 d3drm_viewport1_AddRef,
380 d3drm_viewport1_Release,
381 d3drm_viewport1_Clone,
382 d3drm_viewport1_AddDestroyCallback,
383 d3drm_viewport1_DeleteDestroyCallback,
384 d3drm_viewport1_SetAppData,
385 d3drm_viewport1_GetAppData,
386 d3drm_viewport1_SetName,
387 d3drm_viewport1_GetName,
388 d3drm_viewport1_GetClassName,
389 d3drm_viewport1_Init,
390 d3drm_viewport1_Clear,
391 d3drm_viewport1_Render,
392 d3drm_viewport1_SetFront,
393 d3drm_viewport1_SetBack,
394 d3drm_viewport1_SetField,
395 d3drm_viewport1_SetUniformScaling,
396 d3drm_viewport1_SetCamera,
397 d3drm_viewport1_SetProjection,
398 d3drm_viewport1_Transform,
399 d3drm_viewport1_InverseTransform,
400 d3drm_viewport1_Configure,
401 d3drm_viewport1_ForceUpdate,
402 d3drm_viewport1_SetPlane,
403 d3drm_viewport1_GetCamera,
404 d3drm_viewport1_GetDevice,
405 d3drm_viewport1_GetPlane,
406 d3drm_viewport1_Pick,
407 d3drm_viewport1_GetUniformScaling,
408 d3drm_viewport1_GetX,
409 d3drm_viewport1_GetY,
410 d3drm_viewport1_GetWidth,
411 d3drm_viewport1_GetHeight,
412 d3drm_viewport1_GetField,
413 d3drm_viewport1_GetBack,
414 d3drm_viewport1_GetFront,
415 d3drm_viewport1_GetProjection,
416 d3drm_viewport1_GetDirect3DViewport,
417 };
418
419 static HRESULT WINAPI d3drm_viewport2_QueryInterface(IDirect3DRMViewport2 *iface, REFIID riid, void **out)
420 {
421 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
422
423 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
424
425 return d3drm_viewport1_QueryInterface(&viewport->IDirect3DRMViewport_iface, riid, out);
426 }
427
428 static ULONG WINAPI d3drm_viewport2_AddRef(IDirect3DRMViewport2 *iface)
429 {
430 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
431
432 TRACE("iface %p.\n", iface);
433
434 return d3drm_viewport1_AddRef(&viewport->IDirect3DRMViewport_iface);
435 }
436
437 static ULONG WINAPI d3drm_viewport2_Release(IDirect3DRMViewport2 *iface)
438 {
439 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
440
441 TRACE("iface %p.\n", iface);
442
443 return d3drm_viewport1_Release(&viewport->IDirect3DRMViewport_iface);
444 }
445
446 static HRESULT WINAPI d3drm_viewport2_Clone(IDirect3DRMViewport2 *iface,
447 IUnknown *outer, REFIID iid, void **out)
448 {
449 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
450
451 return E_NOTIMPL;
452 }
453
454 static HRESULT WINAPI d3drm_viewport2_AddDestroyCallback(IDirect3DRMViewport2 *iface,
455 D3DRMOBJECTCALLBACK cb, void *ctx)
456 {
457 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
458
459 return E_NOTIMPL;
460 }
461
462 static HRESULT WINAPI d3drm_viewport2_DeleteDestroyCallback(IDirect3DRMViewport2 *iface,
463 D3DRMOBJECTCALLBACK cb, void *ctx)
464 {
465 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
466
467 return E_NOTIMPL;
468 }
469
470 static HRESULT WINAPI d3drm_viewport2_SetAppData(IDirect3DRMViewport2 *iface, DWORD data)
471 {
472 FIXME("iface %p, data %#x stub!\n", iface, data);
473
474 return E_NOTIMPL;
475 }
476
477 static DWORD WINAPI d3drm_viewport2_GetAppData(IDirect3DRMViewport2 *iface)
478 {
479 FIXME("iface %p stub!\n", iface);
480
481 return 0;
482 }
483
484 static HRESULT WINAPI d3drm_viewport2_SetName(IDirect3DRMViewport2 *iface, const char *name)
485 {
486 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
487
488 return E_NOTIMPL;
489 }
490
491 static HRESULT WINAPI d3drm_viewport2_GetName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
492 {
493 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
494
495 return E_NOTIMPL;
496 }
497
498 static HRESULT WINAPI d3drm_viewport2_GetClassName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
499 {
500 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
501
502 if (!size || *size < strlen("Viewport") || !name)
503 return E_INVALIDARG;
504
505 strcpy(name, "Viewport");
506 *size = sizeof("Viewport");
507
508 return D3DRM_OK;
509 }
510
511 static HRESULT WINAPI d3drm_viewport2_Init(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 *device,
512 IDirect3DRMFrame3 *camera, DWORD x, DWORD y, DWORD width, DWORD height)
513 {
514 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n",
515 iface, device, camera, x, y, width, height);
516
517 return E_NOTIMPL;
518 }
519
520 static HRESULT WINAPI d3drm_viewport2_Clear(IDirect3DRMViewport2 *iface, DWORD flags)
521 {
522 FIXME("iface %p, flags %#x.\n", iface, flags);
523
524 return D3DRM_OK;
525 }
526
527 static HRESULT WINAPI d3drm_viewport2_Render(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *frame)
528 {
529 FIXME("iface %p, frame %p stub!\n", iface, frame);
530
531 return D3DRM_OK;
532 }
533
534 static HRESULT WINAPI d3drm_viewport2_SetFront(IDirect3DRMViewport2 *iface, D3DVALUE front)
535 {
536 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
537
538 TRACE("iface %p, front %.8e.\n", iface, front);
539
540 viewport->front = front;
541
542 return D3DRM_OK;
543 }
544
545 static HRESULT WINAPI d3drm_viewport2_SetBack(IDirect3DRMViewport2 *iface, D3DVALUE back)
546 {
547 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
548
549 TRACE("iface %p, back %.8e.\n", iface, back);
550
551 viewport->back = back;
552
553 return D3DRM_OK;
554 }
555
556 static HRESULT WINAPI d3drm_viewport2_SetField(IDirect3DRMViewport2 *iface, D3DVALUE field)
557 {
558 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
559
560 TRACE("iface %p, field %.8e.\n", iface, field);
561
562 viewport->field = field;
563
564 return D3DRM_OK;
565 }
566
567 static HRESULT WINAPI d3drm_viewport2_SetUniformScaling(IDirect3DRMViewport2 *iface, BOOL b)
568 {
569 FIXME("iface %p, b %#x stub!\n", iface, b);
570
571 return E_NOTIMPL;
572 }
573
574 static HRESULT WINAPI d3drm_viewport2_SetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *camera)
575 {
576 FIXME("iface %p, camera %p stub!\n", iface, camera);
577
578 return E_NOTIMPL;
579 }
580
581 static HRESULT WINAPI d3drm_viewport2_SetProjection(IDirect3DRMViewport2 *iface, D3DRMPROJECTIONTYPE type)
582 {
583 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
584
585 TRACE("iface %p, type %#x.\n", iface, type);
586
587 viewport->projection = type;
588
589 return D3DRM_OK;
590 }
591
592 static HRESULT WINAPI d3drm_viewport2_Transform(IDirect3DRMViewport2 *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
593 {
594 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
595
596 return E_NOTIMPL;
597 }
598
599 static HRESULT WINAPI d3drm_viewport2_InverseTransform(IDirect3DRMViewport2 *iface, D3DVECTOR *d, D3DRMVECTOR4D *s)
600 {
601 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
602
603 return E_NOTIMPL;
604 }
605
606 static HRESULT WINAPI d3drm_viewport2_Configure(IDirect3DRMViewport2 *iface,
607 LONG x, LONG y, DWORD width, DWORD height)
608 {
609 FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height);
610
611 return E_NOTIMPL;
612 }
613
614 static HRESULT WINAPI d3drm_viewport2_ForceUpdate(IDirect3DRMViewport2* iface,
615 DWORD x1, DWORD y1, DWORD x2, DWORD y2)
616 {
617 FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2);
618
619 return E_NOTIMPL;
620 }
621
622 static HRESULT WINAPI d3drm_viewport2_SetPlane(IDirect3DRMViewport2 *iface,
623 D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top)
624 {
625 FIXME("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e stub!\n",
626 iface, left, right, bottom, top);
627
628 return E_NOTIMPL;
629 }
630
631 static HRESULT WINAPI d3drm_viewport2_GetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 **camera)
632 {
633 FIXME("iface %p, camera %p stub!\n", iface, camera);
634
635 return E_NOTIMPL;
636 }
637
638 static HRESULT WINAPI d3drm_viewport2_GetDevice(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 **device)
639 {
640 FIXME("iface %p, device %p stub!\n", iface, device);
641
642 return E_NOTIMPL;
643 }
644
645 static HRESULT WINAPI d3drm_viewport2_GetPlane(IDirect3DRMViewport2 *iface,
646 D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top)
647 {
648 FIXME("iface %p, left %p, right %p, bottom %p, top %p stub!\n",
649 iface, left, right, bottom, top);
650
651 return E_NOTIMPL;
652 }
653
654 static HRESULT WINAPI d3drm_viewport2_Pick(IDirect3DRMViewport2 *iface,
655 LONG x, LONG y, IDirect3DRMPickedArray **visuals)
656 {
657 FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals);
658
659 return E_NOTIMPL;
660 }
661
662 static BOOL WINAPI d3drm_viewport2_GetUniformScaling(IDirect3DRMViewport2 *iface)
663 {
664 FIXME("iface %p stub!\n", iface);
665
666 return FALSE;
667 }
668
669 static LONG WINAPI d3drm_viewport2_GetX(IDirect3DRMViewport2 *iface)
670 {
671 FIXME("iface %p stub!\n", iface);
672
673 return E_NOTIMPL;
674 }
675
676 static LONG WINAPI d3drm_viewport2_GetY(IDirect3DRMViewport2 *iface)
677 {
678 FIXME("iface %p stub!\n", iface);
679
680 return E_NOTIMPL;
681 }
682
683 static DWORD WINAPI d3drm_viewport2_GetWidth(IDirect3DRMViewport2 *iface)
684 {
685 FIXME("iface %p stub!\n", iface);
686
687 return E_NOTIMPL;
688 }
689
690 static DWORD WINAPI d3drm_viewport2_GetHeight(IDirect3DRMViewport2 *iface)
691 {
692 FIXME("iface %p stub!\n", iface);
693
694 return E_NOTIMPL;
695 }
696
697 static D3DVALUE WINAPI d3drm_viewport2_GetField(IDirect3DRMViewport2 *iface)
698 {
699 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
700
701 TRACE("iface %p.\n", iface);
702
703 return viewport->field;
704 }
705
706 static D3DVALUE WINAPI d3drm_viewport2_GetBack(IDirect3DRMViewport2 *iface)
707 {
708 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
709
710 TRACE("iface %p.\n", iface);
711
712 return viewport->back;
713 }
714
715 static D3DVALUE WINAPI d3drm_viewport2_GetFront(IDirect3DRMViewport2 *iface)
716 {
717 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
718
719 TRACE("iface %p.\n", iface);
720
721 return viewport->front;
722 }
723
724 static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport2_GetProjection(IDirect3DRMViewport2 *iface)
725 {
726 struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
727
728 TRACE("iface %p.\n", iface);
729
730 return viewport->projection;
731 }
732
733 static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 *iface,
734 IDirect3DViewport **viewport)
735 {
736 FIXME("iface %p, viewport %p stub!\n", iface, viewport);
737
738 return E_NOTIMPL;
739 }
740
741 static HRESULT WINAPI d3drm_viewport2_TransformVectors(IDirect3DRMViewport2 *iface,
742 DWORD vector_count, D3DRMVECTOR4D *dst, D3DVECTOR *src)
743 {
744 FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src);
745
746 return E_NOTIMPL;
747 }
748
749 static HRESULT WINAPI d3drm_viewport2_InverseTransformVectors(IDirect3DRMViewport2 *iface,
750 DWORD vector_count, D3DVECTOR *dst, D3DRMVECTOR4D *src)
751 {
752 FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src);
753
754 return E_NOTIMPL;
755 }
756
757 static const struct IDirect3DRMViewport2Vtbl d3drm_viewport2_vtbl =
758 {
759 d3drm_viewport2_QueryInterface,
760 d3drm_viewport2_AddRef,
761 d3drm_viewport2_Release,
762 d3drm_viewport2_Clone,
763 d3drm_viewport2_AddDestroyCallback,
764 d3drm_viewport2_DeleteDestroyCallback,
765 d3drm_viewport2_SetAppData,
766 d3drm_viewport2_GetAppData,
767 d3drm_viewport2_SetName,
768 d3drm_viewport2_GetName,
769 d3drm_viewport2_GetClassName,
770 d3drm_viewport2_Init,
771 d3drm_viewport2_Clear,
772 d3drm_viewport2_Render,
773 d3drm_viewport2_SetFront,
774 d3drm_viewport2_SetBack,
775 d3drm_viewport2_SetField,
776 d3drm_viewport2_SetUniformScaling,
777 d3drm_viewport2_SetCamera,
778 d3drm_viewport2_SetProjection,
779 d3drm_viewport2_Transform,
780 d3drm_viewport2_InverseTransform,
781 d3drm_viewport2_Configure,
782 d3drm_viewport2_ForceUpdate,
783 d3drm_viewport2_SetPlane,
784 d3drm_viewport2_GetCamera,
785 d3drm_viewport2_GetDevice,
786 d3drm_viewport2_GetPlane,
787 d3drm_viewport2_Pick,
788 d3drm_viewport2_GetUniformScaling,
789 d3drm_viewport2_GetX,
790 d3drm_viewport2_GetY,
791 d3drm_viewport2_GetWidth,
792 d3drm_viewport2_GetHeight,
793 d3drm_viewport2_GetField,
794 d3drm_viewport2_GetBack,
795 d3drm_viewport2_GetFront,
796 d3drm_viewport2_GetProjection,
797 d3drm_viewport2_GetDirect3DViewport,
798 d3drm_viewport2_TransformVectors,
799 d3drm_viewport2_InverseTransformVectors,
800 };
801
802 HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown **out)
803 {
804 struct d3drm_viewport *object;
805
806 TRACE("riid %s, out %p.\n", debugstr_guid(riid), out);
807
808 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
809 return E_OUTOFMEMORY;
810
811 object->IDirect3DRMViewport_iface.lpVtbl = &d3drm_viewport1_vtbl;
812 object->IDirect3DRMViewport2_iface.lpVtbl = &d3drm_viewport2_vtbl;
813 object->ref = 1;
814
815 if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2))
816 *out = (IUnknown *)&object->IDirect3DRMViewport2_iface;
817 else
818 *out = (IUnknown *)&object->IDirect3DRMViewport_iface;
819
820 return S_OK;
821 }