ReactOS  0.4.14-dev-293-g2b39b42
viewport.c
Go to the documentation of this file.
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 
24 
25 static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport(IDirect3DRMViewport *iface)
26 {
28 }
29 
30 static inline struct d3drm_viewport *impl_from_IDirect3DRMViewport2(IDirect3DRMViewport2 *iface)
31 {
33 }
34 
35 static inline void d3drm_normalize_d3d_color(D3DCOLORVALUE *color_value, D3DCOLOR color)
36 {
37  color_value->u1.r = RGBA_GETRED(color) / 255.0f;
38  color_value->u2.g = RGBA_GETGREEN(color) / 255.0f;
39  color_value->u3.b = RGBA_GETBLUE(color) / 255.0f;
40  color_value->u4.a = RGBA_GETALPHA(color) / 255.0f;
41 }
42 
44 {
45  IDirect3DRMFrame *root_frame;
48  HRESULT hr;
49 
50  if (FAILED(hr = IDirect3DRMFrame_GetScene(viewport->camera, &root_frame)))
51  return hr;
53  IDirect3DRMFrame_Release(root_frame);
54 
55  memset(&mat, 0, sizeof(mat));
56  mat.dwSize = sizeof(mat);
57  d3drm_normalize_d3d_color(&mat.u.diffuse, color);
58 
59  return IDirect3DMaterial_SetMaterial(viewport->material, &mat);
60 }
61 
62 static void d3drm_viewport_destroy(struct d3drm_viewport *viewport)
63 {
64  TRACE("viewport %p releasing attached interfaces.\n", viewport);
65 
66  d3drm_object_cleanup((IDirect3DRMObject *)&viewport->IDirect3DRMViewport_iface, &viewport->obj);
67 
68  if (viewport->d3d_viewport)
69  {
73  IDirect3DRM_Release(viewport->d3drm);
74  }
75 
76  heap_free(viewport);
77 }
78 
79 static HRESULT WINAPI d3drm_viewport2_QueryInterface(IDirect3DRMViewport2 *iface, REFIID riid, void **out)
80 {
81  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
82 
83  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
84 
85  if (IsEqualGUID(riid, &IID_IDirect3DRMViewport)
86  || IsEqualGUID(riid, &IID_IDirect3DRMObject)
88  {
89  *out = &viewport->IDirect3DRMViewport_iface;
90  }
91  else if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2))
92  {
93  *out = &viewport->IDirect3DRMViewport2_iface;
94  }
95  else
96  {
97  *out = NULL;
98  WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
100  }
101 
102  IUnknown_AddRef((IUnknown *)*out);
103  return S_OK;
104 }
105 
106 static HRESULT WINAPI d3drm_viewport1_QueryInterface(IDirect3DRMViewport *iface, REFIID riid, void **out)
107 {
108  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
109 
110  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
111 
113 }
114 
115 static ULONG WINAPI d3drm_viewport2_AddRef(IDirect3DRMViewport2 *iface)
116 {
117  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
118  ULONG refcount = InterlockedIncrement(&viewport->obj.ref);
119 
120  TRACE("%p increasing refcount to %u.\n", iface, refcount);
121 
122  return refcount;
123 }
124 
125 static ULONG WINAPI d3drm_viewport1_AddRef(IDirect3DRMViewport *iface)
126 {
127  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
128 
129  TRACE("iface %p.\n", iface);
130 
132 }
133 
134 static ULONG WINAPI d3drm_viewport2_Release(IDirect3DRMViewport2 *iface)
135 {
136  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
137  ULONG refcount = InterlockedDecrement(&viewport->obj.ref);
138 
139  TRACE("%p decreasing refcount to %u.\n", iface, refcount);
140 
141  if (!refcount)
142  d3drm_viewport_destroy(viewport);
143 
144  return refcount;
145 }
146 
147 static ULONG WINAPI d3drm_viewport1_Release(IDirect3DRMViewport *iface)
148 {
149  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
150 
151  TRACE("iface %p.\n", iface);
152 
154 }
155 
156 static HRESULT WINAPI d3drm_viewport2_Clone(IDirect3DRMViewport2 *iface,
157  IUnknown *outer, REFIID iid, void **out)
158 {
159  FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
160 
161  return E_NOTIMPL;
162 }
163 
164 static HRESULT WINAPI d3drm_viewport1_Clone(IDirect3DRMViewport *iface,
165  IUnknown *outer, REFIID iid, void **out)
166 {
167  FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
168 
169  return E_NOTIMPL;
170 }
171 
172 static HRESULT WINAPI d3drm_viewport2_AddDestroyCallback(IDirect3DRMViewport2 *iface,
173  D3DRMOBJECTCALLBACK cb, void *ctx)
174 {
175  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
176 
177  TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
178 
179  return d3drm_object_add_destroy_callback(&viewport->obj, cb, ctx);
180 }
181 
182 static HRESULT WINAPI d3drm_viewport1_AddDestroyCallback(IDirect3DRMViewport *iface,
183  D3DRMOBJECTCALLBACK cb, void *ctx)
184 {
185  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
186 
187  TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
188 
190 }
191 
192 static HRESULT WINAPI d3drm_viewport2_DeleteDestroyCallback(IDirect3DRMViewport2 *iface,
193  D3DRMOBJECTCALLBACK cb, void *ctx)
194 {
195  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
196 
197  TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
198 
199  return d3drm_object_delete_destroy_callback(&viewport->obj, cb, ctx);
200 }
201 
202 static HRESULT WINAPI d3drm_viewport1_DeleteDestroyCallback(IDirect3DRMViewport *iface,
203  D3DRMOBJECTCALLBACK cb, void *ctx)
204 {
205  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
206 
207  TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
208 
210 }
211 
212 static HRESULT WINAPI d3drm_viewport2_SetAppData(IDirect3DRMViewport2 *iface, DWORD data)
213 {
214  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
215 
216  TRACE("iface %p, data %#x\n", iface, data);
217 
218  viewport->obj.appdata = data;
219  return S_OK;
220 }
221 
222 static HRESULT WINAPI d3drm_viewport1_SetAppData(IDirect3DRMViewport *iface, DWORD data)
223 {
224  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
225 
226  TRACE("iface %p, data %#x\n", iface, data);
227 
229 }
230 
231 static DWORD WINAPI d3drm_viewport2_GetAppData(IDirect3DRMViewport2 *iface)
232 {
233  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
234 
235  TRACE("iface %p\n", iface);
236 
237  return viewport->obj.appdata;
238 }
239 
240 static DWORD WINAPI d3drm_viewport1_GetAppData(IDirect3DRMViewport *iface)
241 {
242  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
243 
244  TRACE("iface %p.\n", iface);
245 
247 }
248 
249 static HRESULT WINAPI d3drm_viewport2_SetName(IDirect3DRMViewport2 *iface, const char *name)
250 {
251  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
252 
253  TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
254 
255  return d3drm_object_set_name(&viewport->obj, name);
256 }
257 
258 static HRESULT WINAPI d3drm_viewport1_SetName(IDirect3DRMViewport *iface, const char *name)
259 {
260  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
261 
262  TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
263 
265 }
266 
267 static HRESULT WINAPI d3drm_viewport2_GetName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
268 {
269  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
270 
271  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
272 
273  return d3drm_object_get_name(&viewport->obj, size, name);
274 }
275 
276 static HRESULT WINAPI d3drm_viewport1_GetName(IDirect3DRMViewport *iface, DWORD *size, char *name)
277 {
278  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
279 
280  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
281 
283 }
284 
285 static HRESULT WINAPI d3drm_viewport2_GetClassName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
286 {
287  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
288 
289  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
290 
291  return d3drm_object_get_class_name(&viewport->obj, size, name);
292 }
293 
294 static HRESULT WINAPI d3drm_viewport1_GetClassName(IDirect3DRMViewport *iface, DWORD *size, char *name)
295 {
296  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
297 
298  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
299 
301 }
302 
303 static HRESULT WINAPI d3drm_viewport2_Init(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 *device,
304  IDirect3DRMFrame3 *camera, DWORD x, DWORD y, DWORD width, DWORD height)
305 {
306  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
308  D3DVIEWPORT vp;
309  D3DVALUE scale;
310  IDirect3D *d3d1 = NULL;
311  IDirect3DDevice *d3d_device = NULL;
312  IDirect3DMaterial *material = NULL;
313  D3DMATERIALHANDLE hmat;
314  HRESULT hr = D3DRM_OK;
315 
316  TRACE("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u.\n",
317  iface, device, camera, x, y, width, height);
318 
319  if (!device_obj || !camera
320  || width > device_obj->width
321  || height > device_obj->height)
322  {
323  return D3DRMERR_BADOBJECT;
324  }
325 
326  if (viewport->d3d_viewport)
327  return D3DRMERR_BADOBJECT;
328 
329  IDirect3DRM_AddRef(viewport->d3drm);
330 
332  goto cleanup;
333 
335  goto cleanup;
336 
337  if (FAILED(hr = IDirect3D_CreateViewport(d3d1, &viewport->d3d_viewport, NULL)))
338  goto cleanup;
339 
341  goto cleanup;
342 
343  vp.dwSize = sizeof(vp);
344  vp.dwWidth = width;
345  vp.dwHeight = height;
346  vp.dwX = x;
347  vp.dwY = y;
348  scale = width > height ? (float)width / 2.0f : (float)height / 2.0f;
349  vp.dvScaleX = scale;
350  vp.dvScaleY = scale;
351  vp.dvMaxX = vp.dwWidth / (2.0f * vp.dvScaleX);
352  vp.dvMaxY = vp.dwHeight / (2.0f * vp.dvScaleY);
353  vp.dvMinZ = 0.0f;
354  vp.dvMaxZ = 1.0f;
355 
356  if (FAILED(hr = IDirect3DViewport_SetViewport(viewport->d3d_viewport, &vp)))
357  goto cleanup;
358 
359  if (FAILED(hr = IDirect3DRMFrame3_QueryInterface(camera, &IID_IDirect3DRMFrame, (void **)&viewport->camera)))
360  goto cleanup;
361 
362  if (FAILED(hr = IDirect3D_CreateMaterial(d3d1, &material, NULL)))
363  goto cleanup;
364 
365  if (FAILED(hr = IDirect3DMaterial_GetHandle(material, d3d_device, &hmat)))
366  goto cleanup;
367 
369  viewport->material = material;
370  viewport->device = device_obj;
371 
372  viewport->clip.left = -0.5f;
373  viewport->clip.top = 0.5f;
374  viewport->clip.right = 0.5f;
375  viewport->clip.bottom = -0.5f;
376  viewport->clip.front = 1.0f;
377  viewport->clip.back = 100.0f;
378 
379 cleanup:
380 
381  if (FAILED(hr))
382  {
383  if (viewport->d3d_viewport)
384  {
386  viewport->d3d_viewport = NULL;
387  }
388  if (viewport->camera)
389  IDirect3DRMFrame_Release(viewport->camera);
390  if (material)
391  IDirect3DMaterial_Release(material);
392  IDirect3DRM_Release(viewport->d3drm);
393  }
394  if (d3d_device)
396  if (d3d1)
397  IDirect3D_Release(d3d1);
398 
399  return hr;
400 }
401 
402 static HRESULT WINAPI d3drm_viewport1_Init(IDirect3DRMViewport *iface, IDirect3DRMDevice *device,
403  IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height)
404 {
405  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
406  struct d3drm_frame *frame = unsafe_impl_from_IDirect3DRMFrame(camera);
407  IDirect3DRMDevice3 *device3;
408  HRESULT hr;
409 
410  TRACE("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u.\n",
411  iface, device, camera, x, y, width, height);
412 
413  if (!device || !frame)
414  return D3DRMERR_BADOBJECT;
415 
416  if (FAILED(hr = IDirect3DRMDevice_QueryInterface(device, &IID_IDirect3DRMDevice3, (void **)&device3)))
417  return hr;
418 
420  x, y, width, height);
422 
423  return hr;
424 }
425 
426 static HRESULT WINAPI d3drm_viewport2_Clear(IDirect3DRMViewport2 *iface, DWORD flags)
427 {
428  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
429  DDSCAPS caps = { DDSCAPS_ZBUFFER };
430  HRESULT hr;
431  D3DRECT clear_rect;
432  IDirectDrawSurface *ds;
433  DWORD clear_flags = 0;
434 
435  TRACE("iface %p, flags %#x.\n", iface, flags);
436 
437  clear_rect.u1.x1 = clear_rect.u2.y1 = 0;
438  clear_rect.u3.x2 = viewport->device->width;
439  clear_rect.u4.y2 = viewport->device->height;
440 
441  if (flags & D3DRMCLEAR_TARGET)
442  {
443  clear_flags |= D3DCLEAR_TARGET;
445  }
447  {
448  hr = IDirectDrawSurface_GetAttachedSurface(viewport->device->render_target, &caps, &ds);
449  if (SUCCEEDED(hr))
450  {
451  clear_flags |= D3DCLEAR_ZBUFFER;
452  IDirectDrawSurface_Release(ds);
453  }
454  }
456  FIXME("Flag D3DRMCLEAR_DIRTYRECT not implemented yet.\n");
457 
458  if (FAILED(hr = IDirect3DViewport_Clear(viewport->d3d_viewport, 1, &clear_rect, clear_flags)))
459  return hr;
460 
461  return D3DRM_OK;
462 }
463 
464 static HRESULT WINAPI d3drm_viewport1_Clear(IDirect3DRMViewport *iface)
465 {
466  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
467 
468  TRACE("iface %p.\n", iface);
469 
471 }
472 
473 static HRESULT WINAPI d3drm_viewport2_Render(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *frame)
474 {
475  FIXME("iface %p, frame %p stub!\n", iface, frame);
476 
477  return D3DRM_OK;
478 }
479 
480 static HRESULT WINAPI d3drm_viewport1_Render(IDirect3DRMViewport *iface, IDirect3DRMFrame *frame)
481 {
482  FIXME("iface %p, frame %p stub!\n", iface, frame);
483 
484  return D3DRM_OK;
485 }
486 
487 static HRESULT WINAPI d3drm_viewport2_SetFront(IDirect3DRMViewport2 *iface, D3DVALUE front)
488 {
489  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
490 
491  TRACE("iface %p, front %.8e.\n", iface, front);
492 
493  if (!viewport->d3d_viewport)
494  return D3DRMERR_BADOBJECT;
495 
496  if (front <= 0.0f)
497  return D3DRMERR_BADVALUE;
498 
499  viewport->clip.front = front;
500 
501  return D3DRM_OK;
502 }
503 
504 static HRESULT WINAPI d3drm_viewport1_SetFront(IDirect3DRMViewport *iface, D3DVALUE front)
505 {
506  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
507 
508  TRACE("iface %p, front %.8e.\n", iface, front);
509 
511 }
512 
513 static HRESULT WINAPI d3drm_viewport2_SetBack(IDirect3DRMViewport2 *iface, D3DVALUE back)
514 {
515  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
516 
517  TRACE("iface %p, back %.8e.\n", iface, back);
518 
519  if (!viewport->d3d_viewport)
520  return D3DRMERR_BADOBJECT;
521 
522  if (back <= viewport->clip.front)
523  return D3DRMERR_BADVALUE;
524 
525  viewport->clip.back = back;
526 
527  return D3DRM_OK;
528 }
529 
530 static HRESULT WINAPI d3drm_viewport1_SetBack(IDirect3DRMViewport *iface, D3DVALUE back)
531 {
532  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
533 
534  TRACE("iface %p, back %.8e.\n", iface, back);
535 
536  return d3drm_viewport2_SetBack(&viewport->IDirect3DRMViewport2_iface, back);
537 }
538 
539 static HRESULT WINAPI d3drm_viewport2_SetField(IDirect3DRMViewport2 *iface, D3DVALUE field)
540 {
541  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
542 
543  TRACE("iface %p, field %.8e.\n", iface, field);
544 
545  if (!viewport->d3d_viewport)
546  return D3DRMERR_BADOBJECT;
547 
548  if (field <= 0.0f)
549  return D3DRMERR_BADVALUE;
550 
551  viewport->clip.left = -field;
552  viewport->clip.right = field;
553  viewport->clip.bottom = -field;
554  viewport->clip.top = field;
555 
556  return D3DRM_OK;
557 }
558 
559 static HRESULT WINAPI d3drm_viewport1_SetField(IDirect3DRMViewport *iface, D3DVALUE field)
560 {
561  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
562 
563  TRACE("iface %p, field %.8e.\n", iface, field);
564 
566 }
567 
568 static HRESULT WINAPI d3drm_viewport2_SetUniformScaling(IDirect3DRMViewport2 *iface, BOOL b)
569 {
570  FIXME("iface %p, b %#x stub!\n", iface, b);
571 
572  return E_NOTIMPL;
573 }
574 
575 static HRESULT WINAPI d3drm_viewport1_SetUniformScaling(IDirect3DRMViewport *iface, BOOL b)
576 {
577  FIXME("iface %p, b %#x stub!\n", iface, b);
578 
579  return E_NOTIMPL;
580 }
581 
582 static HRESULT WINAPI d3drm_viewport2_SetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *camera)
583 {
584  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
585  struct d3drm_frame *frame = unsafe_impl_from_IDirect3DRMFrame3(camera);
586 
587  TRACE("iface %p, camera %p.\n", iface, camera);
588 
589  if (!camera || !viewport->camera)
590  return D3DRMERR_BADOBJECT;
591 
593  IDirect3DRMFrame_Release(viewport->camera);
594  viewport->camera = &frame->IDirect3DRMFrame_iface;
595 
596  return D3DRM_OK;
597 }
598 
599 static HRESULT WINAPI d3drm_viewport1_SetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame *camera)
600 {
601  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
602  struct d3drm_frame *frame = unsafe_impl_from_IDirect3DRMFrame(camera);
603 
604  TRACE("iface %p, camera %p.\n", iface, camera);
605 
607  frame ? &frame->IDirect3DRMFrame3_iface : NULL);
608 }
609 
611 {
612  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
613 
614  TRACE("iface %p, type %#x.\n", iface, type);
615 
616  viewport->projection = type;
617 
618  return D3DRM_OK;
619 }
620 
622 {
623  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
624 
625  TRACE("iface %p, type %#x.\n", iface, type);
626 
628 }
629 
630 static HRESULT WINAPI d3drm_viewport2_Transform(IDirect3DRMViewport2 *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
631 {
632  FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
633 
634  return E_NOTIMPL;
635 }
636 
637 static HRESULT WINAPI d3drm_viewport1_Transform(IDirect3DRMViewport *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
638 {
639  FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
640 
641  return E_NOTIMPL;
642 }
643 
645 {
646  FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
647 
648  return E_NOTIMPL;
649 }
650 
652 {
653  FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
654 
655  return E_NOTIMPL;
656 }
657 
658 static HRESULT WINAPI d3drm_viewport2_Configure(IDirect3DRMViewport2 *iface,
660 {
661  FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height);
662 
663  return E_NOTIMPL;
664 }
665 
666 static HRESULT WINAPI d3drm_viewport1_Configure(IDirect3DRMViewport *iface,
668 {
669  FIXME("iface %p, x %d, y %d, width %u, height %u stub!\n", iface, x, y, width, height);
670 
671  return E_NOTIMPL;
672 }
673 
674 static HRESULT WINAPI d3drm_viewport2_ForceUpdate(IDirect3DRMViewport2* iface,
676 {
677  FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2);
678 
679  return E_NOTIMPL;
680 }
681 
682 static HRESULT WINAPI d3drm_viewport1_ForceUpdate(IDirect3DRMViewport *iface,
684 {
685  FIXME("iface %p, x1 %u, y1 %u, x2 %u, y2 %u stub!\n", iface, x1, y1, x2, y2);
686 
687  return E_NOTIMPL;
688 }
689 
690 static HRESULT WINAPI d3drm_viewport2_SetPlane(IDirect3DRMViewport2 *iface,
692 {
693  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
694 
695  TRACE("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e.\n",
696  iface, left, right, bottom, top);
697 
698  if (!viewport->d3d_viewport)
699  return D3DRMERR_BADOBJECT;
700 
701  viewport->clip.left = left;
702  viewport->clip.right = right;
703  viewport->clip.bottom = bottom;
704  viewport->clip.top = top;
705 
706  return D3DRM_OK;
707 }
708 
709 static HRESULT WINAPI d3drm_viewport1_SetPlane(IDirect3DRMViewport *iface,
711 {
712  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
713 
714  TRACE("iface %p, left %.8e, right %.8e, bottom %.8e, top %.8e.\n",
715  iface, left, right, bottom, top);
716 
718 }
719 
720 static HRESULT WINAPI d3drm_viewport2_GetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 **camera)
721 {
722  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
723 
724  TRACE("iface %p, camera %p.\n", iface, camera);
725 
726  if (!camera)
727  return D3DRMERR_BADVALUE;
728 
729  if (!viewport->camera)
730  return D3DRMERR_BADOBJECT;
731 
732  return IDirect3DRMFrame_QueryInterface(viewport->camera, &IID_IDirect3DRMFrame3, (void **)camera);
733 }
734 
735 static HRESULT WINAPI d3drm_viewport1_GetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame **camera)
736 {
737  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
738  struct d3drm_frame *camera_impl;
739  IDirect3DRMFrame3 *camera3;
740  HRESULT hr;
741 
742  TRACE("iface %p, camera %p.\n", iface, camera);
743 
744  if (!camera)
745  return D3DRMERR_BADVALUE;
746 
747  if (FAILED(hr = d3drm_viewport2_GetCamera(&viewport->IDirect3DRMViewport2_iface, &camera3)))
748  return hr;
749 
750  camera_impl = unsafe_impl_from_IDirect3DRMFrame3(camera3);
751  *camera = &camera_impl->IDirect3DRMFrame_iface;
752 
753  return D3DRM_OK;
754 }
755 
756 static HRESULT WINAPI d3drm_viewport2_GetDevice(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 **device)
757 {
758  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
759 
760  TRACE("iface %p, device %p.\n", iface, device);
761 
762  if (!device)
763  return D3DRMERR_BADVALUE;
764 
765  if (!viewport->device)
766  return D3DRMERR_BADOBJECT;
767 
768  *device = &viewport->device->IDirect3DRMDevice3_iface;
770 
771  return D3DRM_OK;
772 }
773 
774 static HRESULT WINAPI d3drm_viewport1_GetDevice(IDirect3DRMViewport *iface, IDirect3DRMDevice **device)
775 {
776  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
777 
778  TRACE("iface %p, device %p.\n\n", iface, device);
779 
780  if (!device)
781  return D3DRMERR_BADVALUE;
782 
783  if (!viewport->device)
784  return D3DRMERR_BADOBJECT;
785 
786  *device = &viewport->device->IDirect3DRMDevice_iface;
788 
789  return D3DRM_OK;
790 }
791 
792 static HRESULT WINAPI d3drm_viewport2_GetPlane(IDirect3DRMViewport2 *iface,
794 {
795  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
796 
797  TRACE("iface %p, left %p, right %p, bottom %p, top %p.\n",
798  iface, left, right, bottom, top);
799 
800  if (!viewport->d3d_viewport)
801  return D3DRMERR_BADOBJECT;
802 
803  *left = viewport->clip.left;
804  *right = viewport->clip.right;
805  *bottom = viewport->clip.bottom;
806  *top = viewport->clip.top;
807 
808  return D3DRM_OK;
809 }
810 
811 static HRESULT WINAPI d3drm_viewport1_GetPlane(IDirect3DRMViewport *iface,
813 {
814  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
815 
816  TRACE("iface %p, left %p, right %p, bottom %p, top %p.\n",
817  iface, left, right, bottom, top);
818 
820 }
821 
822 static HRESULT WINAPI d3drm_viewport2_Pick(IDirect3DRMViewport2 *iface,
823  LONG x, LONG y, IDirect3DRMPickedArray **visuals)
824 {
825  FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals);
826 
827  return E_NOTIMPL;
828 }
829 
830 static HRESULT WINAPI d3drm_viewport1_Pick(IDirect3DRMViewport *iface,
831  LONG x, LONG y, IDirect3DRMPickedArray **visuals)
832 {
833  FIXME("iface %p, x %d, y %d, visuals %p stub!\n", iface, x, y, visuals);
834 
835  return E_NOTIMPL;
836 }
837 
838 static BOOL WINAPI d3drm_viewport2_GetUniformScaling(IDirect3DRMViewport2 *iface)
839 {
840  FIXME("iface %p stub!\n", iface);
841 
842  return FALSE;
843 }
844 
845 static BOOL WINAPI d3drm_viewport1_GetUniformScaling(IDirect3DRMViewport *iface)
846 {
847  FIXME("iface %p stub!\n", iface);
848 
849  return FALSE;
850 }
851 
852 static LONG WINAPI d3drm_viewport2_GetX(IDirect3DRMViewport2 *iface)
853 {
854  FIXME("iface %p stub!\n", iface);
855 
856  return E_NOTIMPL;
857 }
858 
859 static LONG WINAPI d3drm_viewport1_GetX(IDirect3DRMViewport *iface)
860 {
861  FIXME("iface %p stub!\n", iface);
862 
863  return E_NOTIMPL;
864 }
865 
866 static LONG WINAPI d3drm_viewport2_GetY(IDirect3DRMViewport2 *iface)
867 {
868  FIXME("iface %p stub!\n", iface);
869 
870  return E_NOTIMPL;
871 }
872 
873 static LONG WINAPI d3drm_viewport1_GetY(IDirect3DRMViewport *iface)
874 {
875  FIXME("iface %p stub!\n", iface);
876 
877  return E_NOTIMPL;
878 }
879 
880 static DWORD WINAPI d3drm_viewport2_GetWidth(IDirect3DRMViewport2 *iface)
881 {
882  FIXME("iface %p stub!\n", iface);
883 
884  return E_NOTIMPL;
885 }
886 
887 static DWORD WINAPI d3drm_viewport1_GetWidth(IDirect3DRMViewport *iface)
888 {
889  FIXME("iface %p stub!\n", iface);
890 
891  return E_NOTIMPL;
892 }
893 
894 static DWORD WINAPI d3drm_viewport2_GetHeight(IDirect3DRMViewport2 *iface)
895 {
896  FIXME("iface %p stub!\n", iface);
897 
898  return E_NOTIMPL;
899 }
900 
901 static DWORD WINAPI d3drm_viewport1_GetHeight(IDirect3DRMViewport *iface)
902 {
903  FIXME("iface %p stub!\n", iface);
904 
905  return E_NOTIMPL;
906 }
907 
908 static D3DVALUE WINAPI d3drm_viewport2_GetField(IDirect3DRMViewport2 *iface)
909 {
910  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
911 
912  TRACE("iface %p.\n", iface);
913 
914  if (!viewport->d3d_viewport)
915  return -1.0f;
916 
917  return (viewport->clip.right - viewport->clip.left
918  + viewport->clip.top - viewport->clip.bottom) / 4.0f;
919 }
920 
921 static D3DVALUE WINAPI d3drm_viewport1_GetField(IDirect3DRMViewport *iface)
922 {
923  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
924 
925  TRACE("iface %p.\n", iface);
926 
928 }
929 
930 static D3DVALUE WINAPI d3drm_viewport2_GetBack(IDirect3DRMViewport2 *iface)
931 {
932  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
933 
934  TRACE("iface %p.\n", iface);
935 
936  if (!viewport->d3d_viewport)
937  return -1.0f;
938 
939  return viewport->clip.back;
940 }
941 
942 static D3DVALUE WINAPI d3drm_viewport1_GetBack(IDirect3DRMViewport *iface)
943 {
944  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
945 
946  TRACE("iface %p.\n", iface);
947 
949 }
950 
951 static D3DVALUE WINAPI d3drm_viewport2_GetFront(IDirect3DRMViewport2 *iface)
952 {
953  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
954 
955  TRACE("iface %p.\n", iface);
956 
957  if (!viewport->d3d_viewport)
958  return -1.0f;
959 
960  return viewport->clip.front;
961 }
962 
963 static D3DVALUE WINAPI d3drm_viewport1_GetFront(IDirect3DRMViewport *iface)
964 {
965  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
966 
967  TRACE("iface %p.\n", iface);
968 
970 }
971 
972 static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport2_GetProjection(IDirect3DRMViewport2 *iface)
973 {
974  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport2(iface);
975 
976  TRACE("iface %p.\n", iface);
977 
978  return viewport->projection;
979 }
980 
981 static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport1_GetProjection(IDirect3DRMViewport *iface)
982 {
983  struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface);
984 
985  TRACE("iface %p.\n", iface);
986 
988 }
989 
990 static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 *iface,
991  IDirect3DViewport **viewport)
992 {
993  struct d3drm_viewport *viewport_object = impl_from_IDirect3DRMViewport2(iface);
994 
995  TRACE("iface %p, viewport %p.\n", iface, viewport);
996 
997  if (!viewport)
998  return D3DRMERR_BADVALUE;
999 
1000  if (!viewport_object->d3d_viewport)
1001  return D3DRMERR_BADOBJECT;
1002 
1003  *viewport = viewport_object->d3d_viewport;
1004  IDirect3DViewport_AddRef(*viewport);
1005 
1006  return D3DRM_OK;
1007 }
1008 
1009 static HRESULT WINAPI d3drm_viewport1_GetDirect3DViewport(IDirect3DRMViewport *iface,
1010  IDirect3DViewport **viewport)
1011 {
1012  struct d3drm_viewport *viewport_object = impl_from_IDirect3DRMViewport(iface);
1013 
1014  TRACE("iface %p, viewport %p.\n", iface, viewport);
1015 
1016  return d3drm_viewport2_GetDirect3DViewport(&viewport_object->IDirect3DRMViewport2_iface, viewport);
1017 }
1018 
1019 static HRESULT WINAPI d3drm_viewport2_TransformVectors(IDirect3DRMViewport2 *iface,
1020  DWORD vector_count, D3DRMVECTOR4D *dst, D3DVECTOR *src)
1021 {
1022  FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src);
1023 
1024  return E_NOTIMPL;
1025 }
1026 
1027 static HRESULT WINAPI d3drm_viewport2_InverseTransformVectors(IDirect3DRMViewport2 *iface,
1028  DWORD vector_count, D3DVECTOR *dst, D3DRMVECTOR4D *src)
1029 {
1030  FIXME("iface %p, vector_count %u, dst %p, src %p stub!\n", iface, vector_count, dst, src);
1031 
1032  return E_NOTIMPL;
1033 }
1034 
1035 static const struct IDirect3DRMViewport2Vtbl d3drm_viewport2_vtbl =
1036 {
1078 };
1079 
1080 static const struct IDirect3DRMViewportVtbl d3drm_viewport1_vtbl =
1081 {
1121 };
1122 
1123 HRESULT d3drm_viewport_create(struct d3drm_viewport **viewport, IDirect3DRM *d3drm)
1124 {
1125  static const char classname[] = "Viewport";
1126  struct d3drm_viewport *object;
1127 
1128  TRACE("viewport %p, d3drm %p.\n", viewport, d3drm);
1129 
1130  if (!(object = heap_alloc_zero(sizeof(*object))))
1131  return E_OUTOFMEMORY;
1132 
1133  object->IDirect3DRMViewport_iface.lpVtbl = &d3drm_viewport1_vtbl;
1134  object->IDirect3DRMViewport2_iface.lpVtbl = &d3drm_viewport2_vtbl;
1135  object->d3drm = d3drm;
1137 
1138  *viewport = object;
1139 
1140  return S_OK;
1141 }
IDirect3DViewport * d3d_viewport
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
struct d3drm_frame * unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface) DECLSPEC_HIDDEN
Definition: frame.c:3120
static HRESULT WINAPI d3drm_viewport1_SetFront(IDirect3DRMViewport *iface, D3DVALUE front)
Definition: viewport.c:504
D3DVALUE dvMinZ
Definition: d3dtypes.h:372
static HRESULT WINAPI d3drm_viewport1_Transform(IDirect3DRMViewport *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
Definition: viewport.c:637
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object)
Definition: d3drm_main.c:153
static HRESULT WINAPI d3drm_viewport2_SetFront(IDirect3DRMViewport2 *iface, D3DVALUE front)
Definition: viewport.c:487
static HRESULT WINAPI d3drm_viewport1_SetField(IDirect3DRMViewport *iface, D3DVALUE field)
Definition: viewport.c:559
static LONG WINAPI d3drm_viewport1_GetX(IDirect3DRMViewport *iface)
Definition: viewport.c:859
GLint GLint GLsizei width
Definition: gl.h:1546
#define IDirect3DViewport_AddRef(p)
Definition: d3d.h:675
struct d3drm_object obj
#define IDirect3DRMFrame_AddRef(p)
Definition: d3drmobj.h:1167
#define REFIID
Definition: guiddef.h:118
DWORD dwY
Definition: d3dtypes.h:365
struct d3drm_device * device
#define RGBA_GETGREEN(rgb)
Definition: d3dtypes.h:59
static HRESULT WINAPI d3drm_viewport2_GetName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
Definition: viewport.c:267
IDirect3DRMFrame3 IDirect3DRMFrame3_iface
Definition: d3drm_private.h:74
#define D3DRMCLEAR_ALL
Definition: d3drmdef.h:313
#define IDirect3DDevice_Release(p)
Definition: d3d.h:966
static HRESULT WINAPI d3drm_viewport1_GetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame **camera)
Definition: viewport.c:735
static HRESULT WINAPI d3drm_viewport1_SetCamera(IDirect3DRMViewport *iface, IDirect3DRMFrame *camera)
Definition: viewport.c:599
static HRESULT WINAPI d3drm_viewport2_Clear(IDirect3DRMViewport2 *iface, DWORD flags)
Definition: viewport.c:426
HRESULT d3drm_viewport_create(struct d3drm_viewport **viewport, IDirect3DRM *d3drm)
Definition: viewport.c:1123
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WINAPI d3drm_viewport2_Pick(IDirect3DRMViewport2 *iface, LONG x, LONG y, IDirect3DRMPickedArray **visuals)
Definition: viewport.c:822
static HRESULT WINAPI d3drm_viewport2_GetClassName(IDirect3DRMViewport2 *iface, DWORD *size, char *name)
Definition: viewport.c:285
#define D3DRMCLEAR_DIRTYRECTS
Definition: d3drmdef.h:312
static const struct IDirect3DRMViewport2Vtbl d3drm_viewport2_vtbl
Definition: viewport.c:1035
static HRESULT WINAPI d3drm_viewport1_GetDirect3DViewport(IDirect3DRMViewport *iface, IDirect3DViewport **viewport)
Definition: viewport.c:1009
struct d3drm_box clip
static ULONG WINAPI d3drm_viewport1_Release(IDirect3DRMViewport *iface)
Definition: viewport.c:147
D3DVALUE dvMaxX
Definition: d3dtypes.h:370
#define IDirect3DRMFrame3_QueryInterface(p, a, b)
Definition: d3drmobj.h:1706
REFIID riid
Definition: precomp.h:44
#define IDirect3D_CreateMaterial(p, a, b)
Definition: d3d.h:238
static BOOL WINAPI d3drm_viewport1_GetUniformScaling(IDirect3DRMViewport *iface)
Definition: viewport.c:845
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
static HRESULT WINAPI d3drm_viewport2_QueryInterface(IDirect3DRMViewport2 *iface, REFIID riid, void **out)
Definition: viewport.c:79
#define WARN(fmt,...)
Definition: debug.h:111
static void d3drm_normalize_d3d_color(D3DCOLORVALUE *color_value, D3DCOLOR color)
Definition: viewport.c:35
D3DVALUE dvMaxZ
Definition: d3dtypes.h:373
struct d3drm_device * unsafe_impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface) DECLSPEC_HIDDEN
Definition: device.c:1625
static HRESULT WINAPI d3drm_viewport2_GetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 **camera)
Definition: viewport.c:720
#define IDirect3DRMFrame_GetScene(p, a)
Definition: d3drmobj.h:1194
static HRESULT WINAPI d3drm_viewport2_SetUniformScaling(IDirect3DRMViewport2 *iface, BOOL b)
Definition: viewport.c:568
#define IDirect3DMaterial_GetHandle(p, a, b)
Definition: d3d.h:469
static DWORD WINAPI d3drm_viewport2_GetAppData(IDirect3DRMViewport2 *iface)
Definition: viewport.c:231
static HRESULT WINAPI d3drm_viewport2_Configure(IDirect3DRMViewport2 *iface, LONG x, LONG y, DWORD width, DWORD height)
Definition: viewport.c:658
static HRESULT WINAPI d3drm_viewport2_TransformVectors(IDirect3DRMViewport2 *iface, DWORD vector_count, D3DRMVECTOR4D *dst, D3DVECTOR *src)
Definition: viewport.c:1019
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define ds
Definition: i386-dis.c:434
#define IDirect3DRMFrame_GetSceneBackground(p)
Definition: d3drmobj.h:1210
static HRESULT WINAPI d3drm_viewport2_ForceUpdate(IDirect3DRMViewport2 *iface, DWORD x1, DWORD y1, DWORD x2, DWORD y2)
Definition: viewport.c:674
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static const MAT2 mat
Definition: font.c:66
HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: d3drm_main.c:55
static HRESULT WINAPI d3drm_viewport1_GetPlane(IDirect3DRMViewport *iface, D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top)
Definition: viewport.c:811
WCHAR classname[128]
Definition: startup.c:15
static HRESULT WINAPI d3drm_viewport2_Render(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *frame)
Definition: viewport.c:473
static DWORD WINAPI d3drm_viewport1_GetAppData(IDirect3DRMViewport *iface)
Definition: viewport.c:240
static HRESULT WINAPI d3drm_viewport1_Clear(IDirect3DRMViewport *iface)
Definition: viewport.c:464
static HRESULT WINAPI d3drm_viewport1_SetProjection(IDirect3DRMViewport *iface, D3DRMPROJECTIONTYPE type)
Definition: viewport.c:621
LONG y1
Definition: d3d8types.h:1154
static HRESULT WINAPI d3drm_viewport2_SetName(IDirect3DRMViewport2 *iface, const char *name)
Definition: viewport.c:249
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport1_GetProjection(IDirect3DRMViewport *iface)
Definition: viewport.c:981
static HRESULT WINAPI d3drm_viewport2_InverseTransformVectors(IDirect3DRMViewport2 *iface, DWORD vector_count, D3DVECTOR *dst, D3DRMVECTOR4D *src)
Definition: viewport.c:1027
static HRESULT WINAPI d3drm_viewport2_Init(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 *device, IDirect3DRMFrame3 *camera, DWORD x, DWORD y, DWORD width, DWORD height)
Definition: viewport.c:303
static HRESULT WINAPI d3drm_viewport1_AddDestroyCallback(IDirect3DRMViewport *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: viewport.c:182
static HRESULT WINAPI d3drm_viewport2_Transform(IDirect3DRMViewport2 *iface, D3DRMVECTOR4D *d, D3DVECTOR *s)
Definition: viewport.c:630
#define D3DCLEAR_ZBUFFER
Definition: d3d8types.h:31
static HRESULT WINAPI d3drm_viewport1_Render(IDirect3DRMViewport *iface, IDirect3DRMFrame *frame)
Definition: viewport.c:480
#define IDirect3DRMDevice3_Release(p)
Definition: d3drmobj.h:693
#define IDirect3DMaterial_Release(p)
Definition: d3d.h:464
DWORD dwHeight
Definition: d3dtypes.h:367
static HRESULT WINAPI d3drm_viewport1_SetName(IDirect3DRMViewport *iface, const char *name)
Definition: viewport.c:258
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define D3DRMERR_BADOBJECT
Definition: d3drm.h:487
IDirect3DRMFrame IDirect3DRMFrame_iface
Definition: d3drm_private.h:72
static HRESULT WINAPI d3drm_viewport2_SetField(IDirect3DRMViewport2 *iface, D3DVALUE field)
Definition: viewport.c:539
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
static HRESULT d3drm_update_background_material(struct d3drm_viewport *viewport)
Definition: viewport.c:43
Definition: devices.h:37
static HRESULT WINAPI d3drm_viewport1_SetPlane(IDirect3DRMViewport *iface, D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top)
Definition: viewport.c:709
static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport2_GetProjection(IDirect3DRMViewport2 *iface)
Definition: viewport.c:972
#define IDirect3DRMDevice_QueryInterface(p, a, b)
Definition: d3drmobj.h:407
#define FIXME(fmt,...)
Definition: debug.h:110
static HRESULT WINAPI d3drm_viewport1_GetName(IDirect3DRMViewport *iface, DWORD *size, char *name)
Definition: viewport.c:276
#define IDirect3DRMDevice3_GetDirect3DDevice(p, a)
Definition: d3drmobj.h:726
float D3DVALUE
Definition: d3dtypes.h:89
smooth NULL
Definition: ftsmooth.c:416
GLint GLint bottom
Definition: glext.h:7726
HRESULT d3drm_object_get_name(struct d3drm_object *object, DWORD *size, char *name)
Definition: d3drm_main.c:111
#define DDSCAPS_ZBUFFER
Definition: ddraw.h:267
static HRESULT WINAPI d3drm_viewport1_Clone(IDirect3DRMViewport *iface, IUnknown *outer, REFIID iid, void **out)
Definition: viewport.c:164
#define debugstr_guid
Definition: kernel32.h:35
HRESULT d3drm_object_get_class_name(struct d3drm_object *object, DWORD *size, char *name)
Definition: d3drm_main.c:92
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static LONG WINAPI d3drm_viewport2_GetY(IDirect3DRMViewport2 *iface)
Definition: viewport.c:866
D3DVALUE dvMaxY
Definition: d3dtypes.h:371
GLfloat f
Definition: glext.h:7540
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define d
Definition: ke_i.h:81
static D3DVALUE WINAPI d3drm_viewport2_GetField(IDirect3DRMViewport2 *iface)
Definition: viewport.c:908
static struct d3drm_viewport * impl_from_IDirect3DRMViewport2(IDirect3DRMViewport2 *iface)
Definition: viewport.c:30
static HRESULT WINAPI d3drm_viewport2_SetPlane(IDirect3DRMViewport2 *iface, D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top)
Definition: viewport.c:690
static ULONG WINAPI d3drm_viewport2_Release(IDirect3DRMViewport2 *iface)
Definition: viewport.c:134
static HRESULT WINAPI d3drm_viewport1_QueryInterface(IDirect3DRMViewport *iface, REFIID riid, void **out)
Definition: viewport.c:106
Definition: parser.c:43
#define debugstr_a
Definition: kernel32.h:31
#define IDirect3DViewport_Release(p)
Definition: d3d.h:676
LONG HRESULT
Definition: typedefs.h:77
static void d3drm_viewport_destroy(struct d3drm_viewport *viewport)
Definition: viewport.c:62
#define D3DRM_OK
Definition: d3drm.h:486
#define IDirect3DMaterial_SetMaterial(p, a)
Definition: d3d.h:467
static HRESULT WINAPI d3drm_viewport1_SetUniformScaling(IDirect3DRMViewport *iface, BOOL b)
Definition: viewport.c:575
const GUID IID_IUnknown
#define IDirect3DDevice_AddViewport(p, a)
Definition: d3d.h:974
static struct address_cache * front
Definition: rpcb_clnt.c:83
#define WINAPI
Definition: msvc.h:8
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint left
Definition: glext.h:7726
static HRESULT WINAPI d3drm_viewport2_SetBack(IDirect3DRMViewport2 *iface, D3DVALUE back)
Definition: viewport.c:513
#define IDirect3DRMDevice3_AddRef(p)
Definition: d3drmobj.h:692
static HRESULT WINAPI d3drm_viewport2_SetProjection(IDirect3DRMViewport2 *iface, D3DRMPROJECTIONTYPE type)
Definition: viewport.c:610
LONG y2
Definition: d3d8types.h:1156
IDirect3DRMViewport IDirect3DRMViewport_iface
DWORD dwWidth
Definition: d3dtypes.h:366
GLdouble GLdouble right
Definition: glext.h:10859
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
static HRESULT WINAPI d3drm_viewport1_GetDevice(IDirect3DRMViewport *iface, IDirect3DRMDevice **device)
Definition: viewport.c:774
void(__cdecl * D3DRMOBJECTCALLBACK)(struct IDirect3DRMObject *obj, void *arg)
Definition: d3drmobj.h:157
#define D3DRMCLEAR_ZBUFFER
Definition: d3drmdef.h:311
HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: d3drm_main.c:72
static HRESULT WINAPI d3drm_viewport2_SetCamera(IDirect3DRMViewport2 *iface, IDirect3DRMFrame3 *camera)
Definition: viewport.c:582
LONG x1
Definition: d3d8types.h:1153
static LONG WINAPI d3drm_viewport1_GetY(IDirect3DRMViewport *iface)
Definition: viewport.c:873
#define D3DRMERR_BADVALUE
Definition: d3drm.h:496
#define InterlockedDecrement
Definition: armddk.h:52
#define D3DRMCLEAR_TARGET
Definition: d3drmdef.h:310
#define IDirect3DRMDevice_AddRef(p)
Definition: d3drmobj.h:408
static HRESULT WINAPI d3drm_viewport2_Clone(IDirect3DRMViewport2 *iface, IUnknown *outer, REFIID iid, void **out)
Definition: viewport.c:156
GLdouble s
Definition: gl.h:2039
GLenum src
Definition: glext.h:6340
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
static HRESULT WINAPI d3drm_viewport2_InverseTransform(IDirect3DRMViewport2 *iface, D3DVECTOR *d, D3DRMVECTOR4D *s)
Definition: viewport.c:644
static HRESULT WINAPI d3drm_viewport1_Init(IDirect3DRMViewport *iface, IDirect3DRMDevice *device, IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height)
Definition: viewport.c:402
static LONG WINAPI d3drm_viewport2_GetX(IDirect3DRMViewport2 *iface)
Definition: viewport.c:852
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
Definition: d3drm.c:188
#define IDirect3D_CreateViewport(p, a, b)
Definition: d3d.h:239
static D3DVALUE WINAPI d3drm_viewport1_GetFront(IDirect3DRMViewport *iface)
Definition: viewport.c:963
#define IDirect3DRMFrame_QueryInterface(p, a, b)
Definition: d3drmobj.h:1166
static HRESULT WINAPI d3drm_viewport2_GetDevice(IDirect3DRMViewport2 *iface, IDirect3DRMDevice3 **device)
Definition: viewport.c:756
#define IDirect3DViewport_Clear(p, a, b, c)
Definition: d3d.h:687
DWORD dwSize
Definition: d3dtypes.h:363
#define IDirect3DViewport_SetViewport(p, a)
Definition: d3d.h:680
D3DVALUE dvScaleX
Definition: d3dtypes.h:368
#define S_OK
Definition: intsafe.h:59
#define RGBA_GETBLUE(rgb)
Definition: d3dtypes.h:60
static HRESULT WINAPI d3drm_viewport1_Configure(IDirect3DRMViewport *iface, LONG x, LONG y, DWORD width, DWORD height)
Definition: viewport.c:666
WINE_DEFAULT_DEBUG_CHANNEL(d3drm)
#define InterlockedIncrement
Definition: armddk.h:53
LONG x2
Definition: d3d8types.h:1155
static D3DVALUE WINAPI d3drm_viewport2_GetBack(IDirect3DRMViewport2 *iface)
Definition: viewport.c:930
IDirect3DRMFrame * camera
static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 *iface, IDirect3DViewport **viewport)
Definition: viewport.c:990
#define IDirect3D_Release(p)
Definition: d3d.h:233
static HRESULT WINAPI d3drm_viewport2_GetPlane(IDirect3DRMViewport2 *iface, D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top)
Definition: viewport.c:792
static ULONG WINAPI d3drm_viewport2_AddRef(IDirect3DRMViewport2 *iface)
Definition: viewport.c:115
#define E_NOTIMPL
Definition: ddrawi.h:99
IDirect3DRM * d3drm
GLenum GLenum dst
Definition: glext.h:6340
static HRESULT WINAPI d3drm_viewport2_AddDestroyCallback(IDirect3DRMViewport2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: viewport.c:172
enum _D3DRMPROJECTIONTYPE D3DRMPROJECTIONTYPE
D3DVALUE dvScaleY
Definition: d3dtypes.h:369
static HRESULT WINAPI d3drm_viewport1_SetAppData(IDirect3DRMViewport *iface, DWORD data)
Definition: viewport.c:222
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:39
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static const struct IDirect3DRMViewportVtbl d3drm_viewport1_vtbl
Definition: viewport.c:1080
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
static DWORD WINAPI d3drm_viewport2_GetWidth(IDirect3DRMViewport2 *iface)
Definition: viewport.c:880
IDirect3DMaterial * material
static D3DVALUE WINAPI d3drm_viewport1_GetField(IDirect3DRMViewport *iface)
Definition: viewport.c:921
#define RGBA_GETALPHA(rgb)
Definition: d3dtypes.h:57
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
Definition: name.c:36
unsigned int ULONG
Definition: retypes.h:1
static DWORD WINAPI d3drm_viewport2_GetHeight(IDirect3DRMViewport2 *iface)
Definition: viewport.c:894
#define IDirect3DRM_Release(p)
Definition: d3drm.h:111
#define IDirect3DDevice_GetDirect3D(p, a)
Definition: d3d.h:986
char * cleanup(char *str)
Definition: wpickclick.c:99
#define IDirect3DRMFrame_Release(p)
Definition: d3drmobj.h:1168
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
static ULONG WINAPI d3drm_viewport1_AddRef(IDirect3DRMViewport *iface)
Definition: viewport.c:125
static HRESULT WINAPI d3drm_viewport1_Pick(IDirect3DRMViewport *iface, LONG x, LONG y, IDirect3DRMPickedArray **visuals)
Definition: viewport.c:830
static HRESULT WINAPI d3drm_viewport1_InverseTransform(IDirect3DRMViewport *iface, D3DVECTOR *d, D3DRMVECTOR4D *s)
Definition: viewport.c:651
static HRESULT WINAPI d3drm_viewport1_GetClassName(IDirect3DRMViewport *iface, DWORD *size, char *name)
Definition: viewport.c:294
static HRESULT WINAPI d3drm_viewport2_DeleteDestroyCallback(IDirect3DRMViewport2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: viewport.c:192
static DWORD WINAPI d3drm_viewport1_GetHeight(IDirect3DRMViewport *iface)
Definition: viewport.c:901
#define memset(x, y, z)
Definition: compat.h:39
#define IDirect3DViewport_SetBackground(p, a)
Definition: d3d.h:683
struct d3drm_frame * unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface) DECLSPEC_HIDDEN
Definition: frame.c:3111
static HRESULT WINAPI d3drm_viewport1_ForceUpdate(IDirect3DRMViewport *iface, DWORD x1, DWORD y1, DWORD x2, DWORD y2)
Definition: viewport.c:682
static D3DVALUE WINAPI d3drm_viewport1_GetBack(IDirect3DRMViewport *iface)
Definition: viewport.c:942
IDirect3DRMViewport2 IDirect3DRMViewport2_iface
void * object
Definition: jmemsys.h:48
#define RGBA_GETRED(rgb)
Definition: d3dtypes.h:58
DWORD dwX
Definition: d3dtypes.h:364
static DWORD WINAPI d3drm_viewport1_GetWidth(IDirect3DRMViewport *iface)
Definition: viewport.c:887
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL WINAPI d3drm_viewport2_GetUniformScaling(IDirect3DRMViewport2 *iface)
Definition: viewport.c:838
static struct d3drm_viewport * impl_from_IDirect3DRMViewport(IDirect3DRMViewport *iface)
Definition: viewport.c:25
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
D3DRMPROJECTIONTYPE projection
DWORD D3DMATERIALHANDLE
Definition: d3dtypes.h:154
HRESULT d3drm_object_set_name(struct d3drm_object *object, const char *name)
Definition: d3drm_main.c:135
static HRESULT WINAPI d3drm_viewport1_DeleteDestroyCallback(IDirect3DRMViewport *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: viewport.c:202
static D3DVALUE WINAPI d3drm_viewport2_GetFront(IDirect3DRMViewport2 *iface)
Definition: viewport.c:951
#define D3DCLEAR_TARGET
Definition: d3d8types.h:30
static HRESULT WINAPI d3drm_viewport2_SetAppData(IDirect3DRMViewport2 *iface, DWORD data)
Definition: viewport.c:212
static HRESULT WINAPI d3drm_viewport1_SetBack(IDirect3DRMViewport *iface, D3DVALUE back)
Definition: viewport.c:530