2 * Implementation of IDirect3DRMDevice Interface
4 * Copyright 2011, 2012 André Hentschel
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/debug.h"
28 #include "d3drm_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(d3drm
);
36 IDirect3DRMDevice2 IDirect3DRMDevice2_iface
;
37 IDirect3DRMDevice3 IDirect3DRMDevice3_iface
;
38 IDirect3DRMWinDevice IDirect3DRMWinDevice_iface
;
41 D3DRMRENDERQUALITY quality
;
47 static inline struct d3drm_device
*impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2
*iface
)
49 return CONTAINING_RECORD(iface
, struct d3drm_device
, IDirect3DRMDevice2_iface
);
52 static inline struct d3drm_device
*impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3
*iface
)
54 return CONTAINING_RECORD(iface
, struct d3drm_device
, IDirect3DRMDevice3_iface
);
57 static inline struct d3drm_device
*impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice
*iface
)
59 return CONTAINING_RECORD(iface
, struct d3drm_device
, IDirect3DRMWinDevice_iface
);
62 static HRESULT WINAPI
d3drm_device2_QueryInterface(IDirect3DRMDevice2
*iface
, REFIID riid
, void **out
)
64 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
66 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
68 if (IsEqualGUID(riid
, &IID_IDirect3DRMDevice2
)
69 || IsEqualGUID(riid
, &IID_IDirect3DRMDevice
)
70 || IsEqualGUID(riid
, &IID_IUnknown
))
72 *out
= &device
->IDirect3DRMDevice2_iface
;
74 else if (IsEqualGUID(riid
, &IID_IDirect3DRMDevice3
))
76 *out
= &device
->IDirect3DRMDevice3_iface
;
78 else if (IsEqualGUID(riid
, &IID_IDirect3DRMWinDevice
))
80 *out
= &device
->IDirect3DRMWinDevice_iface
;
85 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
89 IUnknown_AddRef((IUnknown
*)*out
);
93 static ULONG WINAPI
d3drm_device2_AddRef(IDirect3DRMDevice2
*iface
)
95 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
96 ULONG refcount
= InterlockedIncrement(&device
->ref
);
98 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
103 static ULONG WINAPI
d3drm_device2_Release(IDirect3DRMDevice2
*iface
)
105 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
106 ULONG refcount
= InterlockedDecrement(&device
->ref
);
108 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
111 HeapFree(GetProcessHeap(), 0, device
);
116 static HRESULT WINAPI
d3drm_device2_Clone(IDirect3DRMDevice2
*iface
,
117 IUnknown
*outer
, REFIID iid
, void **out
)
119 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
124 static HRESULT WINAPI
d3drm_device2_AddDestroyCallback(IDirect3DRMDevice2
*iface
,
125 D3DRMOBJECTCALLBACK cb
, void *ctx
)
127 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
132 static HRESULT WINAPI
d3drm_device2_DeleteDestroyCallback(IDirect3DRMDevice2
*iface
,
133 D3DRMOBJECTCALLBACK cb
, void *ctx
)
135 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
140 static HRESULT WINAPI
d3drm_device2_SetAppData(IDirect3DRMDevice2
*iface
, DWORD data
)
142 FIXME("iface %p, data %#x stub!\n", iface
, data
);
147 static DWORD WINAPI
d3drm_device2_GetAppData(IDirect3DRMDevice2
*iface
)
149 FIXME("iface %p stub!\n", iface
);
154 static HRESULT WINAPI
d3drm_device2_SetName(IDirect3DRMDevice2
*iface
, const char *name
)
156 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
161 static HRESULT WINAPI
d3drm_device2_GetName(IDirect3DRMDevice2
*iface
, DWORD
*size
, char *name
)
163 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
168 static HRESULT WINAPI
d3drm_device2_GetClassName(IDirect3DRMDevice2
*iface
, DWORD
*size
, char *name
)
170 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
172 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
174 return IDirect3DRMDevice3_GetClassName(&device
->IDirect3DRMDevice3_iface
, size
, name
);
177 static HRESULT WINAPI
d3drm_device2_Init(IDirect3DRMDevice2
*iface
, ULONG width
, ULONG height
)
179 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
181 TRACE("iface %p, width %u, height %u.\n", iface
, width
, height
);
183 return IDirect3DRMDevice3_Init(&device
->IDirect3DRMDevice3_iface
, width
, height
);
186 static HRESULT WINAPI
d3drm_device2_InitFromD3D(IDirect3DRMDevice2
*iface
,
187 IDirect3D
*d3d
, IDirect3DDevice
*d3d_device
)
189 FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface
, d3d
, d3d_device
);
194 static HRESULT WINAPI
d3drm_device2_InitFromClipper(IDirect3DRMDevice2
*iface
,
195 IDirectDrawClipper
*clipper
, GUID
*guid
, int width
, int height
)
197 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
199 TRACE("iface %p, clipper %p, guid %s, width %d, height %d.\n",
200 iface
, clipper
, debugstr_guid(guid
), width
, height
);
202 return IDirect3DRMDevice3_InitFromClipper(&device
->IDirect3DRMDevice3_iface
,
203 clipper
, guid
, width
, height
);
206 static HRESULT WINAPI
d3drm_device2_Update(IDirect3DRMDevice2
*iface
)
208 FIXME("iface %p stub!\n", iface
);
213 static HRESULT WINAPI
d3drm_device2_AddUpdateCallback(IDirect3DRMDevice2
*iface
,
214 D3DRMUPDATECALLBACK cb
, void *ctx
)
216 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
221 static HRESULT WINAPI
d3drm_device2_DeleteUpdateCallback(IDirect3DRMDevice2
*iface
,
222 D3DRMUPDATECALLBACK cb
, void *ctx
)
224 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
229 static HRESULT WINAPI
d3drm_device2_SetBufferCount(IDirect3DRMDevice2
*iface
, DWORD count
)
231 FIXME("iface %p, count %u.\n", iface
, count
);
236 static DWORD WINAPI
d3drm_device2_GetBufferCount(IDirect3DRMDevice2
*iface
)
238 FIXME("iface %p stub!\n", iface
);
243 static HRESULT WINAPI
d3drm_device2_SetDither(IDirect3DRMDevice2
*iface
, BOOL enable
)
245 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
247 TRACE("iface %p, enabled %#x.\n", iface
, enable
);
249 return IDirect3DRMDevice3_SetDither(&device
->IDirect3DRMDevice3_iface
, enable
);
252 static HRESULT WINAPI
d3drm_device2_SetShades(IDirect3DRMDevice2
*iface
, DWORD count
)
254 FIXME("iface %p, count %u stub!\n", iface
, count
);
259 static HRESULT WINAPI
d3drm_device2_SetQuality(IDirect3DRMDevice2
*iface
, D3DRMRENDERQUALITY quality
)
261 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
263 TRACE("iface %p, quality %u.\n", iface
, quality
);
265 return IDirect3DRMDevice3_SetQuality(&device
->IDirect3DRMDevice3_iface
, quality
);
268 static HRESULT WINAPI
d3drm_device2_SetTextureQuality(IDirect3DRMDevice2
*iface
, D3DRMTEXTUREQUALITY quality
)
270 FIXME("iface %p, quality %u stub!\n", iface
, quality
);
275 static HRESULT WINAPI
d3drm_device2_GetViewports(IDirect3DRMDevice2
*iface
, IDirect3DRMViewportArray
**array
)
277 FIXME("iface %p, array %p stub!\n", iface
, array
);
282 static BOOL WINAPI
d3drm_device2_GetDither(IDirect3DRMDevice2
*iface
)
284 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
286 TRACE("iface %p.\n", iface
);
288 return IDirect3DRMDevice3_GetDither(&device
->IDirect3DRMDevice3_iface
);
291 static DWORD WINAPI
d3drm_device2_GetShades(IDirect3DRMDevice2
*iface
)
293 FIXME("iface %p stub!\n", iface
);
298 static DWORD WINAPI
d3drm_device2_GetHeight(IDirect3DRMDevice2
*iface
)
300 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
302 TRACE("iface %p.\n", iface
);
304 return IDirect3DRMDevice3_GetHeight(&device
->IDirect3DRMDevice3_iface
);
307 static DWORD WINAPI
d3drm_device2_GetWidth(IDirect3DRMDevice2
*iface
)
309 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
311 TRACE("iface %p.\n", iface
);
313 return IDirect3DRMDevice3_GetWidth(&device
->IDirect3DRMDevice3_iface
);
316 static DWORD WINAPI
d3drm_device2_GetTrianglesDrawn(IDirect3DRMDevice2
*iface
)
318 FIXME("iface %p stub!\n", iface
);
323 static DWORD WINAPI
d3drm_device2_GetWireframeOptions(IDirect3DRMDevice2
*iface
)
325 FIXME("iface %p stub!\n", iface
);
330 static D3DRMRENDERQUALITY WINAPI
d3drm_device2_GetQuality(IDirect3DRMDevice2
*iface
)
332 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
334 TRACE("iface %p.\n", iface
);
336 return IDirect3DRMDevice3_GetQuality(&device
->IDirect3DRMDevice3_iface
);
339 static D3DCOLORMODEL WINAPI
d3drm_device2_GetColorModel(IDirect3DRMDevice2
*iface
)
341 FIXME("iface %p stub!\n", iface
);
346 static D3DRMTEXTUREQUALITY WINAPI
d3drm_device2_GetTextureQuality(IDirect3DRMDevice2
*iface
)
348 FIXME("iface %p stub!\n", iface
);
353 static HRESULT WINAPI
d3drm_device2_GetDirect3DDevice(IDirect3DRMDevice2
*iface
, IDirect3DDevice
**d3d_device
)
355 FIXME("iface %p, d3d_device %p stub!\n", iface
, d3d_device
);
360 static HRESULT WINAPI
d3drm_device2_InitFromD3D2(IDirect3DRMDevice2
*iface
,
361 IDirect3D2
*d3d
, IDirect3DDevice2
*d3d_device
)
363 FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface
, d3d
, d3d_device
);
368 static HRESULT WINAPI
d3drm_device2_InitFromSurface(IDirect3DRMDevice2
*iface
,
369 GUID
*guid
, IDirectDraw
*ddraw
, IDirectDrawSurface
*backbuffer
)
371 FIXME("iface %p, guid %s, ddraw %p, backbuffer %p stub!\n",
372 iface
, debugstr_guid(guid
), ddraw
, backbuffer
);
377 static HRESULT WINAPI
d3drm_device2_SetRenderMode(IDirect3DRMDevice2
*iface
, DWORD flags
)
379 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
381 TRACE("iface %p, flags %#x.\n", iface
, flags
);
383 return IDirect3DRMDevice3_SetRenderMode(&device
->IDirect3DRMDevice3_iface
, flags
);
386 static DWORD WINAPI
d3drm_device2_GetRenderMode(IDirect3DRMDevice2
*iface
)
388 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice2(iface
);
390 TRACE("iface %p.\n", iface
);
392 return IDirect3DRMDevice3_GetRenderMode(&device
->IDirect3DRMDevice3_iface
);
395 static HRESULT WINAPI
d3drm_device2_GetDirect3DDevice2(IDirect3DRMDevice2
*iface
, IDirect3DDevice2
**d3d_device
)
397 FIXME("iface %p, d3d_device %p stub!\n", iface
, d3d_device
);
402 static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl
=
404 d3drm_device2_QueryInterface
,
405 d3drm_device2_AddRef
,
406 d3drm_device2_Release
,
408 d3drm_device2_AddDestroyCallback
,
409 d3drm_device2_DeleteDestroyCallback
,
410 d3drm_device2_SetAppData
,
411 d3drm_device2_GetAppData
,
412 d3drm_device2_SetName
,
413 d3drm_device2_GetName
,
414 d3drm_device2_GetClassName
,
416 d3drm_device2_InitFromD3D
,
417 d3drm_device2_InitFromClipper
,
418 d3drm_device2_Update
,
419 d3drm_device2_AddUpdateCallback
,
420 d3drm_device2_DeleteUpdateCallback
,
421 d3drm_device2_SetBufferCount
,
422 d3drm_device2_GetBufferCount
,
423 d3drm_device2_SetDither
,
424 d3drm_device2_SetShades
,
425 d3drm_device2_SetQuality
,
426 d3drm_device2_SetTextureQuality
,
427 d3drm_device2_GetViewports
,
428 d3drm_device2_GetDither
,
429 d3drm_device2_GetShades
,
430 d3drm_device2_GetHeight
,
431 d3drm_device2_GetWidth
,
432 d3drm_device2_GetTrianglesDrawn
,
433 d3drm_device2_GetWireframeOptions
,
434 d3drm_device2_GetQuality
,
435 d3drm_device2_GetColorModel
,
436 d3drm_device2_GetTextureQuality
,
437 d3drm_device2_GetDirect3DDevice
,
438 d3drm_device2_InitFromD3D2
,
439 d3drm_device2_InitFromSurface
,
440 d3drm_device2_SetRenderMode
,
441 d3drm_device2_GetRenderMode
,
442 d3drm_device2_GetDirect3DDevice2
,
445 static HRESULT WINAPI
d3drm_device3_QueryInterface(IDirect3DRMDevice3
*iface
, REFIID riid
, void **out
)
447 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
449 return d3drm_device2_QueryInterface(&device
->IDirect3DRMDevice2_iface
, riid
, out
);
452 static ULONG WINAPI
d3drm_device3_AddRef(IDirect3DRMDevice3
*iface
)
454 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
456 return d3drm_device2_AddRef(&device
->IDirect3DRMDevice2_iface
);
459 static ULONG WINAPI
d3drm_device3_Release(IDirect3DRMDevice3
*iface
)
461 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
463 return d3drm_device2_Release(&device
->IDirect3DRMDevice2_iface
);
466 static HRESULT WINAPI
d3drm_device3_Clone(IDirect3DRMDevice3
*iface
,
467 IUnknown
*outer
, REFIID iid
, void **out
)
469 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
474 static HRESULT WINAPI
d3drm_device3_AddDestroyCallback(IDirect3DRMDevice3
*iface
,
475 D3DRMOBJECTCALLBACK cb
, void *ctx
)
477 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
482 static HRESULT WINAPI
d3drm_device3_DeleteDestroyCallback(IDirect3DRMDevice3
*iface
,
483 D3DRMOBJECTCALLBACK cb
, void *ctx
)
485 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
490 static HRESULT WINAPI
d3drm_device3_SetAppData(IDirect3DRMDevice3
*iface
, DWORD data
)
492 FIXME("iface %p, data %#x stub!\n", iface
, data
);
497 static DWORD WINAPI
d3drm_device3_GetAppData(IDirect3DRMDevice3
*iface
)
499 FIXME("iface %p stub!\n", iface
);
504 static HRESULT WINAPI
d3drm_device3_SetName(IDirect3DRMDevice3
*iface
, const char *name
)
506 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
511 static HRESULT WINAPI
d3drm_device3_GetName(IDirect3DRMDevice3
*iface
, DWORD
*size
, char *name
)
513 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
518 static HRESULT WINAPI
d3drm_device3_GetClassName(IDirect3DRMDevice3
*iface
, DWORD
*size
, char *name
)
520 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
522 if (!size
|| *size
< strlen("Device") || !name
)
525 strcpy(name
, "Device");
526 *size
= sizeof("Device");
531 static HRESULT WINAPI
d3drm_device3_Init(IDirect3DRMDevice3
*iface
, ULONG width
, ULONG height
)
533 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
535 FIXME("iface %p, width %u, height %u stub!\n", iface
, width
, height
);
537 device
->height
= height
;
538 device
->width
= width
;
543 static HRESULT WINAPI
d3drm_device3_InitFromD3D(IDirect3DRMDevice3
*iface
,
544 IDirect3D
*d3d
, IDirect3DDevice
*d3d_device
)
546 FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface
, d3d
, d3d_device
);
551 static HRESULT WINAPI
d3drm_device3_InitFromClipper(IDirect3DRMDevice3
*iface
,
552 IDirectDrawClipper
*clipper
, GUID
*guid
, int width
, int height
)
554 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
556 FIXME("iface %p, clipper %p, guid %s, width %d, height %d stub!\n",
557 iface
, clipper
, debugstr_guid(guid
), width
, height
);
559 device
->height
= height
;
560 device
->width
= width
;
565 static HRESULT WINAPI
d3drm_device3_Update(IDirect3DRMDevice3
*iface
)
567 FIXME("iface %p stub!\n", iface
);
572 static HRESULT WINAPI
d3drm_device3_AddUpdateCallback(IDirect3DRMDevice3
*iface
,
573 D3DRMUPDATECALLBACK cb
, void *ctx
)
575 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
580 static HRESULT WINAPI
d3drm_device3_DeleteUpdateCallback(IDirect3DRMDevice3
*iface
,
581 D3DRMUPDATECALLBACK cb
, void *ctx
)
583 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
588 static HRESULT WINAPI
d3drm_device3_SetBufferCount(IDirect3DRMDevice3
*iface
, DWORD count
)
590 FIXME("iface %p, count %u stub!\n", iface
, count
);
595 static DWORD WINAPI
d3drm_device3_GetBufferCount(IDirect3DRMDevice3
*iface
)
597 FIXME("iface %p stub!\n", iface
);
602 static HRESULT WINAPI
d3drm_device3_SetDither(IDirect3DRMDevice3
*iface
, BOOL enable
)
604 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
606 TRACE("iface %p, enable %#x.\n", iface
, enable
);
608 device
->dither
= enable
;
613 static HRESULT WINAPI
d3drm_device3_SetShades(IDirect3DRMDevice3
*iface
, DWORD count
)
615 FIXME("iface %p, count %u stub!\n", iface
, count
);
620 static HRESULT WINAPI
d3drm_device3_SetQuality(IDirect3DRMDevice3
*iface
, D3DRMRENDERQUALITY quality
)
622 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
624 TRACE("iface %p, quality %u.\n", iface
, quality
);
626 device
->quality
= quality
;
631 static HRESULT WINAPI
d3drm_device3_SetTextureQuality(IDirect3DRMDevice3
*iface
, D3DRMTEXTUREQUALITY quality
)
633 FIXME("iface %p, quality %u stub!\n", iface
, quality
);
638 static HRESULT WINAPI
d3drm_device3_GetViewports(IDirect3DRMDevice3
*iface
, IDirect3DRMViewportArray
**array
)
640 FIXME("iface %p, array %p stub!\n", iface
, array
);
645 static BOOL WINAPI
d3drm_device3_GetDither(IDirect3DRMDevice3
*iface
)
647 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
649 TRACE("iface %p.\n", iface
);
651 return device
->dither
;
654 static DWORD WINAPI
d3drm_device3_GetShades(IDirect3DRMDevice3
*iface
)
656 FIXME("iface %p stub!\n", iface
);
661 static DWORD WINAPI
d3drm_device3_GetHeight(IDirect3DRMDevice3
*iface
)
663 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
665 TRACE("iface %p.\n", iface
);
667 return device
->height
;
670 static DWORD WINAPI
d3drm_device3_GetWidth(IDirect3DRMDevice3
*iface
)
672 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
674 TRACE("iface %p.\n", iface
);
676 return device
->width
;
679 static DWORD WINAPI
d3drm_device3_GetTrianglesDrawn(IDirect3DRMDevice3
*iface
)
681 FIXME("iface %p stub!\n", iface
);
686 static DWORD WINAPI
d3drm_device3_GetWireframeOptions(IDirect3DRMDevice3
*iface
)
688 FIXME("iface %p stub!\n", iface
);
693 static D3DRMRENDERQUALITY WINAPI
d3drm_device3_GetQuality(IDirect3DRMDevice3
*iface
)
695 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
697 TRACE("iface %p.\n", iface
);
699 return device
->quality
;
702 static D3DCOLORMODEL WINAPI
d3drm_device3_GetColorModel(IDirect3DRMDevice3
*iface
)
704 FIXME("iface %p stub!\n", iface
);
709 static D3DRMTEXTUREQUALITY WINAPI
d3drm_device3_GetTextureQuality(IDirect3DRMDevice3
*iface
)
711 FIXME("iface %p stub!\n", iface
);
716 static HRESULT WINAPI
d3drm_device3_GetDirect3DDevice(IDirect3DRMDevice3
*iface
, IDirect3DDevice
**d3d_device
)
718 FIXME("iface %p, d3d_device %p stub!\n", iface
, d3d_device
);
723 static HRESULT WINAPI
d3drm_device3_InitFromD3D2(IDirect3DRMDevice3
*iface
,
724 IDirect3D2
*d3d
, IDirect3DDevice2
*d3d_device
)
726 FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface
, d3d
, d3d_device
);
731 static HRESULT WINAPI
d3drm_device3_InitFromSurface(IDirect3DRMDevice3
*iface
,
732 GUID
*guid
, IDirectDraw
*ddraw
, IDirectDrawSurface
*backbuffer
)
734 FIXME("iface %p, guid %s, ddraw %p, backbuffer %p stub!\n",
735 iface
, debugstr_guid(guid
), ddraw
, backbuffer
);
740 static HRESULT WINAPI
d3drm_device3_SetRenderMode(IDirect3DRMDevice3
*iface
, DWORD flags
)
742 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
744 TRACE("iface %p, flags %#x.\n", iface
, flags
);
746 device
->rendermode
= flags
;
751 static DWORD WINAPI
d3drm_device3_GetRenderMode(IDirect3DRMDevice3
*iface
)
753 struct d3drm_device
*device
= impl_from_IDirect3DRMDevice3(iface
);
755 TRACE("iface %p.\n", iface
);
757 return device
->rendermode
;
760 static HRESULT WINAPI
d3drm_device3_GetDirect3DDevice2(IDirect3DRMDevice3
*iface
, IDirect3DDevice2
**d3d_device
)
762 FIXME("iface %p, d3d_device %p stub!\n", iface
, d3d_device
);
767 static HRESULT WINAPI
d3drm_device3_FindPreferredTextureFormat(IDirect3DRMDevice3
*iface
,
768 DWORD bitdepths
, DWORD flags
, DDPIXELFORMAT
*pf
)
770 FIXME("iface %p, bitdepths %u, flags %#x, pf %p stub!\n", iface
, bitdepths
, flags
, pf
);
775 static HRESULT WINAPI
d3drm_device3_RenderStateChange(IDirect3DRMDevice3
*iface
,
776 D3DRENDERSTATETYPE state
, DWORD value
, DWORD flags
)
778 FIXME("iface %p, state %#x, value %#x, flags %#x stub!\n", iface
, state
, value
, flags
);
783 static HRESULT WINAPI
d3drm_device3_LightStateChange(IDirect3DRMDevice3
*iface
,
784 D3DLIGHTSTATETYPE state
, DWORD value
, DWORD flags
)
786 FIXME("iface %p, state %#x, value %#x, flags %#x stub!\n", iface
, state
, value
, flags
);
791 static HRESULT WINAPI
d3drm_device3_GetStateChangeOptions(IDirect3DRMDevice3
*iface
,
792 DWORD state_class
, DWORD state_idx
, DWORD
*flags
)
794 FIXME("iface %p, state_class %#x, state_idx %#x, flags %p stub!\n",
795 iface
, state_class
, state_idx
, flags
);
800 static HRESULT WINAPI
d3drm_device3_SetStateChangeOptions(IDirect3DRMDevice3
*iface
,
801 DWORD state_class
, DWORD state_idx
, DWORD flags
)
803 FIXME("iface %p, state_class %#x, state_idx %#x, flags %#x stub!\n",
804 iface
, state_class
, state_idx
, flags
);
809 static const struct IDirect3DRMDevice3Vtbl d3drm_device3_vtbl
=
811 d3drm_device3_QueryInterface
,
812 d3drm_device3_AddRef
,
813 d3drm_device3_Release
,
815 d3drm_device3_AddDestroyCallback
,
816 d3drm_device3_DeleteDestroyCallback
,
817 d3drm_device3_SetAppData
,
818 d3drm_device3_GetAppData
,
819 d3drm_device3_SetName
,
820 d3drm_device3_GetName
,
821 d3drm_device3_GetClassName
,
823 d3drm_device3_InitFromD3D
,
824 d3drm_device3_InitFromClipper
,
825 d3drm_device3_Update
,
826 d3drm_device3_AddUpdateCallback
,
827 d3drm_device3_DeleteUpdateCallback
,
828 d3drm_device3_SetBufferCount
,
829 d3drm_device3_GetBufferCount
,
830 d3drm_device3_SetDither
,
831 d3drm_device3_SetShades
,
832 d3drm_device3_SetQuality
,
833 d3drm_device3_SetTextureQuality
,
834 d3drm_device3_GetViewports
,
835 d3drm_device3_GetDither
,
836 d3drm_device3_GetShades
,
837 d3drm_device3_GetHeight
,
838 d3drm_device3_GetWidth
,
839 d3drm_device3_GetTrianglesDrawn
,
840 d3drm_device3_GetWireframeOptions
,
841 d3drm_device3_GetQuality
,
842 d3drm_device3_GetColorModel
,
843 d3drm_device3_GetTextureQuality
,
844 d3drm_device3_GetDirect3DDevice
,
845 d3drm_device3_InitFromD3D2
,
846 d3drm_device3_InitFromSurface
,
847 d3drm_device3_SetRenderMode
,
848 d3drm_device3_GetRenderMode
,
849 d3drm_device3_GetDirect3DDevice2
,
850 d3drm_device3_FindPreferredTextureFormat
,
851 d3drm_device3_RenderStateChange
,
852 d3drm_device3_LightStateChange
,
853 d3drm_device3_GetStateChangeOptions
,
854 d3drm_device3_SetStateChangeOptions
,
857 static HRESULT WINAPI
d3drm_device_win_QueryInterface(IDirect3DRMWinDevice
*iface
, REFIID riid
, void **out
)
859 struct d3drm_device
*device
= impl_from_IDirect3DRMWinDevice(iface
);
861 return d3drm_device2_QueryInterface(&device
->IDirect3DRMDevice2_iface
, riid
, out
);
864 static ULONG WINAPI
d3drm_device_win_AddRef(IDirect3DRMWinDevice
*iface
)
866 struct d3drm_device
*device
= impl_from_IDirect3DRMWinDevice(iface
);
868 return d3drm_device2_AddRef(&device
->IDirect3DRMDevice2_iface
);
871 static ULONG WINAPI
d3drm_device_win_Release(IDirect3DRMWinDevice
*iface
)
873 struct d3drm_device
*device
= impl_from_IDirect3DRMWinDevice(iface
);
875 return d3drm_device2_Release(&device
->IDirect3DRMDevice2_iface
);
878 static HRESULT WINAPI
d3drm_device_win_Clone(IDirect3DRMWinDevice
*iface
,
879 IUnknown
*outer
, REFIID iid
, void **out
)
881 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
886 static HRESULT WINAPI
d3drm_device_win_AddDestroyCallback(IDirect3DRMWinDevice
*iface
,
887 D3DRMOBJECTCALLBACK cb
, void *ctx
)
889 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
894 static HRESULT WINAPI
d3drm_device_win_DeleteDestroyCallback(IDirect3DRMWinDevice
*iface
,
895 D3DRMOBJECTCALLBACK cb
, void *ctx
)
897 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
902 static HRESULT WINAPI
d3drm_device_win_SetAppData(IDirect3DRMWinDevice
*iface
, DWORD data
)
904 FIXME("iface %p, data %#x stub!\n", iface
, data
);
909 static DWORD WINAPI
d3drm_device_win_GetAppData(IDirect3DRMWinDevice
*iface
)
911 FIXME("iface %p stub!\n", iface
);
916 static HRESULT WINAPI
d3drm_device_win_SetName(IDirect3DRMWinDevice
*iface
, const char *name
)
918 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
923 static HRESULT WINAPI
d3drm_device_win_GetName(IDirect3DRMWinDevice
*iface
, DWORD
*size
, char *name
)
925 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
930 static HRESULT WINAPI
d3drm_device_win_GetClassName(IDirect3DRMWinDevice
*iface
, DWORD
*size
, char *name
)
932 struct d3drm_device
*device
= impl_from_IDirect3DRMWinDevice(iface
);
934 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
936 return IDirect3DRMDevice3_GetClassName(&device
->IDirect3DRMDevice3_iface
, size
, name
);
939 static HRESULT WINAPI
d3drm_device_win_HandlePaint(IDirect3DRMWinDevice
*iface
, HDC dc
)
941 FIXME("iface %p, dc %p stub!\n", iface
, dc
);
946 static HRESULT WINAPI
d3drm_device_win_HandleActivate(IDirect3DRMWinDevice
*iface
, WORD wparam
)
948 FIXME("iface %p, wparam %#x stub!\n", iface
, wparam
);
953 static const struct IDirect3DRMWinDeviceVtbl d3drm_device_win_vtbl
=
955 d3drm_device_win_QueryInterface
,
956 d3drm_device_win_AddRef
,
957 d3drm_device_win_Release
,
958 d3drm_device_win_Clone
,
959 d3drm_device_win_AddDestroyCallback
,
960 d3drm_device_win_DeleteDestroyCallback
,
961 d3drm_device_win_SetAppData
,
962 d3drm_device_win_GetAppData
,
963 d3drm_device_win_SetName
,
964 d3drm_device_win_GetName
,
965 d3drm_device_win_GetClassName
,
966 d3drm_device_win_HandlePaint
,
967 d3drm_device_win_HandleActivate
,
970 HRESULT
Direct3DRMDevice_create(REFIID riid
, IUnknown
**out
)
972 struct d3drm_device
*object
;
974 TRACE("riid %s, out %p.\n", debugstr_guid(riid
), out
);
976 if (!(object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
))))
977 return E_OUTOFMEMORY
;
979 object
->IDirect3DRMDevice2_iface
.lpVtbl
= &d3drm_device2_vtbl
;
980 object
->IDirect3DRMDevice3_iface
.lpVtbl
= &d3drm_device3_vtbl
;
981 object
->IDirect3DRMWinDevice_iface
.lpVtbl
= &d3drm_device_win_vtbl
;
984 if (IsEqualGUID(riid
, &IID_IDirect3DRMDevice3
))
985 *out
= (IUnknown
*)&object
->IDirect3DRMDevice3_iface
;
987 *out
= (IUnknown
*)&object
->IDirect3DRMDevice2_iface
;