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 LPUNKNOWN unkwn, REFIID riid,
126 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
128 FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
133 static HRESULT WINAPI IDirect3DRMDevice2Impl_AddDestroyCallback(IDirect3DRMDevice2* iface,
134 D3DRMOBJECTCALLBACK cb,
137 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
139 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
144 static HRESULT WINAPI IDirect3DRMDevice2Impl_DeleteDestroyCallback(IDirect3DRMDevice2* iface,
145 D3DRMOBJECTCALLBACK cb,
148 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
150 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
155 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetAppData(IDirect3DRMDevice2* iface,
158 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
160 FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
165 static DWORD WINAPI IDirect3DRMDevice2Impl_GetAppData(IDirect3DRMDevice2* iface)
167 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
169 FIXME("(%p/%p)->(): stub\n", iface, This);
174 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetName(IDirect3DRMDevice2* iface, LPCSTR name)
176 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
178 FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
183 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetName(IDirect3DRMDevice2* iface,
184 LPDWORD size, LPSTR name)
186 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
188 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
193 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetClassName(IDirect3DRMDevice2* iface,
194 LPDWORD size, LPSTR name)
196 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
198 TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
200 return IDirect3DRMDevice3_GetClassName(&This->IDirect3DRMDevice3_iface, size, name);
203 /*** IDirect3DRMDevice methods ***/
204 static HRESULT WINAPI IDirect3DRMDevice2Impl_Init(IDirect3DRMDevice2* iface, ULONG width,
207 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
209 TRACE("(%p/%p)->(%u, %u)\n", iface, This, width, height);
211 return IDirect3DRMDevice3_Init(&This->IDirect3DRMDevice3_iface, width, height);
214 /*** IDirect3DRMDevice2 methods ***/
215 static HRESULT WINAPI IDirect3DRMDevice2Impl_InitFromD3D(IDirect3DRMDevice2 *iface,
216 IDirect3D *lpD3D, IDirect3DDevice *lpD3DDev)
218 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
220 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, lpD3D, lpD3DDev);
225 static HRESULT WINAPI IDirect3DRMDevice2Impl_InitFromClipper(IDirect3DRMDevice2 *iface,
226 IDirectDrawClipper *lpDDClipper, GUID *lpGUID, int width, int height)
228 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
230 TRACE("(%p/%p)->(%p, %p, %u, %u)\n", iface, This, lpDDClipper, lpGUID, width, height);
232 return IDirect3DRMDevice3_InitFromClipper(&This->IDirect3DRMDevice3_iface, lpDDClipper, lpGUID,
236 static HRESULT WINAPI IDirect3DRMDevice2Impl_Update(IDirect3DRMDevice2* iface)
238 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
240 FIXME("(%p/%p)->(): stub\n", iface, This);
245 static HRESULT WINAPI IDirect3DRMDevice2Impl_AddUpdateCallback(IDirect3DRMDevice2* iface,
246 D3DRMUPDATECALLBACK cb, LPVOID arg)
248 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
250 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, arg);
255 static HRESULT WINAPI IDirect3DRMDevice2Impl_DeleteUpdateCallback(IDirect3DRMDevice2* iface,
256 D3DRMUPDATECALLBACK cb,
259 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
261 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, arg);
266 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetBufferCount(IDirect3DRMDevice2* iface, DWORD count)
268 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
270 FIXME("(%p/%p)->(%u): stub\n", iface, This, count);
275 static DWORD WINAPI IDirect3DRMDevice2Impl_GetBufferCount(IDirect3DRMDevice2* iface)
277 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
279 FIXME("(%p/%p)->(): stub\n", iface, This);
284 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetDither(IDirect3DRMDevice2* iface, BOOL enable)
286 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
288 TRACE("(%p/%p)->(%d)\n", iface, This, enable);
290 return IDirect3DRMDevice3_SetDither(&This->IDirect3DRMDevice3_iface, enable);
293 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetShades(IDirect3DRMDevice2* iface, DWORD count)
295 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
297 FIXME("(%p/%p)->(%u): stub\n", iface, This, count);
302 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetQuality(IDirect3DRMDevice2* iface,
303 D3DRMRENDERQUALITY quality)
305 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
307 TRACE("(%p/%p)->(%u)\n", iface, This, quality);
309 return IDirect3DRMDevice3_SetQuality(&This->IDirect3DRMDevice3_iface, quality);
312 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetTextureQuality(IDirect3DRMDevice2* iface,
313 D3DRMTEXTUREQUALITY quality)
315 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
317 FIXME("(%p/%p)->(%u): stub\n", iface, This, quality);
322 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetViewports(IDirect3DRMDevice2* iface,
323 LPDIRECT3DRMVIEWPORTARRAY *return_views)
325 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
327 FIXME("(%p/%p)->(%p): stub\n", iface, This, return_views);
332 static BOOL WINAPI IDirect3DRMDevice2Impl_GetDither(IDirect3DRMDevice2* iface)
334 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
336 TRACE("(%p/%p)->()\n", iface, This);
338 return IDirect3DRMDevice3_GetDither(&This->IDirect3DRMDevice3_iface);
341 static DWORD WINAPI IDirect3DRMDevice2Impl_GetShades(IDirect3DRMDevice2* iface)
343 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
345 FIXME("(%p/%p)->(): stub\n", iface, This);
350 static DWORD WINAPI IDirect3DRMDevice2Impl_GetHeight(IDirect3DRMDevice2* iface)
352 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
354 TRACE("(%p/%p)->()\n", iface, This);
356 return IDirect3DRMDevice3_GetHeight(&This->IDirect3DRMDevice3_iface);
359 static DWORD WINAPI IDirect3DRMDevice2Impl_GetWidth(IDirect3DRMDevice2* iface)
361 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
363 TRACE("(%p/%p)->()\n", iface, This);
365 return IDirect3DRMDevice3_GetWidth(&This->IDirect3DRMDevice3_iface);
368 static DWORD WINAPI IDirect3DRMDevice2Impl_GetTrianglesDrawn(IDirect3DRMDevice2* iface)
370 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
372 FIXME("(%p/%p)->(): stub\n", iface, This);
377 static DWORD WINAPI IDirect3DRMDevice2Impl_GetWireframeOptions(IDirect3DRMDevice2* iface)
379 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
381 FIXME("(%p/%p)->(): stub\n", iface, This);
386 static D3DRMRENDERQUALITY WINAPI IDirect3DRMDevice2Impl_GetQuality(IDirect3DRMDevice2* iface)
388 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
390 TRACE("(%p/%p)->()\n", iface, This);
392 return IDirect3DRMDevice3_GetQuality(&This->IDirect3DRMDevice3_iface);
395 static D3DCOLORMODEL WINAPI IDirect3DRMDevice2Impl_GetColorModel(IDirect3DRMDevice2* iface)
397 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
399 FIXME("(%p/%p)->(): stub\n", iface, This);
404 static D3DRMTEXTUREQUALITY WINAPI IDirect3DRMDevice2Impl_GetTextureQuality(IDirect3DRMDevice2* iface)
406 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
408 FIXME("(%p/%p)->(): stub\n", iface, This);
413 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetDirect3DDevice(IDirect3DRMDevice2 *iface,
414 IDirect3DDevice **dev)
416 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
418 FIXME("(%p/%p)->(%p): stub\n", iface, This, dev);
423 static HRESULT WINAPI IDirect3DRMDevice2Impl_InitFromD3D2(IDirect3DRMDevice2 *iface,
424 IDirect3D2 *lpD3D, IDirect3DDevice2 *lpD3DDev)
426 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
428 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, lpD3D, lpD3DDev);
433 static HRESULT WINAPI IDirect3DRMDevice2Impl_InitFromSurface(IDirect3DRMDevice2 *iface, GUID *lpGUID,
434 IDirectDraw *lpDD, IDirectDrawSurface *lpDDSBack)
436 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
438 FIXME("(%p/%p)->(%p, %p, %p): stub\n", iface, This, lpGUID, lpDD, lpDDSBack);
443 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetRenderMode(IDirect3DRMDevice2* iface, DWORD dwFlags)
445 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
447 TRACE("(%p/%p)->(%u)\n", iface, This, dwFlags);
449 return IDirect3DRMDevice3_SetRenderMode(&This->IDirect3DRMDevice3_iface, dwFlags);
452 static DWORD WINAPI IDirect3DRMDevice2Impl_GetRenderMode(IDirect3DRMDevice2* iface)
454 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
456 TRACE("(%p/%p)->()\n", iface, This);
458 return IDirect3DRMDevice3_GetRenderMode(&This->IDirect3DRMDevice3_iface);
461 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetDirect3DDevice2(IDirect3DRMDevice2 *iface,
462 IDirect3DDevice2 **dev)
464 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
466 FIXME("(%p/%p)->(%p): stub\n", iface, This, dev);
471 static const struct IDirect3DRMDevice2Vtbl Direct3DRMDevice2_Vtbl =
473 /*** IUnknown methods ***/
474 IDirect3DRMDevice2Impl_QueryInterface,
475 IDirect3DRMDevice2Impl_AddRef,
476 IDirect3DRMDevice2Impl_Release,
477 /*** IDirect3DRMObject methods ***/
478 IDirect3DRMDevice2Impl_Clone,
479 IDirect3DRMDevice2Impl_AddDestroyCallback,
480 IDirect3DRMDevice2Impl_DeleteDestroyCallback,
481 IDirect3DRMDevice2Impl_SetAppData,
482 IDirect3DRMDevice2Impl_GetAppData,
483 IDirect3DRMDevice2Impl_SetName,
484 IDirect3DRMDevice2Impl_GetName,
485 IDirect3DRMDevice2Impl_GetClassName,
486 /*** IDirect3DRMDevice methods ***/
487 IDirect3DRMDevice2Impl_Init,
488 IDirect3DRMDevice2Impl_InitFromD3D,
489 IDirect3DRMDevice2Impl_InitFromClipper,
490 IDirect3DRMDevice2Impl_Update,
491 IDirect3DRMDevice2Impl_AddUpdateCallback,
492 IDirect3DRMDevice2Impl_DeleteUpdateCallback,
493 IDirect3DRMDevice2Impl_SetBufferCount,
494 IDirect3DRMDevice2Impl_GetBufferCount,
495 IDirect3DRMDevice2Impl_SetDither,
496 IDirect3DRMDevice2Impl_SetShades,
497 IDirect3DRMDevice2Impl_SetQuality,
498 IDirect3DRMDevice2Impl_SetTextureQuality,
499 IDirect3DRMDevice2Impl_GetViewports,
500 IDirect3DRMDevice2Impl_GetDither,
501 IDirect3DRMDevice2Impl_GetShades,
502 IDirect3DRMDevice2Impl_GetHeight,
503 IDirect3DRMDevice2Impl_GetWidth,
504 IDirect3DRMDevice2Impl_GetTrianglesDrawn,
505 IDirect3DRMDevice2Impl_GetWireframeOptions,
506 IDirect3DRMDevice2Impl_GetQuality,
507 IDirect3DRMDevice2Impl_GetColorModel,
508 IDirect3DRMDevice2Impl_GetTextureQuality,
509 IDirect3DRMDevice2Impl_GetDirect3DDevice,
510 /*** IDirect3DRMDevice2 methods ***/
511 IDirect3DRMDevice2Impl_InitFromD3D2,
512 IDirect3DRMDevice2Impl_InitFromSurface,
513 IDirect3DRMDevice2Impl_SetRenderMode,
514 IDirect3DRMDevice2Impl_GetRenderMode,
515 IDirect3DRMDevice2Impl_GetDirect3DDevice2
519 /*** IUnknown methods ***/
520 static HRESULT WINAPI IDirect3DRMDevice3Impl_QueryInterface(IDirect3DRMDevice3* iface,
521 REFIID riid, void** object)
523 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
524 return IDirect3DRMDevice2_QueryInterface(&This->IDirect3DRMDevice2_iface, riid, object);
527 static ULONG WINAPI IDirect3DRMDevice3Impl_AddRef(IDirect3DRMDevice3* iface)
529 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
530 return IDirect3DRMDevice2_AddRef(&This->IDirect3DRMDevice2_iface);
533 static ULONG WINAPI IDirect3DRMDevice3Impl_Release(IDirect3DRMDevice3* iface)
535 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
536 return IDirect3DRMDevice2_Release(&This->IDirect3DRMDevice2_iface);
539 /*** IDirect3DRMObject methods ***/
540 static HRESULT WINAPI IDirect3DRMDevice3Impl_Clone(IDirect3DRMDevice3* iface,
541 LPUNKNOWN unkwn, REFIID riid,
544 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
546 FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
551 static HRESULT WINAPI IDirect3DRMDevice3Impl_AddDestroyCallback(IDirect3DRMDevice3* iface,
552 D3DRMOBJECTCALLBACK cb,
555 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
557 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
562 static HRESULT WINAPI IDirect3DRMDevice3Impl_DeleteDestroyCallback(IDirect3DRMDevice3* iface,
563 D3DRMOBJECTCALLBACK cb,
566 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
568 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
573 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetAppData(IDirect3DRMDevice3* iface,
576 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
578 FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
583 static DWORD WINAPI IDirect3DRMDevice3Impl_GetAppData(IDirect3DRMDevice3* iface)
585 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
587 FIXME("(%p/%p)->(): stub\n", iface, This);
592 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetName(IDirect3DRMDevice3* iface, LPCSTR name)
594 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
596 FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
601 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetName(IDirect3DRMDevice3* iface,
602 LPDWORD size, LPSTR name)
604 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
606 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
611 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetClassName(IDirect3DRMDevice3* iface,
612 LPDWORD size, LPSTR name)
614 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
616 TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
618 if (!size || *size < strlen("Device") || !name)
621 strcpy(name, "Device");
622 *size = sizeof("Device");
627 /*** IDirect3DRMDevice methods ***/
628 static HRESULT WINAPI IDirect3DRMDevice3Impl_Init(IDirect3DRMDevice3* iface, ULONG width,
631 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
633 FIXME("(%p/%p)->(%u, %u): stub\n", iface, This, width, height);
635 This->height = height;
641 static HRESULT WINAPI IDirect3DRMDevice3Impl_InitFromD3D(IDirect3DRMDevice3 *iface,
642 IDirect3D *lpD3D, IDirect3DDevice *lpD3DDev)
644 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
646 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, lpD3D, lpD3DDev);
651 static HRESULT WINAPI IDirect3DRMDevice3Impl_InitFromClipper(IDirect3DRMDevice3 *iface,
652 IDirectDrawClipper *lpDDClipper, GUID *lpGUID, int width, int height)
654 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
656 FIXME("(%p/%p)->(%p, %p, %u, %u): stub\n", iface, This, lpDDClipper, lpGUID, width, height);
658 This->height = height;
664 static HRESULT WINAPI IDirect3DRMDevice3Impl_Update(IDirect3DRMDevice3* iface)
666 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
668 FIXME("(%p/%p)->(): stub\n", iface, This);
673 static HRESULT WINAPI IDirect3DRMDevice3Impl_AddUpdateCallback(IDirect3DRMDevice3* iface,
674 D3DRMUPDATECALLBACK cb, LPVOID arg)
676 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
678 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, arg);
683 static HRESULT WINAPI IDirect3DRMDevice3Impl_DeleteUpdateCallback(IDirect3DRMDevice3* iface,
684 D3DRMUPDATECALLBACK cb,
687 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
689 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, arg);
694 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetBufferCount(IDirect3DRMDevice3* iface, DWORD count)
696 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
698 FIXME("(%p/%p)->(%u): stub\n", iface, This, count);
703 static DWORD WINAPI IDirect3DRMDevice3Impl_GetBufferCount(IDirect3DRMDevice3* iface)
705 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
707 FIXME("(%p/%p)->(): stub\n", iface, This);
712 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetDither(IDirect3DRMDevice3* iface, BOOL enable)
714 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
716 TRACE("(%p/%p)->(%d)\n", iface, This, enable);
718 This->dither = enable;
723 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetShades(IDirect3DRMDevice3* iface, DWORD count)
725 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
727 FIXME("(%p/%p)->(%u): stub\n", iface, This, count);
732 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetQuality(IDirect3DRMDevice3* iface,
733 D3DRMRENDERQUALITY quality)
735 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
737 TRACE("(%p/%p)->(%u)\n", iface, This, quality);
739 This->quality = quality;
744 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetTextureQuality(IDirect3DRMDevice3* iface,
745 D3DRMTEXTUREQUALITY quality)
747 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
749 FIXME("(%p/%p)->(%u): stub\n", iface, This, quality);
754 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetViewports(IDirect3DRMDevice3* iface,
755 LPDIRECT3DRMVIEWPORTARRAY *return_views)
757 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
759 FIXME("(%p/%p)->(%p): stub\n", iface, This, return_views);
764 static BOOL WINAPI IDirect3DRMDevice3Impl_GetDither(IDirect3DRMDevice3* iface)
766 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
768 TRACE("(%p/%p)->()\n", iface, This);
773 static DWORD WINAPI IDirect3DRMDevice3Impl_GetShades(IDirect3DRMDevice3* iface)
775 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
777 FIXME("(%p/%p)->(): stub\n", iface, This);
782 static DWORD WINAPI IDirect3DRMDevice3Impl_GetHeight(IDirect3DRMDevice3* iface)
784 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
786 TRACE("(%p/%p)->()\n", iface, This);
791 static DWORD WINAPI IDirect3DRMDevice3Impl_GetWidth(IDirect3DRMDevice3* iface)
793 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
795 TRACE("(%p/%p)->()\n", iface, This);
800 static DWORD WINAPI IDirect3DRMDevice3Impl_GetTrianglesDrawn(IDirect3DRMDevice3* iface)
802 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
804 FIXME("(%p/%p)->(): stub\n", iface, This);
809 static DWORD WINAPI IDirect3DRMDevice3Impl_GetWireframeOptions(IDirect3DRMDevice3* iface)
811 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
813 FIXME("(%p/%p)->(): stub\n", iface, This);
818 static D3DRMRENDERQUALITY WINAPI IDirect3DRMDevice3Impl_GetQuality(IDirect3DRMDevice3* iface)
820 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
822 TRACE("(%p/%p)->()\n", iface, This);
824 return This->quality;
827 static D3DCOLORMODEL WINAPI IDirect3DRMDevice3Impl_GetColorModel(IDirect3DRMDevice3* iface)
829 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
831 FIXME("(%p/%p)->(): stub\n", iface, This);
836 static D3DRMTEXTUREQUALITY WINAPI IDirect3DRMDevice3Impl_GetTextureQuality(IDirect3DRMDevice3* iface)
838 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
840 FIXME("(%p/%p)->(): stub\n", iface, This);
845 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetDirect3DDevice(IDirect3DRMDevice3 *iface,
846 IDirect3DDevice **dev)
848 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
850 FIXME("(%p/%p)->(%p): stub\n", iface, This, dev);
855 /*** IDirect3DRMDevice2 methods ***/
856 static HRESULT WINAPI IDirect3DRMDevice3Impl_InitFromD3D2(IDirect3DRMDevice3 *iface,
857 IDirect3D2 *lpD3D, IDirect3DDevice2 *lpD3DDev)
859 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
861 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, lpD3D, lpD3DDev);
866 static HRESULT WINAPI IDirect3DRMDevice3Impl_InitFromSurface(IDirect3DRMDevice3 *iface, GUID *lpGUID,
867 IDirectDraw *lpDD, IDirectDrawSurface *lpDDSBack)
869 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
871 FIXME("(%p/%p)->(%p, %p, %p): stub\n", iface, This, lpGUID, lpDD, lpDDSBack);
876 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetRenderMode(IDirect3DRMDevice3* iface, DWORD dwFlags)
878 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
880 TRACE("(%p/%p)->(%u)\n", iface, This, dwFlags);
882 This->rendermode = dwFlags;
887 static DWORD WINAPI IDirect3DRMDevice3Impl_GetRenderMode(IDirect3DRMDevice3* iface)
889 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
891 TRACE("(%p/%p)->()\n", iface, This);
893 return This->rendermode;
896 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetDirect3DDevice2(IDirect3DRMDevice3 *iface,
897 IDirect3DDevice2 **dev)
899 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
901 FIXME("(%p/%p)->(%p): stub\n", iface, This, dev);
906 /*** IDirect3DRMDevice3 methods ***/
907 static HRESULT WINAPI IDirect3DRMDevice3Impl_FindPreferredTextureFormat(IDirect3DRMDevice3* iface,
910 LPDDPIXELFORMAT lpDDPF)
912 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
914 FIXME("(%p/%p)->(%u, %u, %p): stub\n", iface, This, bitdepths, flags, lpDDPF);
919 static HRESULT WINAPI IDirect3DRMDevice3Impl_RenderStateChange(IDirect3DRMDevice3* iface,
920 D3DRENDERSTATETYPE type, DWORD val,
923 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
925 FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface, This, type, val, flags);
930 static HRESULT WINAPI IDirect3DRMDevice3Impl_LightStateChange(IDirect3DRMDevice3* iface,
931 D3DLIGHTSTATETYPE type, DWORD val,
934 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
936 FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface, This, type, val, flags);
941 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetStateChangeOptions(IDirect3DRMDevice3* iface,
942 DWORD stateclass, DWORD statenum,
945 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
947 FIXME("(%p/%p)->(%u, %u, %p): stub\n", iface, This, stateclass, statenum, flags);
952 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetStateChangeOptions(IDirect3DRMDevice3* iface,
953 DWORD stateclass, DWORD statenum,
956 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
958 FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface, This, stateclass, statenum, flags);
963 static const struct IDirect3DRMDevice3Vtbl Direct3DRMDevice3_Vtbl =
965 /*** IUnknown methods ***/
966 IDirect3DRMDevice3Impl_QueryInterface,
967 IDirect3DRMDevice3Impl_AddRef,
968 IDirect3DRMDevice3Impl_Release,
969 /*** IDirect3DRMObject methods ***/
970 IDirect3DRMDevice3Impl_Clone,
971 IDirect3DRMDevice3Impl_AddDestroyCallback,
972 IDirect3DRMDevice3Impl_DeleteDestroyCallback,
973 IDirect3DRMDevice3Impl_SetAppData,
974 IDirect3DRMDevice3Impl_GetAppData,
975 IDirect3DRMDevice3Impl_SetName,
976 IDirect3DRMDevice3Impl_GetName,
977 IDirect3DRMDevice3Impl_GetClassName,
978 /*** IDirect3DRMDevice methods ***/
979 IDirect3DRMDevice3Impl_Init,
980 IDirect3DRMDevice3Impl_InitFromD3D,
981 IDirect3DRMDevice3Impl_InitFromClipper,
982 IDirect3DRMDevice3Impl_Update,
983 IDirect3DRMDevice3Impl_AddUpdateCallback,
984 IDirect3DRMDevice3Impl_DeleteUpdateCallback,
985 IDirect3DRMDevice3Impl_SetBufferCount,
986 IDirect3DRMDevice3Impl_GetBufferCount,
987 IDirect3DRMDevice3Impl_SetDither,
988 IDirect3DRMDevice3Impl_SetShades,
989 IDirect3DRMDevice3Impl_SetQuality,
990 IDirect3DRMDevice3Impl_SetTextureQuality,
991 IDirect3DRMDevice3Impl_GetViewports,
992 IDirect3DRMDevice3Impl_GetDither,
993 IDirect3DRMDevice3Impl_GetShades,
994 IDirect3DRMDevice3Impl_GetHeight,
995 IDirect3DRMDevice3Impl_GetWidth,
996 IDirect3DRMDevice3Impl_GetTrianglesDrawn,
997 IDirect3DRMDevice3Impl_GetWireframeOptions,
998 IDirect3DRMDevice3Impl_GetQuality,
999 IDirect3DRMDevice3Impl_GetColorModel,
1000 IDirect3DRMDevice3Impl_GetTextureQuality,
1001 IDirect3DRMDevice3Impl_GetDirect3DDevice,
1002 /*** IDirect3DRMDevice2 methods ***/
1003 IDirect3DRMDevice3Impl_InitFromD3D2,
1004 IDirect3DRMDevice3Impl_InitFromSurface,
1005 IDirect3DRMDevice3Impl_SetRenderMode,
1006 IDirect3DRMDevice3Impl_GetRenderMode,
1007 IDirect3DRMDevice3Impl_GetDirect3DDevice2,
1008 /*** IDirect3DRMDevice3 methods ***/
1009 IDirect3DRMDevice3Impl_FindPreferredTextureFormat,
1010 IDirect3DRMDevice3Impl_RenderStateChange,
1011 IDirect3DRMDevice3Impl_LightStateChange,
1012 IDirect3DRMDevice3Impl_GetStateChangeOptions,
1013 IDirect3DRMDevice3Impl_SetStateChangeOptions
1017 /*** IUnknown methods ***/
1018 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_QueryInterface(IDirect3DRMWinDevice* iface,
1019 REFIID riid, void** object)
1021 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1022 return IDirect3DRMDevice2_QueryInterface(&This->IDirect3DRMDevice2_iface, riid, object);
1025 static ULONG WINAPI IDirect3DRMWinDeviceImpl_AddRef(IDirect3DRMWinDevice* iface)
1027 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1028 return IDirect3DRMDevice2_AddRef(&This->IDirect3DRMDevice2_iface);
1031 static ULONG WINAPI IDirect3DRMWinDeviceImpl_Release(IDirect3DRMWinDevice* iface)
1033 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1034 return IDirect3DRMDevice2_Release(&This->IDirect3DRMDevice2_iface);
1037 /*** IDirect3DRMObject methods ***/
1038 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_Clone(IDirect3DRMWinDevice* iface,
1039 LPUNKNOWN unkwn, REFIID riid,
1042 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1044 FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
1049 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_AddDestroyCallback(IDirect3DRMWinDevice* iface,
1050 D3DRMOBJECTCALLBACK cb,
1053 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1055 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
1060 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_DeleteDestroyCallback(IDirect3DRMWinDevice* iface,
1061 D3DRMOBJECTCALLBACK cb,
1064 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1066 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
1071 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_SetAppData(IDirect3DRMWinDevice* iface,
1074 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1076 FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
1081 static DWORD WINAPI IDirect3DRMWinDeviceImpl_GetAppData(IDirect3DRMWinDevice* iface)
1083 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1085 FIXME("(%p/%p)->(): stub\n", iface, This);
1090 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_SetName(IDirect3DRMWinDevice* iface, LPCSTR name)
1092 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1094 FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
1099 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_GetName(IDirect3DRMWinDevice* iface,
1100 LPDWORD size, LPSTR name)
1102 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1104 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
1109 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_GetClassName(IDirect3DRMWinDevice* iface,
1110 LPDWORD size, LPSTR name)
1112 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1114 TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
1116 return IDirect3DRMDevice3_GetClassName(&This->IDirect3DRMDevice3_iface, size, name);
1119 /*** IDirect3DRMWinDevice methods ***/
1120 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_HandlePaint(IDirect3DRMWinDevice* iface, HDC hdc)
1122 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1124 FIXME("(%p/%p)->(%p): stub\n", iface, This, hdc);
1129 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_HandleActivate(IDirect3DRMWinDevice* iface, WORD wparam)
1131 IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1133 FIXME("(%p/%p)->(%u): stub\n", iface, This, wparam);
1138 static const struct IDirect3DRMWinDeviceVtbl Direct3DRMWinDevice_Vtbl =
1140 /*** IUnknown methods ***/
1141 IDirect3DRMWinDeviceImpl_QueryInterface,
1142 IDirect3DRMWinDeviceImpl_AddRef,
1143 IDirect3DRMWinDeviceImpl_Release,
1144 /*** IDirect3DRMObject methods ***/
1145 IDirect3DRMWinDeviceImpl_Clone,
1146 IDirect3DRMWinDeviceImpl_AddDestroyCallback,
1147 IDirect3DRMWinDeviceImpl_DeleteDestroyCallback,
1148 IDirect3DRMWinDeviceImpl_SetAppData,
1149 IDirect3DRMWinDeviceImpl_GetAppData,
1150 IDirect3DRMWinDeviceImpl_SetName,
1151 IDirect3DRMWinDeviceImpl_GetName,
1152 IDirect3DRMWinDeviceImpl_GetClassName,
1153 /*** IDirect3DRMWinDevice methods ***/
1154 IDirect3DRMWinDeviceImpl_HandlePaint,
1155 IDirect3DRMWinDeviceImpl_HandleActivate
1158 HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown** ppObj)
1160 IDirect3DRMDeviceImpl* object;
1162 TRACE("(%p)\n", ppObj);
1164 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMDeviceImpl));
1167 ERR("Out of memory\n");
1168 return E_OUTOFMEMORY;
1171 object->IDirect3DRMDevice2_iface.lpVtbl = &Direct3DRMDevice2_Vtbl;
1172 object->IDirect3DRMDevice3_iface.lpVtbl = &Direct3DRMDevice3_Vtbl;
1173 object->IDirect3DRMWinDevice_iface.lpVtbl = &Direct3DRMWinDevice_Vtbl;
1176 if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
1177 *ppObj = (IUnknown*)&object->IDirect3DRMDevice3_iface;
1179 *ppObj = (IUnknown*)&object->IDirect3DRMDevice2_iface;