ReactOS  0.4.14-dev-828-g8dc90a4
device.c
Go to the documentation of this file.
1 /*
2  * Implementation of IDirect3DRMDevice Interface
3  *
4  * Copyright 2011, 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_device *impl_from_IDirect3DRMDevice(IDirect3DRMDevice *iface)
26 {
28 }
29 
30 static inline struct d3drm_device *impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2 *iface)
31 {
33 }
34 
35 static inline struct d3drm_device *impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface)
36 {
38 }
39 
41 {
42  d3drm_object_cleanup((IDirect3DRMObject *)&device->IDirect3DRMDevice_iface, &device->obj);
43  if (device->device)
44  {
45  TRACE("Releasing attached ddraw interfaces.\n");
47  }
48  if (device->render_target)
49  IDirectDrawSurface_Release(device->render_target);
50  if (device->primary_surface)
51  {
52  TRACE("Releasing primary surface and attached clipper.\n");
53  IDirectDrawSurface_Release(device->primary_surface);
54  IDirectDrawClipper_Release(device->clipper);
55  }
56  if (device->ddraw)
57  {
58  IDirectDraw_Release(device->ddraw);
60  }
62 }
63 
64 static inline struct d3drm_device *impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice *iface)
65 {
67 }
68 
69 HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface)
70 {
71  DDSURFACEDESC surface_desc;
72  IDirectDrawSurface *primary_surface, *render_target;
73  HWND window;
74  HRESULT hr;
75 
76  hr = IDirectDrawClipper_GetHWnd(clipper, &window);
77  if (FAILED(hr))
78  return hr;
79 
80  hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
81  if (FAILED(hr))
82  return hr;
83 
84  memset(&surface_desc, 0, sizeof(surface_desc));
85  surface_desc.dwSize = sizeof(surface_desc);
86  surface_desc.dwFlags = DDSD_CAPS;
87  surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
88  hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &primary_surface, NULL);
89  if (FAILED(hr))
90  return hr;
91  hr = IDirectDrawSurface_SetClipper(primary_surface, clipper);
92  if (FAILED(hr))
93  {
94  IDirectDrawSurface_Release(primary_surface);
95  return hr;
96  }
97 
98  memset(&surface_desc, 0, sizeof(surface_desc));
99  surface_desc.dwSize = sizeof(surface_desc);
100  surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
101  surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
102  surface_desc.dwWidth = width;
103  surface_desc.dwHeight = height;
104 
105  hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &render_target, NULL);
106  if (FAILED(hr))
107  {
108  IDirectDrawSurface_Release(primary_surface);
109  return hr;
110  }
111 
112  object->primary_surface = primary_surface;
113  object->clipper = clipper;
114  IDirectDrawClipper_AddRef(clipper);
115  *surface = render_target;
116 
117  return D3DRM_OK;
118 }
119 
120 HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw *ddraw, IDirectDrawSurface *surface,
121  BOOL create_z_surface)
122 {
123  DDSCAPS caps = { DDSCAPS_ZBUFFER };
124  IDirectDrawSurface *ds = NULL;
125  IDirect3DDevice *device1 = NULL;
126  IDirect3DDevice2 *device2 = NULL;
127  IDirect3D2 *d3d2 = NULL;
128  DDSURFACEDESC desc, surface_desc;
129  HRESULT hr;
130 
131  device->ddraw = ddraw;
132  IDirectDraw_AddRef(ddraw);
133  IDirect3DRM_AddRef(device->d3drm);
134  device->render_target = surface;
135  IDirectDrawSurface_AddRef(surface);
136 
137  desc.dwSize = sizeof(desc);
138  hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc);
139  if (FAILED(hr))
140  return hr;
141 
142  if (!(desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
143  return DDERR_INVALIDCAPS;
144 
145  hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds);
146  if (SUCCEEDED(hr))
147  {
148  create_z_surface = FALSE;
149  IDirectDrawSurface_Release(ds);
150  ds = NULL;
151  }
152 
153  if (create_z_surface)
154  {
155  memset(&surface_desc, 0, sizeof(surface_desc));
156  surface_desc.dwSize = sizeof(surface_desc);
157  surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
158  surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
159  surface_desc.u2.dwZBufferBitDepth = 16;
160  surface_desc.dwWidth = desc.dwWidth;
161  surface_desc.dwHeight = desc.dwHeight;
162  hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL);
163  if (FAILED(hr))
164  return hr;
165 
166  hr = IDirectDrawSurface_AddAttachedSurface(surface, ds);
167  IDirectDrawSurface_Release(ds);
168  if (FAILED(hr))
169  return hr;
170  }
171 
172  if (version == 1)
173  hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DRGBDevice, (void **)&device1);
174  else
175  {
176  IDirectDraw_QueryInterface(ddraw, &IID_IDirect3D2, (void**)&d3d2);
177  hr = IDirect3D2_CreateDevice(d3d2, &IID_IDirect3DRGBDevice, surface, &device2);
178  IDirect3D2_Release(d3d2);
179  }
180  if (FAILED(hr))
181  {
182  IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
183  return hr;
184  }
185 
186  if (version != 1)
187  {
188  hr = IDirect3DDevice2_QueryInterface(device2, &IID_IDirect3DDevice, (void**)&device1);
189  IDirect3DDevice2_Release(device2);
190  if (FAILED(hr))
191  {
192  IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
193  return hr;
194  }
195  }
196  device->device = device1;
197  device->width = desc.dwWidth;
198  device->height = desc.dwHeight;
199 
200  return hr;
201 }
202 
203 static HRESULT d3drm_device_set_ddraw_device_d3d(struct d3drm_device *device, IDirect3D *d3d, IDirect3DDevice *d3d_device)
204 {
205  IDirectDraw *ddraw;
206  IDirectDrawSurface *surface;
207  IDirect3DDevice2 *d3d_device2 = NULL;
209  HRESULT hr;
210 
211  /* AddRef these interfaces beforehand for the intentional leak on reinitialization. */
212  if (FAILED(hr = IDirect3D_QueryInterface(d3d, &IID_IDirectDraw, (void **)&ddraw)))
213  return hr;
214  IDirect3DRM_AddRef(device->d3drm);
216 
217  /* Fetch render target and get width/height from there */
218  if (FAILED(hr = IDirect3DDevice_QueryInterface(d3d_device, &IID_IDirectDrawSurface, (void **)&surface)))
219  {
220  if (FAILED(hr = IDirect3DDevice_QueryInterface(d3d_device, &IID_IDirect3DDevice2, (void **)&d3d_device2)))
221  return hr;
222  hr = IDirect3DDevice2_GetRenderTarget(d3d_device2, &surface);
223  IDirect3DDevice2_Release(d3d_device2);
224  if (FAILED(hr))
225  return hr;
226  }
227 
228  if (device->ddraw)
229  {
230  if (d3d_device2)
231  IDirectDrawSurface_Release(surface);
232  return D3DRMERR_BADOBJECT;
233  }
234 
235  desc.dwSize = sizeof(desc);
236  hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc);
237  if (FAILED(hr))
238  {
239  IDirectDrawSurface_Release(surface);
240  return hr;
241  }
242 
243  device->ddraw = ddraw;
244  device->width = desc.dwWidth;
245  device->height = desc.dwHeight;
246  device->device = d3d_device;
247  device->render_target = surface;
248 
249  return hr;
250 }
251 
252 static HRESULT WINAPI d3drm_device3_QueryInterface(IDirect3DRMDevice3 *iface, REFIID riid, void **out)
253 {
255 
256  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
257 
258  if (IsEqualGUID(riid, &IID_IDirect3DRMDevice)
259  || IsEqualGUID(riid, &IID_IDirect3DRMObject)
261  {
262  *out = &device->IDirect3DRMDevice_iface;
263  }
264  else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2))
265  {
266  *out = &device->IDirect3DRMDevice2_iface;
267  }
268  else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3))
269  {
270  *out = &device->IDirect3DRMDevice3_iface;
271  }
272  else if (IsEqualGUID(riid, &IID_IDirect3DRMWinDevice))
273  {
274  *out = &device->IDirect3DRMWinDevice_iface;
275  }
276  else
277  {
278  *out = NULL;
279  WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
281  }
282 
283  IUnknown_AddRef((IUnknown *)*out);
284  return S_OK;
285 }
286 
287 static HRESULT WINAPI d3drm_device2_QueryInterface(IDirect3DRMDevice2 *iface, REFIID riid, void **out)
288 {
290 
291  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
292 
293  return d3drm_device3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out);
294 }
295 
296 static HRESULT WINAPI d3drm_device1_QueryInterface(IDirect3DRMDevice *iface, REFIID riid, void **out)
297 {
299 
300  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
301 
302  return d3drm_device3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out);
303 }
304 
305 static ULONG WINAPI d3drm_device3_AddRef(IDirect3DRMDevice3 *iface)
306 {
308  ULONG refcount = InterlockedIncrement(&device->obj.ref);
309 
310  TRACE("%p increasing refcount to %u.\n", iface, refcount);
311 
312  return refcount;
313 }
314 
315 static ULONG WINAPI d3drm_device2_AddRef(IDirect3DRMDevice2 *iface)
316 {
318 
319  TRACE("iface %p.\n", iface);
320 
321  return d3drm_device3_AddRef(&device->IDirect3DRMDevice3_iface);
322 }
323 
324 static ULONG WINAPI d3drm_device1_AddRef(IDirect3DRMDevice *iface)
325 {
327 
328  TRACE("iface %p.\n", iface);
329 
330  return d3drm_device3_AddRef(&device->IDirect3DRMDevice3_iface);
331 }
332 
333 static ULONG WINAPI d3drm_device3_Release(IDirect3DRMDevice3 *iface)
334 {
336  ULONG refcount = InterlockedDecrement(&device->obj.ref);
337 
338  TRACE("%p decreasing refcount to %u.\n", iface, refcount);
339 
340  if (!refcount)
342 
343  return refcount;
344 }
345 
346 static ULONG WINAPI d3drm_device2_Release(IDirect3DRMDevice2 *iface)
347 {
349 
350  TRACE("iface %p.\n", iface);
351 
352  return d3drm_device3_Release(&device->IDirect3DRMDevice3_iface);
353 }
354 
355 static ULONG WINAPI d3drm_device1_Release(IDirect3DRMDevice *iface)
356 {
358 
359  TRACE("iface %p.\n", iface);
360 
361  return d3drm_device3_Release(&device->IDirect3DRMDevice3_iface);
362 }
363 
364 static HRESULT WINAPI d3drm_device3_Clone(IDirect3DRMDevice3 *iface,
365  IUnknown *outer, REFIID iid, void **out)
366 {
367  FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
368 
369  return E_NOTIMPL;
370 }
371 
372 static HRESULT WINAPI d3drm_device2_Clone(IDirect3DRMDevice2 *iface,
373  IUnknown *outer, REFIID iid, void **out)
374 {
376 
377  TRACE("iface %p, outer %p, iid %s, out %p\n", iface, outer, debugstr_guid(iid), out);
378 
379  return d3drm_device3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out);
380 }
381 
382 static HRESULT WINAPI d3drm_device1_Clone(IDirect3DRMDevice *iface,
383  IUnknown *outer, REFIID iid, void **out)
384 {
386 
387  TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out);
388 
389  return d3drm_device3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out);
390 }
391 
392 static HRESULT WINAPI d3drm_device3_AddDestroyCallback(IDirect3DRMDevice3 *iface,
393  D3DRMOBJECTCALLBACK cb, void *ctx)
394 {
396 
397  TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
398 
399  return d3drm_object_add_destroy_callback(&device->obj, cb, ctx);
400 }
401 
402 static HRESULT WINAPI d3drm_device2_AddDestroyCallback(IDirect3DRMDevice2 *iface,
403  D3DRMOBJECTCALLBACK cb, void *ctx)
404 {
406 
407  TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
408 
409  return d3drm_device3_AddDestroyCallback(&device->IDirect3DRMDevice3_iface, cb, ctx);
410 }
411 
412 static HRESULT WINAPI d3drm_device1_AddDestroyCallback(IDirect3DRMDevice *iface,
413  D3DRMOBJECTCALLBACK cb, void *ctx)
414 {
416 
417  TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
418 
419  return d3drm_device3_AddDestroyCallback(&device->IDirect3DRMDevice3_iface, cb, ctx);
420 }
421 
422 static HRESULT WINAPI d3drm_device3_DeleteDestroyCallback(IDirect3DRMDevice3 *iface,
423  D3DRMOBJECTCALLBACK cb, void *ctx)
424 {
426 
427  TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
428 
429  return d3drm_object_delete_destroy_callback(&device->obj, cb, ctx);
430 }
431 
432 static HRESULT WINAPI d3drm_device2_DeleteDestroyCallback(IDirect3DRMDevice2 *iface,
433  D3DRMOBJECTCALLBACK cb, void *ctx)
434 {
436 
437  TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
438 
439  return d3drm_device3_DeleteDestroyCallback(&device->IDirect3DRMDevice3_iface, cb, ctx);
440 }
441 
442 static HRESULT WINAPI d3drm_device1_DeleteDestroyCallback(IDirect3DRMDevice *iface,
443  D3DRMOBJECTCALLBACK cb, void *ctx)
444 {
446 
447  TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
448 
449  return d3drm_device3_DeleteDestroyCallback(&device->IDirect3DRMDevice3_iface, cb, ctx);
450 }
451 
452 static HRESULT WINAPI d3drm_device3_SetAppData(IDirect3DRMDevice3 *iface, DWORD data)
453 {
455 
456  TRACE("iface %p, data %#x.\n", iface, data);
457 
458  device->obj.appdata = data;
459 
460  return D3DRM_OK;
461 }
462 
463 static HRESULT WINAPI d3drm_device2_SetAppData(IDirect3DRMDevice2 *iface, DWORD data)
464 {
466 
467  TRACE("iface %p, data %#x.\n", iface, data);
468 
469  return d3drm_device3_SetAppData(&device->IDirect3DRMDevice3_iface, data);
470 }
471 
472 static HRESULT WINAPI d3drm_device1_SetAppData(IDirect3DRMDevice *iface, DWORD data)
473 {
475 
476  TRACE("iface %p, data %#x.\n", iface, data);
477 
478  return d3drm_device3_SetAppData(&device->IDirect3DRMDevice3_iface, data);
479 }
480 
481 static DWORD WINAPI d3drm_device3_GetAppData(IDirect3DRMDevice3 *iface)
482 {
484 
485  TRACE("iface %p.\n", iface);
486 
487  return device->obj.appdata;
488 }
489 
490 static DWORD WINAPI d3drm_device2_GetAppData(IDirect3DRMDevice2 *iface)
491 {
493 
494  TRACE("iface %p.\n", iface);
495 
496  return d3drm_device3_GetAppData(&device->IDirect3DRMDevice3_iface);
497 }
498 
499 static DWORD WINAPI d3drm_device1_GetAppData(IDirect3DRMDevice *iface)
500 {
502 
503  TRACE("iface %p.\n", iface);
504 
505  return d3drm_device3_GetAppData(&device->IDirect3DRMDevice3_iface);
506 }
507 
508 static HRESULT WINAPI d3drm_device3_SetName(IDirect3DRMDevice3 *iface, const char *name)
509 {
511 
512  TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
513 
514  return d3drm_object_set_name(&device->obj, name);
515 }
516 
517 static HRESULT WINAPI d3drm_device2_SetName(IDirect3DRMDevice2 *iface, const char *name)
518 {
520 
521  TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
522 
523  return d3drm_device3_SetName(&device->IDirect3DRMDevice3_iface, name);
524 }
525 
526 static HRESULT WINAPI d3drm_device1_SetName(IDirect3DRMDevice *iface, const char *name)
527 {
529 
530  TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
531 
532  return d3drm_device3_SetName(&device->IDirect3DRMDevice3_iface, name);
533 }
534 
535 static HRESULT WINAPI d3drm_device3_GetName(IDirect3DRMDevice3 *iface, DWORD *size, char *name)
536 {
538 
539  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
540 
541  return d3drm_object_get_name(&device->obj, size, name);
542 }
543 
544 static HRESULT WINAPI d3drm_device2_GetName(IDirect3DRMDevice2 *iface, DWORD *size, char *name)
545 {
547 
548  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
549 
550  return d3drm_device3_GetName(&device->IDirect3DRMDevice3_iface, size, name);
551 }
552 
553 static HRESULT WINAPI d3drm_device1_GetName(IDirect3DRMDevice *iface, DWORD *size, char *name)
554 {
556 
557  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
558 
559  return d3drm_device3_GetName(&device->IDirect3DRMDevice3_iface, size, name);
560 }
561 
562 static HRESULT WINAPI d3drm_device3_GetClassName(IDirect3DRMDevice3 *iface, DWORD *size, char *name)
563 {
565 
566  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
567 
569 }
570 
571 static HRESULT WINAPI d3drm_device2_GetClassName(IDirect3DRMDevice2 *iface, DWORD *size, char *name)
572 {
574 
575  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
576 
577  return d3drm_device3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name);
578 }
579 
580 static HRESULT WINAPI d3drm_device1_GetClassName(IDirect3DRMDevice *iface, DWORD *size, char *name)
581 {
583 
584  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
585 
586  return d3drm_device3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name);
587 }
588 
589 static HRESULT WINAPI d3drm_device3_Init(IDirect3DRMDevice3 *iface, ULONG width, ULONG height)
590 {
592 
593  FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
594 
595  device->height = height;
596  device->width = width;
597 
598  return D3DRM_OK;
599 }
600 
601 static HRESULT WINAPI d3drm_device2_Init(IDirect3DRMDevice2 *iface, ULONG width, ULONG height)
602 {
604 
605  TRACE("iface %p, width %u, height %u.\n", iface, width, height);
606 
607  return d3drm_device3_Init(&device->IDirect3DRMDevice3_iface, width, height);
608 }
609 
610 static HRESULT WINAPI d3drm_device1_Init(IDirect3DRMDevice *iface, ULONG width, ULONG height)
611 {
613 
614  TRACE("iface %p, width %u, height %u.\n", iface, width, height);
615 
616  return d3drm_device3_Init(&device->IDirect3DRMDevice3_iface, width, height);
617 }
618 
619 static HRESULT WINAPI d3drm_device3_InitFromD3D(IDirect3DRMDevice3 *iface,
620  IDirect3D *d3d, IDirect3DDevice *d3d_device)
621 {
622  FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device);
623 
624  if (!d3d || !d3d_device)
625  return D3DRMERR_BADVALUE;
626 
627  return E_NOINTERFACE;
628 }
629 
630 static HRESULT WINAPI d3drm_device2_InitFromD3D(IDirect3DRMDevice2 *iface,
631  IDirect3D *d3d, IDirect3DDevice *d3d_device)
632 {
634 
635  TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
636 
637  return d3drm_device3_InitFromD3D(&device->IDirect3DRMDevice3_iface, d3d, d3d_device);
638 }
639 
640 static HRESULT WINAPI d3drm_device1_InitFromD3D(IDirect3DRMDevice *iface,
641  IDirect3D *d3d, IDirect3DDevice *d3d_device)
642 {
644 
645  TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
646 
647  if (!d3d || !d3d_device)
648  return D3DRMERR_BADVALUE;
649 
651 }
652 
653 static HRESULT WINAPI d3drm_device3_InitFromClipper(IDirect3DRMDevice3 *iface,
654  IDirectDrawClipper *clipper, GUID *guid, int width, int height)
655 {
657 
658  FIXME("iface %p, clipper %p, guid %s, width %d, height %d stub!\n",
659  iface, clipper, debugstr_guid(guid), width, height);
660 
661  device->height = height;
662  device->width = width;
663 
664  return D3DRM_OK;
665 }
666 
667 static HRESULT WINAPI d3drm_device2_InitFromClipper(IDirect3DRMDevice2 *iface,
668  IDirectDrawClipper *clipper, GUID *guid, int width, int height)
669 {
671 
672  TRACE("iface %p, clipper %p, guid %s, width %d, height %d.\n",
673  iface, clipper, debugstr_guid(guid), width, height);
674 
675  return d3drm_device3_InitFromClipper(&device->IDirect3DRMDevice3_iface,
676  clipper, guid, width, height);
677 }
678 
679 static HRESULT WINAPI d3drm_device1_InitFromClipper(IDirect3DRMDevice *iface,
680  IDirectDrawClipper *clipper, GUID *guid, int width, int height)
681 {
683 
684  TRACE("iface %p, clipper %p, guid %s, width %d, height %d.\n",
685  iface, clipper, debugstr_guid(guid), width, height);
686 
687  return d3drm_device3_InitFromClipper(&device->IDirect3DRMDevice3_iface,
688  clipper, guid, width, height);
689 }
690 
691 static HRESULT WINAPI d3drm_device3_Update(IDirect3DRMDevice3 *iface)
692 {
693  FIXME("iface %p stub!\n", iface);
694 
695  return D3DRM_OK;
696 }
697 
698 static HRESULT WINAPI d3drm_device2_Update(IDirect3DRMDevice2 *iface)
699 {
700  FIXME("iface %p stub!\n", iface);
701 
702  return D3DRM_OK;
703 }
704 
705 static HRESULT WINAPI d3drm_device1_Update(IDirect3DRMDevice *iface)
706 {
707  FIXME("iface %p stub!\n", iface);
708 
709  return D3DRM_OK;
710 }
711 
712 static HRESULT WINAPI d3drm_device3_AddUpdateCallback(IDirect3DRMDevice3 *iface,
713  D3DRMUPDATECALLBACK cb, void *ctx)
714 {
715  FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
716 
717  return E_NOTIMPL;
718 }
719 
720 static HRESULT WINAPI d3drm_device2_AddUpdateCallback(IDirect3DRMDevice2 *iface,
721  D3DRMUPDATECALLBACK cb, void *ctx)
722 {
723  FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
724 
725  return E_NOTIMPL;
726 }
727 
728 static HRESULT WINAPI d3drm_device1_AddUpdateCallback(IDirect3DRMDevice *iface,
729  D3DRMUPDATECALLBACK cb, void *ctx)
730 {
731  FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
732 
733  return E_NOTIMPL;
734 }
735 
736 static HRESULT WINAPI d3drm_device3_DeleteUpdateCallback(IDirect3DRMDevice3 *iface,
737  D3DRMUPDATECALLBACK cb, void *ctx)
738 {
739  FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
740 
741  return E_NOTIMPL;
742 }
743 
744 static HRESULT WINAPI d3drm_device2_DeleteUpdateCallback(IDirect3DRMDevice2 *iface,
745  D3DRMUPDATECALLBACK cb, void *ctx)
746 {
747  FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
748 
749  return E_NOTIMPL;
750 }
751 
752 static HRESULT WINAPI d3drm_device1_DeleteUpdateCallback(IDirect3DRMDevice *iface,
753  D3DRMUPDATECALLBACK cb, void *ctx)
754 {
755  FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
756 
757  return E_NOTIMPL;
758 }
759 
760 static HRESULT WINAPI d3drm_device3_SetBufferCount(IDirect3DRMDevice3 *iface, DWORD count)
761 {
762  FIXME("iface %p, count %u stub!\n", iface, count);
763 
764  return E_NOTIMPL;
765 }
766 
767 static HRESULT WINAPI d3drm_device2_SetBufferCount(IDirect3DRMDevice2 *iface, DWORD count)
768 {
770 
771  TRACE("iface %p, count %u.\n", iface, count);
772 
773  return d3drm_device3_SetBufferCount(&device->IDirect3DRMDevice3_iface, count);
774 }
775 
776 static HRESULT WINAPI d3drm_device1_SetBufferCount(IDirect3DRMDevice *iface, DWORD count)
777 {
779 
780  TRACE("iface %p, count %u.\n", iface, count);
781 
782  return d3drm_device3_SetBufferCount(&device->IDirect3DRMDevice3_iface, count);
783 }
784 
785 static DWORD WINAPI d3drm_device3_GetBufferCount(IDirect3DRMDevice3 *iface)
786 {
787  FIXME("iface %p stub!\n", iface);
788 
789  return E_NOTIMPL;
790 }
791 
792 static DWORD WINAPI d3drm_device2_GetBufferCount(IDirect3DRMDevice2 *iface)
793 {
795 
796  TRACE("iface %p.\n", iface);
797 
798  return d3drm_device3_GetBufferCount(&device->IDirect3DRMDevice3_iface);
799 }
800 
801 static DWORD WINAPI d3drm_device1_GetBufferCount(IDirect3DRMDevice *iface)
802 {
804 
805  TRACE("iface %p.\n", iface);
806 
807  return d3drm_device3_GetBufferCount(&device->IDirect3DRMDevice3_iface);
808 }
809 
810 static HRESULT WINAPI d3drm_device3_SetDither(IDirect3DRMDevice3 *iface, BOOL enable)
811 {
813 
814  TRACE("iface %p, enable %#x.\n", iface, enable);
815 
816  device->dither = enable;
817 
818  return D3DRM_OK;
819 }
820 
821 static HRESULT WINAPI d3drm_device2_SetDither(IDirect3DRMDevice2 *iface, BOOL enable)
822 {
824 
825  TRACE("iface %p, enabled %#x.\n", iface, enable);
826 
827  return d3drm_device3_SetDither(&device->IDirect3DRMDevice3_iface, enable);
828 }
829 
830 static HRESULT WINAPI d3drm_device1_SetDither(IDirect3DRMDevice *iface, BOOL enable)
831 {
833 
834  TRACE("iface %p, enabled %#x.\n", iface, enable);
835 
836  return d3drm_device3_SetDither(&device->IDirect3DRMDevice3_iface, enable);
837 }
838 
839 static HRESULT WINAPI d3drm_device3_SetShades(IDirect3DRMDevice3 *iface, DWORD count)
840 {
841  FIXME("iface %p, count %u stub!\n", iface, count);
842 
843  return E_NOTIMPL;
844 }
845 
846 static HRESULT WINAPI d3drm_device2_SetShades(IDirect3DRMDevice2 *iface, DWORD count)
847 {
849 
850  TRACE("iface %p, count %u.\n", iface, count);
851 
852  return d3drm_device3_SetShades(&device->IDirect3DRMDevice3_iface, count);
853 }
854 
855 static HRESULT WINAPI d3drm_device1_SetShades(IDirect3DRMDevice *iface, DWORD count)
856 {
858 
859  TRACE("iface %p, count %u.\n", iface, count);
860 
861  return d3drm_device3_SetShades(&device->IDirect3DRMDevice3_iface, count);
862 }
863 
865 {
867 
868  TRACE("iface %p, quality %u.\n", iface, quality);
869 
870  device->quality = quality;
871 
872  return D3DRM_OK;
873 }
874 
876 {
878 
879  TRACE("iface %p, quality %u.\n", iface, quality);
880 
881  return d3drm_device3_SetQuality(&device->IDirect3DRMDevice3_iface, quality);
882 }
883 
885 {
887 
888  TRACE("iface %p, quality %u.\n", iface, quality);
889 
890  return d3drm_device3_SetQuality(&device->IDirect3DRMDevice3_iface, quality);
891 }
892 
894 {
895  FIXME("iface %p, quality %u stub!\n", iface, quality);
896 
897  return E_NOTIMPL;
898 }
899 
901 {
903 
904  TRACE("iface %p, quality %u.\n", iface, quality);
905 
906  return d3drm_device3_SetTextureQuality(&device->IDirect3DRMDevice3_iface, quality);
907 }
908 
910 {
912 
913  TRACE("iface %p, quality %u.\n", iface, quality);
914 
915  return d3drm_device3_SetTextureQuality(&device->IDirect3DRMDevice3_iface, quality);
916 }
917 
918 static HRESULT WINAPI d3drm_device3_GetViewports(IDirect3DRMDevice3 *iface, IDirect3DRMViewportArray **array)
919 {
920  FIXME("iface %p, array %p stub!\n", iface, array);
921 
922  return E_NOTIMPL;
923 }
924 
925 static HRESULT WINAPI d3drm_device2_GetViewports(IDirect3DRMDevice2 *iface, IDirect3DRMViewportArray **array)
926 {
928 
929  TRACE("iface %p, array %p.\n", iface, array);
930 
931  return d3drm_device3_GetViewports(&device->IDirect3DRMDevice3_iface, array);
932 }
933 
934 static HRESULT WINAPI d3drm_device1_GetViewports(IDirect3DRMDevice *iface, IDirect3DRMViewportArray **array)
935 {
937 
938  TRACE("iface %p, array %p.\n", iface, array);
939 
940  return d3drm_device3_GetViewports(&device->IDirect3DRMDevice3_iface, array);
941 }
942 
943 static BOOL WINAPI d3drm_device3_GetDither(IDirect3DRMDevice3 *iface)
944 {
946 
947  TRACE("iface %p.\n", iface);
948 
949  return device->dither;
950 }
951 
952 static BOOL WINAPI d3drm_device2_GetDither(IDirect3DRMDevice2 *iface)
953 {
955 
956  TRACE("iface %p.\n", iface);
957 
958  return d3drm_device3_GetDither(&device->IDirect3DRMDevice3_iface);
959 }
960 
961 static BOOL WINAPI d3drm_device1_GetDither(IDirect3DRMDevice *iface)
962 {
964 
965  TRACE("iface %p.\n", iface);
966 
967  return d3drm_device3_GetDither(&device->IDirect3DRMDevice3_iface);
968 }
969 
970 static DWORD WINAPI d3drm_device3_GetShades(IDirect3DRMDevice3 *iface)
971 {
972  FIXME("iface %p stub!\n", iface);
973 
974  return E_NOTIMPL;
975 }
976 
977 static DWORD WINAPI d3drm_device2_GetShades(IDirect3DRMDevice2 *iface)
978 {
980 
981  TRACE("iface %p.\n", iface);
982 
983  return d3drm_device3_GetShades(&device->IDirect3DRMDevice3_iface);
984 }
985 
986 static DWORD WINAPI d3drm_device1_GetShades(IDirect3DRMDevice *iface)
987 {
989 
990  TRACE("iface %p.\n", iface);
991 
992  return d3drm_device3_GetShades(&device->IDirect3DRMDevice3_iface);
993 }
994 
995 static DWORD WINAPI d3drm_device3_GetHeight(IDirect3DRMDevice3 *iface)
996 {
998 
999  TRACE("iface %p.\n", iface);
1000 
1001  return device->height;
1002 }
1003 
1004 static DWORD WINAPI d3drm_device2_GetHeight(IDirect3DRMDevice2 *iface)
1005 {
1007 
1008  TRACE("iface %p.\n", iface);
1009 
1010  return d3drm_device3_GetHeight(&device->IDirect3DRMDevice3_iface);
1011 }
1012 
1013 static DWORD WINAPI d3drm_device1_GetHeight(IDirect3DRMDevice *iface)
1014 {
1016 
1017  TRACE("iface %p.\n", iface);
1018 
1019  return d3drm_device3_GetHeight(&device->IDirect3DRMDevice3_iface);
1020 }
1021 
1022 static DWORD WINAPI d3drm_device3_GetWidth(IDirect3DRMDevice3 *iface)
1023 {
1025 
1026  TRACE("iface %p.\n", iface);
1027 
1028  return device->width;
1029 }
1030 
1031 static DWORD WINAPI d3drm_device2_GetWidth(IDirect3DRMDevice2 *iface)
1032 {
1034 
1035  TRACE("iface %p.\n", iface);
1036 
1037  return d3drm_device3_GetWidth(&device->IDirect3DRMDevice3_iface);
1038 }
1039 
1040 static DWORD WINAPI d3drm_device1_GetWidth(IDirect3DRMDevice *iface)
1041 {
1043 
1044  TRACE("iface %p.\n", iface);
1045 
1046  return d3drm_device3_GetWidth(&device->IDirect3DRMDevice3_iface);
1047 }
1048 
1049 static DWORD WINAPI d3drm_device3_GetTrianglesDrawn(IDirect3DRMDevice3 *iface)
1050 {
1051  FIXME("iface %p stub!\n", iface);
1052 
1053  return E_NOTIMPL;
1054 }
1055 
1056 static DWORD WINAPI d3drm_device2_GetTrianglesDrawn(IDirect3DRMDevice2 *iface)
1057 {
1059 
1060  TRACE("iface %p.\n", iface);
1061 
1062  return d3drm_device3_GetTrianglesDrawn(&device->IDirect3DRMDevice3_iface);
1063 }
1064 
1065 static DWORD WINAPI d3drm_device1_GetTrianglesDrawn(IDirect3DRMDevice *iface)
1066 {
1068 
1069  TRACE("iface %p.\n", iface);
1070 
1071  return d3drm_device3_GetTrianglesDrawn(&device->IDirect3DRMDevice3_iface);
1072 }
1073 
1074 static DWORD WINAPI d3drm_device3_GetWireframeOptions(IDirect3DRMDevice3 *iface)
1075 {
1076  FIXME("iface %p stub!\n", iface);
1077 
1078  return E_NOTIMPL;
1079 }
1080 
1081 static DWORD WINAPI d3drm_device2_GetWireframeOptions(IDirect3DRMDevice2 *iface)
1082 {
1084 
1085  TRACE("iface %p.\n", iface);
1086 
1087  return d3drm_device3_GetWireframeOptions(&device->IDirect3DRMDevice3_iface);
1088 }
1089 
1090 static DWORD WINAPI d3drm_device1_GetWireframeOptions(IDirect3DRMDevice *iface)
1091 {
1093 
1094  TRACE("iface %p.\n", iface);
1095 
1096  return d3drm_device3_GetWireframeOptions(&device->IDirect3DRMDevice3_iface);
1097 }
1098 
1099 static D3DRMRENDERQUALITY WINAPI d3drm_device3_GetQuality(IDirect3DRMDevice3 *iface)
1100 {
1102 
1103  TRACE("iface %p.\n", iface);
1104 
1105  return device->quality;
1106 }
1107 
1108 static D3DRMRENDERQUALITY WINAPI d3drm_device2_GetQuality(IDirect3DRMDevice2 *iface)
1109 {
1111 
1112  TRACE("iface %p.\n", iface);
1113 
1114  return d3drm_device3_GetQuality(&device->IDirect3DRMDevice3_iface);
1115 }
1116 
1117 static D3DRMRENDERQUALITY WINAPI d3drm_device1_GetQuality(IDirect3DRMDevice *iface)
1118 {
1120 
1121  TRACE("iface %p.\n", iface);
1122 
1123  return d3drm_device3_GetQuality(&device->IDirect3DRMDevice3_iface);
1124 }
1125 
1126 static D3DCOLORMODEL WINAPI d3drm_device3_GetColorModel(IDirect3DRMDevice3 *iface)
1127 {
1128  FIXME("iface %p stub!\n", iface);
1129 
1130  return E_NOTIMPL;
1131 }
1132 
1133 static D3DCOLORMODEL WINAPI d3drm_device2_GetColorModel(IDirect3DRMDevice2 *iface)
1134 {
1136 
1137  TRACE("iface %p.\n", iface);
1138 
1139  return d3drm_device3_GetColorModel(&device->IDirect3DRMDevice3_iface);
1140 }
1141 
1142 static D3DCOLORMODEL WINAPI d3drm_device1_GetColorModel(IDirect3DRMDevice *iface)
1143 {
1145 
1146  TRACE("iface %p.\n", iface);
1147 
1148  return d3drm_device3_GetColorModel(&device->IDirect3DRMDevice3_iface);
1149 }
1150 
1152 {
1153  FIXME("iface %p stub!\n", iface);
1154 
1155  return E_NOTIMPL;
1156 }
1157 
1159 {
1161 
1162  TRACE("iface %p.\n", iface);
1163 
1164  return d3drm_device3_GetTextureQuality(&device->IDirect3DRMDevice3_iface);
1165 }
1166 
1168 {
1170 
1171  TRACE("iface %p.\n", iface);
1172 
1173  return d3drm_device3_GetTextureQuality(&device->IDirect3DRMDevice3_iface);
1174 }
1175 
1176 static HRESULT WINAPI d3drm_device3_GetDirect3DDevice(IDirect3DRMDevice3 *iface, IDirect3DDevice **d3d_device)
1177 {
1179  TRACE("iface %p, d3d_device %p!\n", iface, d3d_device);
1180 
1181  *d3d_device = device->device;
1183 
1184  return D3DRM_OK;
1185 }
1186 
1187 static HRESULT WINAPI d3drm_device2_GetDirect3DDevice(IDirect3DRMDevice2 *iface, IDirect3DDevice **d3d_device)
1188 {
1190 
1191  TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
1192 
1193  return d3drm_device3_GetDirect3DDevice(&device->IDirect3DRMDevice3_iface, d3d_device);
1194 }
1195 
1196 static HRESULT WINAPI d3drm_device1_GetDirect3DDevice(IDirect3DRMDevice *iface, IDirect3DDevice **d3d_device)
1197 {
1199 
1200  TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
1201 
1202  return d3drm_device3_GetDirect3DDevice(&device->IDirect3DRMDevice3_iface, d3d_device);
1203 }
1204 
1205 static HRESULT WINAPI d3drm_device3_InitFromD3D2(IDirect3DRMDevice3 *iface,
1206  IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device)
1207 {
1209  IDirect3D *d3d1;
1210  IDirect3DDevice *d3d_device1;
1211  HRESULT hr;
1212 
1213  TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
1214 
1215  if (!d3d || !d3d_device)
1216  return D3DRMERR_BADVALUE;
1217 
1218  if (FAILED(hr = IDirect3D2_QueryInterface(d3d, &IID_IDirect3D, (void **)&d3d1)))
1219  return hr;
1220  if (FAILED(hr = IDirect3DDevice2_QueryInterface(d3d_device, &IID_IDirect3DDevice, (void **)&d3d_device1)))
1221  {
1222  IDirect3D_Release(d3d1);
1223  return hr;
1224  }
1225 
1226  hr = d3drm_device_set_ddraw_device_d3d(device, d3d1, d3d_device1);
1227  IDirect3D_Release(d3d1);
1228  IDirect3DDevice_Release(d3d_device1);
1229 
1230  return hr;
1231 }
1232 
1233 static HRESULT WINAPI d3drm_device2_InitFromD3D2(IDirect3DRMDevice2 *iface,
1234  IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device)
1235 {
1237 
1238  TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
1239 
1240  return d3drm_device3_InitFromD3D2(&device->IDirect3DRMDevice3_iface, d3d, d3d_device);
1241 }
1242 
1243 static HRESULT WINAPI d3drm_device3_InitFromSurface(IDirect3DRMDevice3 *iface,
1244  GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer)
1245 {
1246  FIXME("iface %p, guid %s, ddraw %p, backbuffer %p stub!\n",
1247  iface, debugstr_guid(guid), ddraw, backbuffer);
1248 
1249  return E_NOTIMPL;
1250 }
1251 
1252 static HRESULT WINAPI d3drm_device2_InitFromSurface(IDirect3DRMDevice2 *iface,
1253  GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer)
1254 {
1256 
1257  TRACE("iface %p, guid %s, ddraw %p, backbuffer %p.\n",
1258  iface, debugstr_guid(guid), ddraw, backbuffer);
1259 
1260  return d3drm_device3_InitFromSurface(&device->IDirect3DRMDevice3_iface, guid, ddraw, backbuffer);
1261 }
1262 
1263 static HRESULT WINAPI d3drm_device3_SetRenderMode(IDirect3DRMDevice3 *iface, DWORD flags)
1264 {
1266 
1267  TRACE("iface %p, flags %#x.\n", iface, flags);
1268 
1269  device->rendermode = flags;
1270 
1271  return D3DRM_OK;
1272 }
1273 
1274 static HRESULT WINAPI d3drm_device2_SetRenderMode(IDirect3DRMDevice2 *iface, DWORD flags)
1275 {
1277 
1278  TRACE("iface %p, flags %#x.\n", iface, flags);
1279 
1280  return d3drm_device3_SetRenderMode(&device->IDirect3DRMDevice3_iface, flags);
1281 }
1282 
1283 static DWORD WINAPI d3drm_device3_GetRenderMode(IDirect3DRMDevice3 *iface)
1284 {
1286 
1287  TRACE("iface %p.\n", iface);
1288 
1289  return device->rendermode;
1290 }
1291 
1292 static DWORD WINAPI d3drm_device2_GetRenderMode(IDirect3DRMDevice2 *iface)
1293 {
1295 
1296  TRACE("iface %p.\n", iface);
1297 
1298  return d3drm_device3_GetRenderMode(&device->IDirect3DRMDevice3_iface);
1299 }
1300 
1301 static HRESULT WINAPI d3drm_device3_GetDirect3DDevice2(IDirect3DRMDevice3 *iface, IDirect3DDevice2 **d3d_device)
1302 {
1304 
1305  TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
1306 
1307  if (FAILED(IDirect3DDevice_QueryInterface(device->device, &IID_IDirect3DDevice2, (void**)d3d_device)))
1308  return D3DRMERR_BADOBJECT;
1309 
1310  return D3DRM_OK;
1311 }
1312 
1313 static HRESULT WINAPI d3drm_device2_GetDirect3DDevice2(IDirect3DRMDevice2 *iface, IDirect3DDevice2 **d3d_device)
1314 {
1316 
1317  TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
1318 
1319  IDirect3DDevice_QueryInterface(device->device, &IID_IDirect3DDevice2, (void**)d3d_device);
1320 
1321  /* d3drm returns D3DRM_OK even if the call fails. */
1322  return D3DRM_OK;
1323 }
1324 
1326  DWORD bitdepths, DWORD flags, DDPIXELFORMAT *pf)
1327 {
1328  FIXME("iface %p, bitdepths %u, flags %#x, pf %p stub!\n", iface, bitdepths, flags, pf);
1329 
1330  return E_NOTIMPL;
1331 }
1332 
1333 static HRESULT WINAPI d3drm_device3_RenderStateChange(IDirect3DRMDevice3 *iface,
1335 {
1336  FIXME("iface %p, state %#x, value %#x, flags %#x stub!\n", iface, state, value, flags);
1337 
1338  return E_NOTIMPL;
1339 }
1340 
1341 static HRESULT WINAPI d3drm_device3_LightStateChange(IDirect3DRMDevice3 *iface,
1343 {
1344  FIXME("iface %p, state %#x, value %#x, flags %#x stub!\n", iface, state, value, flags);
1345 
1346  return E_NOTIMPL;
1347 }
1348 
1349 static HRESULT WINAPI d3drm_device3_GetStateChangeOptions(IDirect3DRMDevice3 *iface,
1350  DWORD state_class, DWORD state_idx, DWORD *flags)
1351 {
1352  FIXME("iface %p, state_class %#x, state_idx %#x, flags %p stub!\n",
1353  iface, state_class, state_idx, flags);
1354 
1355  return E_NOTIMPL;
1356 }
1357 
1358 static HRESULT WINAPI d3drm_device3_SetStateChangeOptions(IDirect3DRMDevice3 *iface,
1359  DWORD state_class, DWORD state_idx, DWORD flags)
1360 {
1361  FIXME("iface %p, state_class %#x, state_idx %#x, flags %#x stub!\n",
1362  iface, state_class, state_idx, flags);
1363 
1364  return E_NOTIMPL;
1365 }
1366 
1367 static const struct IDirect3DRMDevice3Vtbl d3drm_device3_vtbl =
1368 {
1413 };
1414 
1415 static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl =
1416 {
1456 };
1457 
1458 static const struct IDirect3DRMDeviceVtbl d3drm_device1_vtbl =
1459 {
1494 };
1495 
1496 static HRESULT WINAPI d3drm_device_win_QueryInterface(IDirect3DRMWinDevice *iface, REFIID riid, void **out)
1497 {
1499 
1500  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
1501 
1502  return d3drm_device3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out);
1503 }
1504 
1505 static ULONG WINAPI d3drm_device_win_AddRef(IDirect3DRMWinDevice *iface)
1506 {
1508 
1509  TRACE("iface %p.\n", iface);
1510 
1511  return d3drm_device3_AddRef(&device->IDirect3DRMDevice3_iface);
1512 }
1513 
1514 static ULONG WINAPI d3drm_device_win_Release(IDirect3DRMWinDevice *iface)
1515 {
1517 
1518  TRACE("iface %p.\n", iface);
1519 
1520  return d3drm_device3_Release(&device->IDirect3DRMDevice3_iface);
1521 }
1522 
1523 static HRESULT WINAPI d3drm_device_win_Clone(IDirect3DRMWinDevice *iface,
1524  IUnknown *outer, REFIID iid, void **out)
1525 {
1527 
1528  TRACE("iface %p, outer %p, iid %s, out %p\n", iface, outer, debugstr_guid(iid), out);
1529 
1530  return d3drm_device3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out);
1531 }
1532 
1533 static HRESULT WINAPI d3drm_device_win_AddDestroyCallback(IDirect3DRMWinDevice *iface,
1534  D3DRMOBJECTCALLBACK cb, void *ctx)
1535 {
1536  FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1537 
1538  return E_NOTIMPL;
1539 }
1540 
1541 static HRESULT WINAPI d3drm_device_win_DeleteDestroyCallback(IDirect3DRMWinDevice *iface,
1542  D3DRMOBJECTCALLBACK cb, void *ctx)
1543 {
1544  FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1545 
1546  return E_NOTIMPL;
1547 }
1548 
1549 static HRESULT WINAPI d3drm_device_win_SetAppData(IDirect3DRMWinDevice *iface, DWORD data)
1550 {
1552 
1553  TRACE("iface %p, data %#x.\n", iface, data);
1554 
1555  return d3drm_device3_SetAppData(&device->IDirect3DRMDevice3_iface, data);
1556 }
1557 
1558 static DWORD WINAPI d3drm_device_win_GetAppData(IDirect3DRMWinDevice *iface)
1559 {
1561 
1562  TRACE("iface %p.\n", iface);
1563 
1564  return d3drm_device3_GetAppData(&device->IDirect3DRMDevice3_iface);
1565 }
1566 
1567 static HRESULT WINAPI d3drm_device_win_SetName(IDirect3DRMWinDevice *iface, const char *name)
1568 {
1570 
1571  TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1572 
1573  return d3drm_device3_SetName(&device->IDirect3DRMDevice3_iface, name);
1574 }
1575 
1576 static HRESULT WINAPI d3drm_device_win_GetName(IDirect3DRMWinDevice *iface, DWORD *size, char *name)
1577 {
1579 
1580  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
1581 
1582  return d3drm_device3_GetName(&device->IDirect3DRMDevice3_iface, size, name);
1583 }
1584 
1585 static HRESULT WINAPI d3drm_device_win_GetClassName(IDirect3DRMWinDevice *iface, DWORD *size, char *name)
1586 {
1588 
1589  TRACE("iface %p, size %p, name %p.\n", iface, size, name);
1590 
1591  return d3drm_device3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name);
1592 }
1593 
1594 static HRESULT WINAPI d3drm_device_win_HandlePaint(IDirect3DRMWinDevice *iface, HDC dc)
1595 {
1596  FIXME("iface %p, dc %p stub!\n", iface, dc);
1597 
1598  return D3DRM_OK;
1599 }
1600 
1601 static HRESULT WINAPI d3drm_device_win_HandleActivate(IDirect3DRMWinDevice *iface, WORD wparam)
1602 {
1603  FIXME("iface %p, wparam %#x stub!\n", iface, wparam);
1604 
1605  return D3DRM_OK;
1606 }
1607 
1608 static const struct IDirect3DRMWinDeviceVtbl d3drm_device_win_vtbl =
1609 {
1623 };
1624 
1625 struct d3drm_device *unsafe_impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface)
1626 {
1627  if (!iface)
1628  return NULL;
1629  assert(iface->lpVtbl == &d3drm_device3_vtbl);
1630 
1631  return impl_from_IDirect3DRMDevice3(iface);
1632 }
1633 
1635 {
1636  static const char classname[] = "Device";
1637  struct d3drm_device *object;
1638 
1639  TRACE("device %p, d3drm %p.\n", device, d3drm);
1640 
1641  if (!(object = heap_alloc_zero(sizeof(*object))))
1642  return E_OUTOFMEMORY;
1643 
1644  object->IDirect3DRMDevice_iface.lpVtbl = &d3drm_device1_vtbl;
1645  object->IDirect3DRMDevice2_iface.lpVtbl = &d3drm_device2_vtbl;
1646  object->IDirect3DRMDevice3_iface.lpVtbl = &d3drm_device3_vtbl;
1647  object->IDirect3DRMWinDevice_iface.lpVtbl = &d3drm_device_win_vtbl;
1648  object->d3drm = d3drm;
1650 
1651  *device = object;
1652 
1653  return D3DRM_OK;
1654 }
static DWORD WINAPI d3drm_device2_GetWidth(IDirect3DRMDevice2 *iface)
Definition: device.c:1031
static HRESULT WINAPI d3drm_device3_SetBufferCount(IDirect3DRMDevice3 *iface, DWORD count)
Definition: device.c:760
static HRESULT WINAPI d3drm_device2_SetBufferCount(IDirect3DRMDevice2 *iface, DWORD count)
Definition: device.c:767
static D3DRMTEXTUREQUALITY WINAPI d3drm_device1_GetTextureQuality(IDirect3DRMDevice *iface)
Definition: device.c:1167
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object)
Definition: d3drm_main.c:153
static HRESULT WINAPI d3drm_device3_QueryInterface(IDirect3DRMDevice3 *iface, REFIID riid, void **out)
Definition: device.c:252
static HRESULT WINAPI d3drm_device2_InitFromD3D(IDirect3DRMDevice2 *iface, IDirect3D *d3d, IDirect3DDevice *d3d_device)
Definition: device.c:630
GLint GLint GLsizei width
Definition: gl.h:1546
#define DDSCAPS_3DDEVICE
Definition: ddraw.h:263
static D3DRMRENDERQUALITY WINAPI d3drm_device3_GetQuality(IDirect3DRMDevice3 *iface)
Definition: device.c:1099
static HRESULT WINAPI d3drm_device2_AddDestroyCallback(IDirect3DRMDevice2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: device.c:402
static HRESULT WINAPI d3drm_device3_InitFromSurface(IDirect3DRMDevice3 *iface, GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer)
Definition: device.c:1243
#define IDirect3DDevice2_QueryInterface(p, a, b)
Definition: d3d.h:1062
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
static D3DRMTEXTUREQUALITY WINAPI d3drm_device3_GetTextureQuality(IDirect3DRMDevice3 *iface)
Definition: device.c:1151
static DWORD WINAPI d3drm_device3_GetHeight(IDirect3DRMDevice3 *iface)
Definition: device.c:995
static HRESULT WINAPI d3drm_device3_GetDirect3DDevice(IDirect3DRMDevice3 *iface, IDirect3DDevice **d3d_device)
Definition: device.c:1176
#define IDirect3DDevice_Release(p)
Definition: d3d.h:966
static DWORD WINAPI d3drm_device1_GetHeight(IDirect3DRMDevice *iface)
Definition: device.c:1013
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WINAPI d3drm_device1_SetAppData(IDirect3DRMDevice *iface, DWORD data)
Definition: device.c:472
static HRESULT WINAPI d3drm_device3_SetQuality(IDirect3DRMDevice3 *iface, D3DRMRENDERQUALITY quality)
Definition: device.c:864
static D3DRMTEXTUREQUALITY WINAPI d3drm_device2_GetTextureQuality(IDirect3DRMDevice2 *iface)
Definition: device.c:1158
static D3DRMRENDERQUALITY WINAPI d3drm_device2_GetQuality(IDirect3DRMDevice2 *iface)
Definition: device.c:1108
static HRESULT WINAPI d3drm_device2_Clone(IDirect3DRMDevice2 *iface, IUnknown *outer, REFIID iid, void **out)
Definition: device.c:372
static HRESULT WINAPI d3drm_device2_GetName(IDirect3DRMDevice2 *iface, DWORD *size, char *name)
Definition: device.c:544
static D3DCOLORMODEL WINAPI d3drm_device3_GetColorModel(IDirect3DRMDevice3 *iface)
Definition: device.c:1126
static HRESULT WINAPI d3drm_device3_GetViewports(IDirect3DRMDevice3 *iface, IDirect3DRMViewportArray **array)
Definition: device.c:918
static DWORD WINAPI d3drm_device1_GetWidth(IDirect3DRMDevice *iface)
Definition: device.c:1040
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI d3drm_device3_GetDirect3DDevice2(IDirect3DRMDevice3 *iface, IDirect3DDevice2 **d3d_device)
Definition: device.c:1301
static HRESULT WINAPI d3drm_device3_SetShades(IDirect3DRMDevice3 *iface, DWORD count)
Definition: device.c:839
GLuint GLuint GLsizei count
Definition: gl.h:1545
static HRESULT WINAPI d3drm_device1_GetViewports(IDirect3DRMDevice *iface, IDirect3DRMViewportArray **array)
Definition: device.c:934
static HRESULT WINAPI d3drm_device2_Init(IDirect3DRMDevice2 *iface, ULONG width, ULONG height)
Definition: device.c:601
static D3DCOLORMODEL WINAPI d3drm_device2_GetColorModel(IDirect3DRMDevice2 *iface)
Definition: device.c:1133
static HRESULT WINAPI d3drm_device_win_SetName(IDirect3DRMWinDevice *iface, const char *name)
Definition: device.c:1567
#define WARN(fmt,...)
Definition: debug.h:111
static HRESULT WINAPI d3drm_device3_SetDither(IDirect3DRMDevice3 *iface, BOOL enable)
Definition: device.c:810
static HDC
Definition: imagelist.c:92
static HRESULT WINAPI d3drm_device3_GetName(IDirect3DRMDevice3 *iface, DWORD *size, char *name)
Definition: device.c:535
static struct d3drm_device * impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface)
Definition: device.c:35
static ULONG WINAPI d3drm_device1_AddRef(IDirect3DRMDevice *iface)
Definition: device.c:324
static struct d3drm_device * impl_from_IDirect3DRMDevice(IDirect3DRMDevice *iface)
Definition: device.c:25
static HRESULT WINAPI d3drm_device3_InitFromD3D2(IDirect3DRMDevice3 *iface, IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device)
Definition: device.c:1205
static HRESULT WINAPI d3drm_device3_AddUpdateCallback(IDirect3DRMDevice3 *iface, D3DRMUPDATECALLBACK cb, void *ctx)
Definition: device.c:712
HRESULT d3drm_device_create(struct d3drm_device **device, IDirect3DRM *d3drm)
Definition: device.c:1634
#define ds
Definition: i386-dis.c:434
#define assert(x)
Definition: debug.h:53
static ULONG WINAPI d3drm_device_win_AddRef(IDirect3DRMWinDevice *iface)
Definition: device.c:1505
static DWORD WINAPI d3drm_device2_GetBufferCount(IDirect3DRMDevice2 *iface)
Definition: device.c:792
static ULONG WINAPI d3drm_device3_Release(IDirect3DRMDevice3 *iface)
Definition: device.c:333
static ULONG WINAPI d3drm_device_win_Release(IDirect3DRMWinDevice *iface)
Definition: device.c:1514
static HRESULT WINAPI d3drm_device1_SetQuality(IDirect3DRMDevice *iface, D3DRMRENDERQUALITY quality)
Definition: device.c:884
HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: d3drm_main.c:55
static HRESULT WINAPI d3drm_device_win_AddDestroyCallback(IDirect3DRMWinDevice *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: device.c:1533
static HRESULT WINAPI d3drm_device1_SetBufferCount(IDirect3DRMDevice *iface, DWORD count)
Definition: device.c:776
WCHAR classname[128]
Definition: startup.c:15
static HRESULT WINAPI d3drm_device1_GetName(IDirect3DRMDevice *iface, DWORD *size, char *name)
Definition: device.c:553
static HRESULT WINAPI d3drm_device_win_QueryInterface(IDirect3DRMWinDevice *iface, REFIID riid, void **out)
Definition: device.c:1496
static struct d3drm_device * impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice *iface)
Definition: device.c:64
#define IDirect3D2_Release(p)
Definition: d3d.h:280
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
static D3DRMRENDERQUALITY WINAPI d3drm_device1_GetQuality(IDirect3DRMDevice *iface)
Definition: device.c:1117
#define IDirect3D2_CreateDevice(p, a, b, c)
Definition: d3d.h:287
static HRESULT WINAPI d3drm_device3_Init(IDirect3DRMDevice3 *iface, ULONG width, ULONG height)
Definition: device.c:589
static HRESULT WINAPI d3drm_device1_Init(IDirect3DRMDevice *iface, ULONG width, ULONG height)
Definition: device.c:610
void(__cdecl * D3DRMUPDATECALLBACK)(struct IDirect3DRMDevice *device, void *ctx, int count, D3DRECT *rects)
Definition: d3drmobj.h:160
static const struct IDirect3DRMDevice3Vtbl d3drm_device3_vtbl
Definition: device.c:1367
static DWORD WINAPI d3drm_device3_GetTrianglesDrawn(IDirect3DRMDevice3 *iface)
Definition: device.c:1049
static HRESULT WINAPI d3drm_device3_Update(IDirect3DRMDevice3 *iface)
Definition: device.c:691
static HRESULT WINAPI d3drm_device3_RenderStateChange(IDirect3DRMDevice3 *iface, D3DRENDERSTATETYPE state, DWORD value, DWORD flags)
Definition: device.c:1333
static HRESULT WINAPI d3drm_device2_SetTextureQuality(IDirect3DRMDevice2 *iface, D3DRMTEXTUREQUALITY quality)
Definition: device.c:900
const GUID * guid
IDirect3DRMDevice2 IDirect3DRMDevice2_iface
#define DDSD_CAPS
Definition: ddraw.h:208
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define D3DRMERR_BADOBJECT
Definition: d3drm.h:487
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
unsigned int BOOL
Definition: ntddk_ex.h:94
static HRESULT WINAPI d3drm_device_win_GetName(IDirect3DRMWinDevice *iface, DWORD *size, char *name)
Definition: device.c:1576
static BOOL WINAPI d3drm_device1_GetDither(IDirect3DRMDevice *iface)
Definition: device.c:961
Definition: devices.h:37
static DWORD WINAPI d3drm_device1_GetShades(IDirect3DRMDevice *iface)
Definition: device.c:986
D3DLIGHTSTATETYPE
Definition: d3dtypes.h:860
static const WCHAR desc[]
Definition: protectdata.c:36
static HRESULT WINAPI d3drm_device_win_DeleteDestroyCallback(IDirect3DRMWinDevice *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: device.c:1541
static HRESULT WINAPI d3drm_device_win_HandlePaint(IDirect3DRMWinDevice *iface, HDC dc)
Definition: device.c:1594
static HRESULT WINAPI d3drm_device2_SetRenderMode(IDirect3DRMDevice2 *iface, DWORD flags)
Definition: device.c:1274
static DWORD WINAPI d3drm_device2_GetAppData(IDirect3DRMDevice2 *iface)
Definition: device.c:490
IDirect3DRMDevice IDirect3DRMDevice_iface
#define FIXME(fmt,...)
Definition: debug.h:110
static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl
Definition: device.c:1415
static HRESULT WINAPI d3drm_device2_Update(IDirect3DRMDevice2 *iface)
Definition: device.c:698
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:66
static HRESULT WINAPI d3drm_device1_AddUpdateCallback(IDirect3DRMDevice *iface, D3DRMUPDATECALLBACK cb, void *ctx)
Definition: device.c:728
enum _D3DRMTEXTUREQUALITY D3DRMTEXTUREQUALITY
static HRESULT WINAPI d3drm_device1_DeleteDestroyCallback(IDirect3DRMDevice *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: device.c:442
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_device2_GetViewports(IDirect3DRMDevice2 *iface, IDirect3DRMViewportArray **array)
Definition: device.c:925
static struct d3drm_device * impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2 *iface)
Definition: device.c:30
#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
static HRESULT WINAPI d3drm_device2_AddUpdateCallback(IDirect3DRMDevice2 *iface, D3DRMUPDATECALLBACK cb, void *ctx)
Definition: device.c:720
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 HRESULT WINAPI d3drm_device2_QueryInterface(IDirect3DRMDevice2 *iface, REFIID riid, void **out)
Definition: device.c:287
static HRESULT WINAPI d3drm_device1_Update(IDirect3DRMDevice *iface)
Definition: device.c:705
static HRESULT WINAPI d3drm_device3_DeleteDestroyCallback(IDirect3DRMDevice3 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: device.c:422
static DWORD WINAPI d3drm_device2_GetRenderMode(IDirect3DRMDevice2 *iface)
Definition: device.c:1292
static DWORD WINAPI d3drm_device1_GetTrianglesDrawn(IDirect3DRMDevice *iface)
Definition: device.c:1065
static HRESULT WINAPI d3drm_device1_SetShades(IDirect3DRMDevice *iface, DWORD count)
Definition: device.c:855
static HRESULT WINAPI d3drm_device2_SetQuality(IDirect3DRMDevice2 *iface, D3DRMRENDERQUALITY quality)
Definition: device.c:875
static DWORD WINAPI d3drm_device3_GetRenderMode(IDirect3DRMDevice3 *iface)
Definition: device.c:1283
static HRESULT WINAPI d3drm_device_win_Clone(IDirect3DRMWinDevice *iface, IUnknown *outer, REFIID iid, void **out)
Definition: device.c:1523
#define DDSD_HEIGHT
Definition: ddraw.h:209
#define IDirect3D_QueryInterface(p, a, b)
Definition: d3d.h:231
static DWORD WINAPI d3drm_device3_GetShades(IDirect3DRMDevice3 *iface)
Definition: device.c:970
static DWORD WINAPI d3drm_device3_GetWidth(IDirect3DRMDevice3 *iface)
Definition: device.c:1022
WINE_DEFAULT_DEBUG_CHANNEL(d3d8)
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static HRESULT WINAPI d3drm_device2_DeleteDestroyCallback(IDirect3DRMDevice2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: device.c:432
#define debugstr_a
Definition: kernel32.h:31
static DWORD WINAPI d3drm_device1_GetAppData(IDirect3DRMDevice *iface)
Definition: device.c:499
LONG HRESULT
Definition: typedefs.h:77
static HRESULT WINAPI d3drm_device2_SetAppData(IDirect3DRMDevice2 *iface, DWORD data)
Definition: device.c:463
DWORD D3DCOLORMODEL
Definition: d3dtypes.h:629
#define D3DRM_OK
Definition: d3drm.h:486
static ULONG WINAPI d3drm_device3_AddRef(IDirect3DRMDevice3 *iface)
Definition: device.c:305
static HRESULT WINAPI d3drm_device3_SetTextureQuality(IDirect3DRMDevice3 *iface, D3DRMTEXTUREQUALITY quality)
Definition: device.c:893
const GUID IID_IUnknown
D3DRENDERSTATETYPE
Definition: d3dtypes.h:874
IDirectDrawClipper * clipper
static HRESULT WINAPI d3drm_device1_GetClassName(IDirect3DRMDevice *iface, DWORD *size, char *name)
Definition: device.c:580
static ULONG WINAPI d3drm_device2_Release(IDirect3DRMDevice2 *iface)
Definition: device.c:346
#define WINAPI
Definition: msvc.h:6
static HRESULT WINAPI d3drm_device2_SetShades(IDirect3DRMDevice2 *iface, DWORD count)
Definition: device.c:846
unsigned short WORD
Definition: ntddk_ex.h:93
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDirect3DDevice2_GetRenderTarget(p, a)
Definition: d3d.h:1079
static HRESULT WINAPI d3drm_device2_GetDirect3DDevice2(IDirect3DRMDevice2 *iface, IDirect3DDevice2 **d3d_device)
Definition: device.c:1313
int quality
Definition: jpeglib.h:991
static HRESULT WINAPI d3drm_device2_SetName(IDirect3DRMDevice2 *iface, const char *name)
Definition: device.c:517
static DWORD WINAPI d3drm_device2_GetHeight(IDirect3DRMDevice2 *iface)
Definition: device.c:1004
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
static HRESULT WINAPI d3drm_device1_SetTextureQuality(IDirect3DRMDevice *iface, D3DRMTEXTUREQUALITY quality)
Definition: device.c:909
static HRESULT WINAPI d3drm_device_win_SetAppData(IDirect3DRMWinDevice *iface, DWORD data)
Definition: device.c:1549
static DWORD WINAPI d3drm_device2_GetWireframeOptions(IDirect3DRMDevice2 *iface)
Definition: device.c:1081
#define IDirect3D2_QueryInterface(p, a, b)
Definition: d3d.h:278
void(__cdecl * D3DRMOBJECTCALLBACK)(struct IDirect3DRMObject *obj, void *arg)
Definition: d3drmobj.h:157
static HRESULT WINAPI d3drm_device_win_GetClassName(IDirect3DRMWinDevice *iface, DWORD *size, char *name)
Definition: device.c:1585
static HRESULT WINAPI d3drm_device2_SetDither(IDirect3DRMDevice2 *iface, BOOL enable)
Definition: device.c:821
HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: d3drm_main.c:72
static BOOL WINAPI d3drm_device2_GetDither(IDirect3DRMDevice2 *iface)
Definition: device.c:952
static DWORD WINAPI d3drm_device2_GetShades(IDirect3DRMDevice2 *iface)
Definition: device.c:977
static D3DCOLORMODEL WINAPI d3drm_device1_GetColorModel(IDirect3DRMDevice *iface)
Definition: device.c:1142
#define D3DRMERR_BADVALUE
Definition: d3drm.h:496
#define InterlockedDecrement
Definition: armddk.h:52
IDirect3DRM * d3drm
static int state
Definition: maze.c:121
static DWORD WINAPI d3drm_device3_GetWireframeOptions(IDirect3DRMDevice3 *iface)
Definition: device.c:1074
static HRESULT WINAPI d3drm_device2_InitFromD3D2(IDirect3DRMDevice2 *iface, IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device)
Definition: device.c:1233
static HRESULT WINAPI d3drm_device2_DeleteUpdateCallback(IDirect3DRMDevice2 *iface, D3DRMUPDATECALLBACK cb, void *ctx)
Definition: device.c:744
static IHTMLWindow2 * window
Definition: events.c:77
DWORD D3DRMRENDERQUALITY
Definition: d3drmdef.h:89
static DWORD WINAPI d3drm_device1_GetWireframeOptions(IDirect3DRMDevice *iface)
Definition: device.c:1090
void d3drm_device_destroy(struct d3drm_device *device)
Definition: device.c:40
static HRESULT WINAPI d3drm_device3_DeleteUpdateCallback(IDirect3DRMDevice3 *iface, D3DRMUPDATECALLBACK cb, void *ctx)
Definition: device.c:736
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
Definition: d3drm.c:188
#define DDSD_WIDTH
Definition: ddraw.h:210
#define DDSD_ZBUFFERBITDEPTH
Definition: ddraw.h:213
static const struct IDirect3DRMWinDeviceVtbl d3drm_device_win_vtbl
Definition: device.c:1608
static HRESULT WINAPI d3drm_device3_LightStateChange(IDirect3DRMDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD value, DWORD flags)
Definition: device.c:1341
static HRESULT WINAPI d3drm_device2_GetClassName(IDirect3DRMDevice2 *iface, DWORD *size, char *name)
Definition: device.c:571
#define S_OK
Definition: intsafe.h:59
#define IDirect3DDevice_AddRef(p)
Definition: d3d.h:965
GLboolean enable
Definition: glext.h:11120
static ULONG WINAPI d3drm_device1_Release(IDirect3DRMDevice *iface)
Definition: device.c:355
#define InterlockedIncrement
Definition: armddk.h:53
static HRESULT WINAPI d3drm_device3_GetClassName(IDirect3DRMDevice3 *iface, DWORD *size, char *name)
Definition: device.c:562
static HRESULT WINAPI d3drm_device3_Clone(IDirect3DRMDevice3 *iface, IUnknown *outer, REFIID iid, void **out)
Definition: device.c:364
static HRESULT WINAPI d3drm_device1_AddDestroyCallback(IDirect3DRMDevice *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: device.c:412
#define IDirect3D_Release(p)
Definition: d3d.h:233
static DWORD WINAPI d3drm_device_win_GetAppData(IDirect3DRMWinDevice *iface)
Definition: device.c:1558
static HRESULT WINAPI d3drm_device2_GetDirect3DDevice(IDirect3DRMDevice2 *iface, IDirect3DDevice **d3d_device)
Definition: device.c:1187
#define E_NOTIMPL
Definition: ddrawi.h:99
static ULONG WINAPI d3drm_device2_AddRef(IDirect3DRMDevice2 *iface)
Definition: device.c:315
#define DDSCAPS_PRIMARYSURFACE
Definition: ddraw.h:258
static HRESULT WINAPI d3drm_device1_SetName(IDirect3DRMDevice *iface, const char *name)
Definition: device.c:526
unsigned int UINT
Definition: ndis.h:50
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
static HRESULT WINAPI d3drm_device1_InitFromD3D(IDirect3DRMDevice *iface, IDirect3D *d3d, IDirect3DDevice *d3d_device)
Definition: device.c:640
static HRESULT WINAPI d3drm_device1_QueryInterface(IDirect3DRMDevice *iface, REFIID riid, void **out)
Definition: device.c:296
static HRESULT WINAPI d3drm_device3_FindPreferredTextureFormat(IDirect3DRMDevice3 *iface, DWORD bitdepths, DWORD flags, DDPIXELFORMAT *pf)
Definition: device.c:1325
IDirectDrawSurface * render_target
static HRESULT WINAPI d3drm_device1_Clone(IDirect3DRMDevice *iface, IUnknown *outer, REFIID iid, void **out)
Definition: device.c:382
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
static DWORD WINAPI d3drm_device3_GetBufferCount(IDirect3DRMDevice3 *iface)
Definition: device.c:785
static HRESULT WINAPI d3drm_device3_SetName(IDirect3DRMDevice3 *iface, const char *name)
Definition: device.c:508
Definition: name.c:38
static HRESULT WINAPI d3drm_device2_InitFromSurface(IDirect3DRMDevice2 *iface, GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer)
Definition: device.c:1252
static BOOL WINAPI d3drm_device3_GetDither(IDirect3DRMDevice3 *iface)
Definition: device.c:943
static DWORD WINAPI d3drm_device2_GetTrianglesDrawn(IDirect3DRMDevice2 *iface)
Definition: device.c:1056
HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface)
Definition: device.c:69
IDirect3DRMDevice3 IDirect3DRMDevice3_iface
unsigned int ULONG
Definition: retypes.h:1
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw *ddraw, IDirectDrawSurface *surface, BOOL create_z_surface)
Definition: device.c:120
#define IDirect3DRM_Release(p)
Definition: d3drm.h:111
static HRESULT WINAPI d3drm_device_win_HandleActivate(IDirect3DRMWinDevice *iface, WORD wparam)
Definition: device.c:1601
static const WCHAR dc[]
#define IDirect3DDevice_QueryInterface(p, a, b)
Definition: d3d.h:964
static HRESULT WINAPI d3drm_device3_AddDestroyCallback(IDirect3DRMDevice3 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: device.c:392
static HRESULT WINAPI d3drm_device2_InitFromClipper(IDirect3DRMDevice2 *iface, IDirectDrawClipper *clipper, GUID *guid, int width, int height)
Definition: device.c:667
static DWORD WINAPI d3drm_device1_GetBufferCount(IDirect3DRMDevice *iface)
Definition: device.c:801
static HRESULT WINAPI d3drm_device3_InitFromClipper(IDirect3DRMDevice3 *iface, IDirectDrawClipper *clipper, GUID *guid, int width, int height)
Definition: device.c:653
#define DDSCAPS_OFFSCREENPLAIN
Definition: ddraw.h:255
#define DDSCL_NORMAL
Definition: ddraw.h:535
static HRESULT WINAPI d3drm_device3_InitFromD3D(IDirect3DRMDevice3 *iface, IDirect3D *d3d, IDirect3DDevice *d3d_device)
Definition: device.c:619
static HRESULT WINAPI d3drm_device1_InitFromClipper(IDirect3DRMDevice *iface, IDirectDrawClipper *clipper, GUID *guid, int width, int height)
Definition: device.c:679
static HRESULT WINAPI d3drm_device1_SetDither(IDirect3DRMDevice *iface, BOOL enable)
Definition: device.c:830
struct d3drm_device * unsafe_impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface)
Definition: device.c:1625
IDirectDraw * ddraw
static HRESULT WINAPI d3drm_device1_DeleteUpdateCallback(IDirect3DRMDevice *iface, D3DRMUPDATECALLBACK cb, void *ctx)
Definition: device.c:752
#define memset(x, y, z)
Definition: compat.h:39
static HRESULT WINAPI d3drm_device3_SetStateChangeOptions(IDirect3DRMDevice3 *iface, DWORD state_class, DWORD state_idx, DWORD flags)
Definition: device.c:1358
static const struct IDirect3DRMDeviceVtbl d3drm_device1_vtbl
Definition: device.c:1458
#define IDirect3DDevice2_Release(p)
Definition: d3d.h:1064
static HRESULT WINAPI d3drm_device3_GetStateChangeOptions(IDirect3DRMDevice3 *iface, DWORD state_class, DWORD state_idx, DWORD *flags)
Definition: device.c:1349
static HRESULT WINAPI d3drm_device3_SetAppData(IDirect3DRMDevice3 *iface, DWORD data)
Definition: device.c:452
IDirect3DRMWinDevice IDirect3DRMWinDevice_iface
static HRESULT d3drm_device_set_ddraw_device_d3d(struct d3drm_device *device, IDirect3D *d3d, IDirect3DDevice *d3d_device)
Definition: device.c:203
static HRESULT WINAPI d3drm_device3_SetRenderMode(IDirect3DRMDevice3 *iface, DWORD flags)
Definition: device.c:1263
void * object
Definition: jmemsys.h:48
IDirectDrawSurface * primary_surface
static HRESULT WINAPI d3drm_device1_GetDirect3DDevice(IDirect3DRMDevice *iface, IDirect3DDevice **d3d_device)
Definition: device.c:1196
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static UINT WPARAM wparam
Definition: combo.c:716
static DWORD WINAPI d3drm_device3_GetAppData(IDirect3DRMDevice3 *iface)
Definition: device.c:481
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
HRESULT d3drm_object_set_name(struct d3drm_object *object, const char *name)
Definition: d3drm_main.c:135