2 * Implementation of IDirect3DRMDevice Interface
4 * Copyright 2011, 2012 André Hentschel
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/debug.h"
31 #include "d3drm_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(d3drm
);
38 IDirect3DRMDevice2 IDirect3DRMDevice2_iface
;
39 IDirect3DRMDevice3 IDirect3DRMDevice3_iface
;
40 IDirect3DRMWinDevice IDirect3DRMWinDevice_iface
;
43 D3DRMRENDERQUALITY quality
;
47 } IDirect3DRMDeviceImpl
;
49 static inline IDirect3DRMDeviceImpl
*impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2
*iface
)
51 return CONTAINING_RECORD(iface
, IDirect3DRMDeviceImpl
, IDirect3DRMDevice2_iface
);
54 static inline IDirect3DRMDeviceImpl
*impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3
*iface
)
56 return CONTAINING_RECORD(iface
, IDirect3DRMDeviceImpl
, IDirect3DRMDevice3_iface
);
59 static inline IDirect3DRMDeviceImpl
*impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice
*iface
)
61 return CONTAINING_RECORD(iface
, IDirect3DRMDeviceImpl
, IDirect3DRMWinDevice_iface
);
64 /*** IUnknown methods ***/
65 static HRESULT WINAPI
IDirect3DRMDevice2Impl_QueryInterface(IDirect3DRMDevice2
* iface
,
66 REFIID riid
, void** object
)
68 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
70 TRACE("(%p/%p)->(%s, %p)\n", iface
, This
, debugstr_guid(riid
), object
);
74 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
75 IsEqualGUID(riid
, &IID_IDirect3DRMDevice
) ||
76 IsEqualGUID(riid
, &IID_IDirect3DRMDevice2
))
78 *object
= &This
->IDirect3DRMDevice2_iface
;
80 else if(IsEqualGUID(riid
, &IID_IDirect3DRMDevice3
))
82 *object
= &This
->IDirect3DRMDevice3_iface
;
84 else if(IsEqualGUID(riid
, &IID_IDirect3DRMWinDevice
))
86 *object
= &This
->IDirect3DRMWinDevice_iface
;
90 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
94 IDirect3DRMDevice2_AddRef(iface
);
98 static ULONG WINAPI
IDirect3DRMDevice2Impl_AddRef(IDirect3DRMDevice2
* iface
)
100 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
101 ULONG ref
= InterlockedIncrement(&This
->ref
);
103 TRACE("(%p)->(): new ref = %d\n", iface
, ref
);
108 static ULONG WINAPI
IDirect3DRMDevice2Impl_Release(IDirect3DRMDevice2
* iface
)
110 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
111 ULONG ref
= InterlockedDecrement(&This
->ref
);
113 TRACE("(%p)->(): new ref = %d\n", iface
, ref
);
116 HeapFree(GetProcessHeap(), 0, This
);
121 /*** IDirect3DRMObject methods ***/
122 static HRESULT WINAPI
IDirect3DRMDevice2Impl_Clone(IDirect3DRMDevice2
*iface
,
123 IUnknown
*outer
, REFIID iid
, void **out
)
125 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
130 static HRESULT WINAPI
IDirect3DRMDevice2Impl_AddDestroyCallback(IDirect3DRMDevice2
*iface
,
131 D3DRMOBJECTCALLBACK cb
, void *ctx
)
133 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
138 static HRESULT WINAPI
IDirect3DRMDevice2Impl_DeleteDestroyCallback(IDirect3DRMDevice2
*iface
,
139 D3DRMOBJECTCALLBACK cb
, void *ctx
)
141 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
146 static HRESULT WINAPI
IDirect3DRMDevice2Impl_SetAppData(IDirect3DRMDevice2
* iface
,
149 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
151 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, data
);
156 static DWORD WINAPI
IDirect3DRMDevice2Impl_GetAppData(IDirect3DRMDevice2
* iface
)
158 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
160 FIXME("(%p/%p)->(): stub\n", iface
, This
);
165 static HRESULT WINAPI
IDirect3DRMDevice2Impl_SetName(IDirect3DRMDevice2
*iface
, const char *name
)
167 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
172 static HRESULT WINAPI
IDirect3DRMDevice2Impl_GetName(IDirect3DRMDevice2
*iface
, DWORD
*size
, char *name
)
174 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
179 static HRESULT WINAPI
IDirect3DRMDevice2Impl_GetClassName(IDirect3DRMDevice2
*iface
, DWORD
*size
, char *name
)
181 IDirect3DRMDeviceImpl
*device
= impl_from_IDirect3DRMDevice2(iface
);
183 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
185 return IDirect3DRMDevice3_GetClassName(&device
->IDirect3DRMDevice3_iface
, size
, name
);
188 /*** IDirect3DRMDevice methods ***/
189 static HRESULT WINAPI
IDirect3DRMDevice2Impl_Init(IDirect3DRMDevice2
* iface
, ULONG width
,
192 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
194 TRACE("(%p/%p)->(%u, %u)\n", iface
, This
, width
, height
);
196 return IDirect3DRMDevice3_Init(&This
->IDirect3DRMDevice3_iface
, width
, height
);
199 /*** IDirect3DRMDevice2 methods ***/
200 static HRESULT WINAPI
IDirect3DRMDevice2Impl_InitFromD3D(IDirect3DRMDevice2
*iface
,
201 IDirect3D
*lpD3D
, IDirect3DDevice
*lpD3DDev
)
203 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
205 FIXME("(%p/%p)->(%p, %p): stub\n", iface
, This
, lpD3D
, lpD3DDev
);
210 static HRESULT WINAPI
IDirect3DRMDevice2Impl_InitFromClipper(IDirect3DRMDevice2
*iface
,
211 IDirectDrawClipper
*lpDDClipper
, GUID
*lpGUID
, int width
, int height
)
213 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
215 TRACE("(%p/%p)->(%p, %p, %u, %u)\n", iface
, This
, lpDDClipper
, lpGUID
, width
, height
);
217 return IDirect3DRMDevice3_InitFromClipper(&This
->IDirect3DRMDevice3_iface
, lpDDClipper
, lpGUID
,
221 static HRESULT WINAPI
IDirect3DRMDevice2Impl_Update(IDirect3DRMDevice2
* iface
)
223 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
225 FIXME("(%p/%p)->(): stub\n", iface
, This
);
230 static HRESULT WINAPI
IDirect3DRMDevice2Impl_AddUpdateCallback(IDirect3DRMDevice2
*iface
,
231 D3DRMUPDATECALLBACK cb
, void *ctx
)
233 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
238 static HRESULT WINAPI
IDirect3DRMDevice2Impl_DeleteUpdateCallback(IDirect3DRMDevice2
*iface
,
239 D3DRMUPDATECALLBACK cb
, void *ctx
)
241 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
246 static HRESULT WINAPI
IDirect3DRMDevice2Impl_SetBufferCount(IDirect3DRMDevice2
* iface
, DWORD count
)
248 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
250 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, count
);
255 static DWORD WINAPI
IDirect3DRMDevice2Impl_GetBufferCount(IDirect3DRMDevice2
* iface
)
257 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
259 FIXME("(%p/%p)->(): stub\n", iface
, This
);
264 static HRESULT WINAPI
IDirect3DRMDevice2Impl_SetDither(IDirect3DRMDevice2
* iface
, BOOL enable
)
266 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
268 TRACE("(%p/%p)->(%d)\n", iface
, This
, enable
);
270 return IDirect3DRMDevice3_SetDither(&This
->IDirect3DRMDevice3_iface
, enable
);
273 static HRESULT WINAPI
IDirect3DRMDevice2Impl_SetShades(IDirect3DRMDevice2
* iface
, DWORD count
)
275 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
277 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, count
);
282 static HRESULT WINAPI
IDirect3DRMDevice2Impl_SetQuality(IDirect3DRMDevice2
* iface
,
283 D3DRMRENDERQUALITY quality
)
285 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
287 TRACE("(%p/%p)->(%u)\n", iface
, This
, quality
);
289 return IDirect3DRMDevice3_SetQuality(&This
->IDirect3DRMDevice3_iface
, quality
);
292 static HRESULT WINAPI
IDirect3DRMDevice2Impl_SetTextureQuality(IDirect3DRMDevice2
* iface
,
293 D3DRMTEXTUREQUALITY quality
)
295 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
297 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, quality
);
302 static HRESULT WINAPI
IDirect3DRMDevice2Impl_GetViewports(IDirect3DRMDevice2
*iface
, IDirect3DRMViewportArray
**array
)
304 FIXME("iface %p, array %p stub!\n", iface
, array
);
309 static BOOL WINAPI
IDirect3DRMDevice2Impl_GetDither(IDirect3DRMDevice2
* iface
)
311 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
313 TRACE("(%p/%p)->()\n", iface
, This
);
315 return IDirect3DRMDevice3_GetDither(&This
->IDirect3DRMDevice3_iface
);
318 static DWORD WINAPI
IDirect3DRMDevice2Impl_GetShades(IDirect3DRMDevice2
* iface
)
320 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
322 FIXME("(%p/%p)->(): stub\n", iface
, This
);
327 static DWORD WINAPI
IDirect3DRMDevice2Impl_GetHeight(IDirect3DRMDevice2
* iface
)
329 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
331 TRACE("(%p/%p)->()\n", iface
, This
);
333 return IDirect3DRMDevice3_GetHeight(&This
->IDirect3DRMDevice3_iface
);
336 static DWORD WINAPI
IDirect3DRMDevice2Impl_GetWidth(IDirect3DRMDevice2
* iface
)
338 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
340 TRACE("(%p/%p)->()\n", iface
, This
);
342 return IDirect3DRMDevice3_GetWidth(&This
->IDirect3DRMDevice3_iface
);
345 static DWORD WINAPI
IDirect3DRMDevice2Impl_GetTrianglesDrawn(IDirect3DRMDevice2
* iface
)
347 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
349 FIXME("(%p/%p)->(): stub\n", iface
, This
);
354 static DWORD WINAPI
IDirect3DRMDevice2Impl_GetWireframeOptions(IDirect3DRMDevice2
* iface
)
356 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
358 FIXME("(%p/%p)->(): stub\n", iface
, This
);
363 static D3DRMRENDERQUALITY WINAPI
IDirect3DRMDevice2Impl_GetQuality(IDirect3DRMDevice2
* iface
)
365 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
367 TRACE("(%p/%p)->()\n", iface
, This
);
369 return IDirect3DRMDevice3_GetQuality(&This
->IDirect3DRMDevice3_iface
);
372 static D3DCOLORMODEL WINAPI
IDirect3DRMDevice2Impl_GetColorModel(IDirect3DRMDevice2
* iface
)
374 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
376 FIXME("(%p/%p)->(): stub\n", iface
, This
);
381 static D3DRMTEXTUREQUALITY WINAPI
IDirect3DRMDevice2Impl_GetTextureQuality(IDirect3DRMDevice2
* iface
)
383 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
385 FIXME("(%p/%p)->(): stub\n", iface
, This
);
390 static HRESULT WINAPI
IDirect3DRMDevice2Impl_GetDirect3DDevice(IDirect3DRMDevice2
*iface
,
391 IDirect3DDevice
**dev
)
393 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
395 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, dev
);
400 static HRESULT WINAPI
IDirect3DRMDevice2Impl_InitFromD3D2(IDirect3DRMDevice2
*iface
,
401 IDirect3D2
*lpD3D
, IDirect3DDevice2
*lpD3DDev
)
403 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
405 FIXME("(%p/%p)->(%p, %p): stub\n", iface
, This
, lpD3D
, lpD3DDev
);
410 static HRESULT WINAPI
IDirect3DRMDevice2Impl_InitFromSurface(IDirect3DRMDevice2
*iface
, GUID
*lpGUID
,
411 IDirectDraw
*lpDD
, IDirectDrawSurface
*lpDDSBack
)
413 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
415 FIXME("(%p/%p)->(%p, %p, %p): stub\n", iface
, This
, lpGUID
, lpDD
, lpDDSBack
);
420 static HRESULT WINAPI
IDirect3DRMDevice2Impl_SetRenderMode(IDirect3DRMDevice2
* iface
, DWORD dwFlags
)
422 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
424 TRACE("(%p/%p)->(%u)\n", iface
, This
, dwFlags
);
426 return IDirect3DRMDevice3_SetRenderMode(&This
->IDirect3DRMDevice3_iface
, dwFlags
);
429 static DWORD WINAPI
IDirect3DRMDevice2Impl_GetRenderMode(IDirect3DRMDevice2
* iface
)
431 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
433 TRACE("(%p/%p)->()\n", iface
, This
);
435 return IDirect3DRMDevice3_GetRenderMode(&This
->IDirect3DRMDevice3_iface
);
438 static HRESULT WINAPI
IDirect3DRMDevice2Impl_GetDirect3DDevice2(IDirect3DRMDevice2
*iface
,
439 IDirect3DDevice2
**dev
)
441 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice2(iface
);
443 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, dev
);
448 static const struct IDirect3DRMDevice2Vtbl Direct3DRMDevice2_Vtbl
=
450 /*** IUnknown methods ***/
451 IDirect3DRMDevice2Impl_QueryInterface
,
452 IDirect3DRMDevice2Impl_AddRef
,
453 IDirect3DRMDevice2Impl_Release
,
454 /*** IDirect3DRMObject methods ***/
455 IDirect3DRMDevice2Impl_Clone
,
456 IDirect3DRMDevice2Impl_AddDestroyCallback
,
457 IDirect3DRMDevice2Impl_DeleteDestroyCallback
,
458 IDirect3DRMDevice2Impl_SetAppData
,
459 IDirect3DRMDevice2Impl_GetAppData
,
460 IDirect3DRMDevice2Impl_SetName
,
461 IDirect3DRMDevice2Impl_GetName
,
462 IDirect3DRMDevice2Impl_GetClassName
,
463 /*** IDirect3DRMDevice methods ***/
464 IDirect3DRMDevice2Impl_Init
,
465 IDirect3DRMDevice2Impl_InitFromD3D
,
466 IDirect3DRMDevice2Impl_InitFromClipper
,
467 IDirect3DRMDevice2Impl_Update
,
468 IDirect3DRMDevice2Impl_AddUpdateCallback
,
469 IDirect3DRMDevice2Impl_DeleteUpdateCallback
,
470 IDirect3DRMDevice2Impl_SetBufferCount
,
471 IDirect3DRMDevice2Impl_GetBufferCount
,
472 IDirect3DRMDevice2Impl_SetDither
,
473 IDirect3DRMDevice2Impl_SetShades
,
474 IDirect3DRMDevice2Impl_SetQuality
,
475 IDirect3DRMDevice2Impl_SetTextureQuality
,
476 IDirect3DRMDevice2Impl_GetViewports
,
477 IDirect3DRMDevice2Impl_GetDither
,
478 IDirect3DRMDevice2Impl_GetShades
,
479 IDirect3DRMDevice2Impl_GetHeight
,
480 IDirect3DRMDevice2Impl_GetWidth
,
481 IDirect3DRMDevice2Impl_GetTrianglesDrawn
,
482 IDirect3DRMDevice2Impl_GetWireframeOptions
,
483 IDirect3DRMDevice2Impl_GetQuality
,
484 IDirect3DRMDevice2Impl_GetColorModel
,
485 IDirect3DRMDevice2Impl_GetTextureQuality
,
486 IDirect3DRMDevice2Impl_GetDirect3DDevice
,
487 /*** IDirect3DRMDevice2 methods ***/
488 IDirect3DRMDevice2Impl_InitFromD3D2
,
489 IDirect3DRMDevice2Impl_InitFromSurface
,
490 IDirect3DRMDevice2Impl_SetRenderMode
,
491 IDirect3DRMDevice2Impl_GetRenderMode
,
492 IDirect3DRMDevice2Impl_GetDirect3DDevice2
496 /*** IUnknown methods ***/
497 static HRESULT WINAPI
IDirect3DRMDevice3Impl_QueryInterface(IDirect3DRMDevice3
* iface
,
498 REFIID riid
, void** object
)
500 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
501 return IDirect3DRMDevice2_QueryInterface(&This
->IDirect3DRMDevice2_iface
, riid
, object
);
504 static ULONG WINAPI
IDirect3DRMDevice3Impl_AddRef(IDirect3DRMDevice3
* iface
)
506 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
507 return IDirect3DRMDevice2_AddRef(&This
->IDirect3DRMDevice2_iface
);
510 static ULONG WINAPI
IDirect3DRMDevice3Impl_Release(IDirect3DRMDevice3
* iface
)
512 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
513 return IDirect3DRMDevice2_Release(&This
->IDirect3DRMDevice2_iface
);
516 /*** IDirect3DRMObject methods ***/
517 static HRESULT WINAPI
IDirect3DRMDevice3Impl_Clone(IDirect3DRMDevice3
*iface
,
518 IUnknown
*outer
, REFIID iid
, void **out
)
520 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
525 static HRESULT WINAPI
IDirect3DRMDevice3Impl_AddDestroyCallback(IDirect3DRMDevice3
*iface
,
526 D3DRMOBJECTCALLBACK cb
, void *ctx
)
528 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
533 static HRESULT WINAPI
IDirect3DRMDevice3Impl_DeleteDestroyCallback(IDirect3DRMDevice3
*iface
,
534 D3DRMOBJECTCALLBACK cb
, void *ctx
)
536 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
541 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetAppData(IDirect3DRMDevice3
* iface
,
544 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
546 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, data
);
551 static DWORD WINAPI
IDirect3DRMDevice3Impl_GetAppData(IDirect3DRMDevice3
* iface
)
553 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
555 FIXME("(%p/%p)->(): stub\n", iface
, This
);
560 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetName(IDirect3DRMDevice3
*iface
, const char *name
)
562 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
567 static HRESULT WINAPI
IDirect3DRMDevice3Impl_GetName(IDirect3DRMDevice3
*iface
, DWORD
*size
, char *name
)
569 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
574 static HRESULT WINAPI
IDirect3DRMDevice3Impl_GetClassName(IDirect3DRMDevice3
*iface
, DWORD
*size
, char *name
)
576 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
578 if (!size
|| *size
< strlen("Device") || !name
)
581 strcpy(name
, "Device");
582 *size
= sizeof("Device");
587 /*** IDirect3DRMDevice methods ***/
588 static HRESULT WINAPI
IDirect3DRMDevice3Impl_Init(IDirect3DRMDevice3
* iface
, ULONG width
,
591 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
593 FIXME("(%p/%p)->(%u, %u): stub\n", iface
, This
, width
, height
);
595 This
->height
= height
;
601 static HRESULT WINAPI
IDirect3DRMDevice3Impl_InitFromD3D(IDirect3DRMDevice3
*iface
,
602 IDirect3D
*lpD3D
, IDirect3DDevice
*lpD3DDev
)
604 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
606 FIXME("(%p/%p)->(%p, %p): stub\n", iface
, This
, lpD3D
, lpD3DDev
);
611 static HRESULT WINAPI
IDirect3DRMDevice3Impl_InitFromClipper(IDirect3DRMDevice3
*iface
,
612 IDirectDrawClipper
*lpDDClipper
, GUID
*lpGUID
, int width
, int height
)
614 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
616 FIXME("(%p/%p)->(%p, %p, %u, %u): stub\n", iface
, This
, lpDDClipper
, lpGUID
, width
, height
);
618 This
->height
= height
;
624 static HRESULT WINAPI
IDirect3DRMDevice3Impl_Update(IDirect3DRMDevice3
* iface
)
626 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
628 FIXME("(%p/%p)->(): stub\n", iface
, This
);
633 static HRESULT WINAPI
IDirect3DRMDevice3Impl_AddUpdateCallback(IDirect3DRMDevice3
*iface
,
634 D3DRMUPDATECALLBACK cb
, void *ctx
)
636 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
641 static HRESULT WINAPI
IDirect3DRMDevice3Impl_DeleteUpdateCallback(IDirect3DRMDevice3
*iface
,
642 D3DRMUPDATECALLBACK cb
, void *ctx
)
644 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
649 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetBufferCount(IDirect3DRMDevice3
* iface
, DWORD count
)
651 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
653 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, count
);
658 static DWORD WINAPI
IDirect3DRMDevice3Impl_GetBufferCount(IDirect3DRMDevice3
* iface
)
660 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
662 FIXME("(%p/%p)->(): stub\n", iface
, This
);
667 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetDither(IDirect3DRMDevice3
* iface
, BOOL enable
)
669 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
671 TRACE("(%p/%p)->(%d)\n", iface
, This
, enable
);
673 This
->dither
= enable
;
678 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetShades(IDirect3DRMDevice3
* iface
, DWORD count
)
680 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
682 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, count
);
687 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetQuality(IDirect3DRMDevice3
* iface
,
688 D3DRMRENDERQUALITY quality
)
690 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
692 TRACE("(%p/%p)->(%u)\n", iface
, This
, quality
);
694 This
->quality
= quality
;
699 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetTextureQuality(IDirect3DRMDevice3
* iface
,
700 D3DRMTEXTUREQUALITY quality
)
702 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
704 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, quality
);
709 static HRESULT WINAPI
IDirect3DRMDevice3Impl_GetViewports(IDirect3DRMDevice3
*iface
, IDirect3DRMViewportArray
**array
)
711 FIXME("iface %p, array %p stub!\n", iface
, array
);
716 static BOOL WINAPI
IDirect3DRMDevice3Impl_GetDither(IDirect3DRMDevice3
* iface
)
718 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
720 TRACE("(%p/%p)->()\n", iface
, This
);
725 static DWORD WINAPI
IDirect3DRMDevice3Impl_GetShades(IDirect3DRMDevice3
* iface
)
727 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
729 FIXME("(%p/%p)->(): stub\n", iface
, This
);
734 static DWORD WINAPI
IDirect3DRMDevice3Impl_GetHeight(IDirect3DRMDevice3
* iface
)
736 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
738 TRACE("(%p/%p)->()\n", iface
, This
);
743 static DWORD WINAPI
IDirect3DRMDevice3Impl_GetWidth(IDirect3DRMDevice3
* iface
)
745 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
747 TRACE("(%p/%p)->()\n", iface
, This
);
752 static DWORD WINAPI
IDirect3DRMDevice3Impl_GetTrianglesDrawn(IDirect3DRMDevice3
* iface
)
754 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
756 FIXME("(%p/%p)->(): stub\n", iface
, This
);
761 static DWORD WINAPI
IDirect3DRMDevice3Impl_GetWireframeOptions(IDirect3DRMDevice3
* iface
)
763 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
765 FIXME("(%p/%p)->(): stub\n", iface
, This
);
770 static D3DRMRENDERQUALITY WINAPI
IDirect3DRMDevice3Impl_GetQuality(IDirect3DRMDevice3
* iface
)
772 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
774 TRACE("(%p/%p)->()\n", iface
, This
);
776 return This
->quality
;
779 static D3DCOLORMODEL WINAPI
IDirect3DRMDevice3Impl_GetColorModel(IDirect3DRMDevice3
* iface
)
781 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
783 FIXME("(%p/%p)->(): stub\n", iface
, This
);
788 static D3DRMTEXTUREQUALITY WINAPI
IDirect3DRMDevice3Impl_GetTextureQuality(IDirect3DRMDevice3
* iface
)
790 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
792 FIXME("(%p/%p)->(): stub\n", iface
, This
);
797 static HRESULT WINAPI
IDirect3DRMDevice3Impl_GetDirect3DDevice(IDirect3DRMDevice3
*iface
,
798 IDirect3DDevice
**dev
)
800 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
802 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, dev
);
807 /*** IDirect3DRMDevice2 methods ***/
808 static HRESULT WINAPI
IDirect3DRMDevice3Impl_InitFromD3D2(IDirect3DRMDevice3
*iface
,
809 IDirect3D2
*lpD3D
, IDirect3DDevice2
*lpD3DDev
)
811 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
813 FIXME("(%p/%p)->(%p, %p): stub\n", iface
, This
, lpD3D
, lpD3DDev
);
818 static HRESULT WINAPI
IDirect3DRMDevice3Impl_InitFromSurface(IDirect3DRMDevice3
*iface
, GUID
*lpGUID
,
819 IDirectDraw
*lpDD
, IDirectDrawSurface
*lpDDSBack
)
821 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
823 FIXME("(%p/%p)->(%p, %p, %p): stub\n", iface
, This
, lpGUID
, lpDD
, lpDDSBack
);
828 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetRenderMode(IDirect3DRMDevice3
* iface
, DWORD dwFlags
)
830 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
832 TRACE("(%p/%p)->(%u)\n", iface
, This
, dwFlags
);
834 This
->rendermode
= dwFlags
;
839 static DWORD WINAPI
IDirect3DRMDevice3Impl_GetRenderMode(IDirect3DRMDevice3
* iface
)
841 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
843 TRACE("(%p/%p)->()\n", iface
, This
);
845 return This
->rendermode
;
848 static HRESULT WINAPI
IDirect3DRMDevice3Impl_GetDirect3DDevice2(IDirect3DRMDevice3
*iface
,
849 IDirect3DDevice2
**dev
)
851 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
853 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, dev
);
858 /*** IDirect3DRMDevice3 methods ***/
859 static HRESULT WINAPI
IDirect3DRMDevice3Impl_FindPreferredTextureFormat(IDirect3DRMDevice3
*iface
,
860 DWORD bitdepths
, DWORD flags
, DDPIXELFORMAT
*lpDDPF
)
862 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
864 FIXME("(%p/%p)->(%u, %u, %p): stub\n", iface
, This
, bitdepths
, flags
, lpDDPF
);
869 static HRESULT WINAPI
IDirect3DRMDevice3Impl_RenderStateChange(IDirect3DRMDevice3
* iface
,
870 D3DRENDERSTATETYPE type
, DWORD val
,
873 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
875 FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface
, This
, type
, val
, flags
);
880 static HRESULT WINAPI
IDirect3DRMDevice3Impl_LightStateChange(IDirect3DRMDevice3
* iface
,
881 D3DLIGHTSTATETYPE type
, DWORD val
,
884 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
886 FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface
, This
, type
, val
, flags
);
891 static HRESULT WINAPI
IDirect3DRMDevice3Impl_GetStateChangeOptions(IDirect3DRMDevice3
*iface
,
892 DWORD state_class
, DWORD state_idx
, DWORD
*flags
)
894 FIXME("iface %p, state_class %#x, state_idx %#x, flags %p stub!\n",
895 iface
, state_class
, state_idx
, flags
);
900 static HRESULT WINAPI
IDirect3DRMDevice3Impl_SetStateChangeOptions(IDirect3DRMDevice3
* iface
,
901 DWORD stateclass
, DWORD statenum
,
904 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMDevice3(iface
);
906 FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface
, This
, stateclass
, statenum
, flags
);
911 static const struct IDirect3DRMDevice3Vtbl Direct3DRMDevice3_Vtbl
=
913 /*** IUnknown methods ***/
914 IDirect3DRMDevice3Impl_QueryInterface
,
915 IDirect3DRMDevice3Impl_AddRef
,
916 IDirect3DRMDevice3Impl_Release
,
917 /*** IDirect3DRMObject methods ***/
918 IDirect3DRMDevice3Impl_Clone
,
919 IDirect3DRMDevice3Impl_AddDestroyCallback
,
920 IDirect3DRMDevice3Impl_DeleteDestroyCallback
,
921 IDirect3DRMDevice3Impl_SetAppData
,
922 IDirect3DRMDevice3Impl_GetAppData
,
923 IDirect3DRMDevice3Impl_SetName
,
924 IDirect3DRMDevice3Impl_GetName
,
925 IDirect3DRMDevice3Impl_GetClassName
,
926 /*** IDirect3DRMDevice methods ***/
927 IDirect3DRMDevice3Impl_Init
,
928 IDirect3DRMDevice3Impl_InitFromD3D
,
929 IDirect3DRMDevice3Impl_InitFromClipper
,
930 IDirect3DRMDevice3Impl_Update
,
931 IDirect3DRMDevice3Impl_AddUpdateCallback
,
932 IDirect3DRMDevice3Impl_DeleteUpdateCallback
,
933 IDirect3DRMDevice3Impl_SetBufferCount
,
934 IDirect3DRMDevice3Impl_GetBufferCount
,
935 IDirect3DRMDevice3Impl_SetDither
,
936 IDirect3DRMDevice3Impl_SetShades
,
937 IDirect3DRMDevice3Impl_SetQuality
,
938 IDirect3DRMDevice3Impl_SetTextureQuality
,
939 IDirect3DRMDevice3Impl_GetViewports
,
940 IDirect3DRMDevice3Impl_GetDither
,
941 IDirect3DRMDevice3Impl_GetShades
,
942 IDirect3DRMDevice3Impl_GetHeight
,
943 IDirect3DRMDevice3Impl_GetWidth
,
944 IDirect3DRMDevice3Impl_GetTrianglesDrawn
,
945 IDirect3DRMDevice3Impl_GetWireframeOptions
,
946 IDirect3DRMDevice3Impl_GetQuality
,
947 IDirect3DRMDevice3Impl_GetColorModel
,
948 IDirect3DRMDevice3Impl_GetTextureQuality
,
949 IDirect3DRMDevice3Impl_GetDirect3DDevice
,
950 /*** IDirect3DRMDevice2 methods ***/
951 IDirect3DRMDevice3Impl_InitFromD3D2
,
952 IDirect3DRMDevice3Impl_InitFromSurface
,
953 IDirect3DRMDevice3Impl_SetRenderMode
,
954 IDirect3DRMDevice3Impl_GetRenderMode
,
955 IDirect3DRMDevice3Impl_GetDirect3DDevice2
,
956 /*** IDirect3DRMDevice3 methods ***/
957 IDirect3DRMDevice3Impl_FindPreferredTextureFormat
,
958 IDirect3DRMDevice3Impl_RenderStateChange
,
959 IDirect3DRMDevice3Impl_LightStateChange
,
960 IDirect3DRMDevice3Impl_GetStateChangeOptions
,
961 IDirect3DRMDevice3Impl_SetStateChangeOptions
965 /*** IUnknown methods ***/
966 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_QueryInterface(IDirect3DRMWinDevice
* iface
,
967 REFIID riid
, void** object
)
969 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMWinDevice(iface
);
970 return IDirect3DRMDevice2_QueryInterface(&This
->IDirect3DRMDevice2_iface
, riid
, object
);
973 static ULONG WINAPI
IDirect3DRMWinDeviceImpl_AddRef(IDirect3DRMWinDevice
* iface
)
975 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMWinDevice(iface
);
976 return IDirect3DRMDevice2_AddRef(&This
->IDirect3DRMDevice2_iface
);
979 static ULONG WINAPI
IDirect3DRMWinDeviceImpl_Release(IDirect3DRMWinDevice
* iface
)
981 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMWinDevice(iface
);
982 return IDirect3DRMDevice2_Release(&This
->IDirect3DRMDevice2_iface
);
985 /*** IDirect3DRMObject methods ***/
986 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_Clone(IDirect3DRMWinDevice
*iface
,
987 IUnknown
*outer
, REFIID iid
, void **out
)
989 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
994 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_AddDestroyCallback(IDirect3DRMWinDevice
*iface
,
995 D3DRMOBJECTCALLBACK cb
, void *ctx
)
997 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1002 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_DeleteDestroyCallback(IDirect3DRMWinDevice
*iface
,
1003 D3DRMOBJECTCALLBACK cb
, void *ctx
)
1005 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1010 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_SetAppData(IDirect3DRMWinDevice
* iface
,
1013 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMWinDevice(iface
);
1015 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, data
);
1020 static DWORD WINAPI
IDirect3DRMWinDeviceImpl_GetAppData(IDirect3DRMWinDevice
* iface
)
1022 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMWinDevice(iface
);
1024 FIXME("(%p/%p)->(): stub\n", iface
, This
);
1029 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_SetName(IDirect3DRMWinDevice
*iface
, const char *name
)
1031 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
1036 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_GetName(IDirect3DRMWinDevice
*iface
, DWORD
*size
, char *name
)
1038 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
1043 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_GetClassName(IDirect3DRMWinDevice
*iface
, DWORD
*size
, char *name
)
1045 IDirect3DRMDeviceImpl
*device
= impl_from_IDirect3DRMWinDevice(iface
);
1047 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
1049 return IDirect3DRMDevice3_GetClassName(&device
->IDirect3DRMDevice3_iface
, size
, name
);
1052 /*** IDirect3DRMWinDevice methods ***/
1053 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_HandlePaint(IDirect3DRMWinDevice
* iface
, HDC hdc
)
1055 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMWinDevice(iface
);
1057 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, hdc
);
1062 static HRESULT WINAPI
IDirect3DRMWinDeviceImpl_HandleActivate(IDirect3DRMWinDevice
* iface
, WORD wparam
)
1064 IDirect3DRMDeviceImpl
*This
= impl_from_IDirect3DRMWinDevice(iface
);
1066 FIXME("(%p/%p)->(%u): stub\n", iface
, This
, wparam
);
1071 static const struct IDirect3DRMWinDeviceVtbl Direct3DRMWinDevice_Vtbl
=
1073 /*** IUnknown methods ***/
1074 IDirect3DRMWinDeviceImpl_QueryInterface
,
1075 IDirect3DRMWinDeviceImpl_AddRef
,
1076 IDirect3DRMWinDeviceImpl_Release
,
1077 /*** IDirect3DRMObject methods ***/
1078 IDirect3DRMWinDeviceImpl_Clone
,
1079 IDirect3DRMWinDeviceImpl_AddDestroyCallback
,
1080 IDirect3DRMWinDeviceImpl_DeleteDestroyCallback
,
1081 IDirect3DRMWinDeviceImpl_SetAppData
,
1082 IDirect3DRMWinDeviceImpl_GetAppData
,
1083 IDirect3DRMWinDeviceImpl_SetName
,
1084 IDirect3DRMWinDeviceImpl_GetName
,
1085 IDirect3DRMWinDeviceImpl_GetClassName
,
1086 /*** IDirect3DRMWinDevice methods ***/
1087 IDirect3DRMWinDeviceImpl_HandlePaint
,
1088 IDirect3DRMWinDeviceImpl_HandleActivate
1091 HRESULT
Direct3DRMDevice_create(REFIID riid
, IUnknown
** ppObj
)
1093 IDirect3DRMDeviceImpl
* object
;
1095 TRACE("(%p)\n", ppObj
);
1097 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirect3DRMDeviceImpl
));
1099 return E_OUTOFMEMORY
;
1101 object
->IDirect3DRMDevice2_iface
.lpVtbl
= &Direct3DRMDevice2_Vtbl
;
1102 object
->IDirect3DRMDevice3_iface
.lpVtbl
= &Direct3DRMDevice3_Vtbl
;
1103 object
->IDirect3DRMWinDevice_iface
.lpVtbl
= &Direct3DRMWinDevice_Vtbl
;
1106 if (IsEqualGUID(riid
, &IID_IDirect3DRMFrame3
))
1107 *ppObj
= (IUnknown
*)&object
->IDirect3DRMDevice3_iface
;
1109 *ppObj
= (IUnknown
*)&object
->IDirect3DRMDevice2_iface
;