2012-01-12 23:16:02 +00:00
|
|
|
/*
|
|
|
|
* Implementation of IDirect3DRMDevice Interface
|
|
|
|
*
|
|
|
|
* Copyright 2011, 2012 André Hentschel
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
|
|
|
|
#include "d3drm_private.h"
|
2012-01-17 21:56:24 +00:00
|
|
|
#include "initguid.h"
|
2012-01-12 23:16:02 +00:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
|
|
|
|
|
2015-07-22 09:58:12 +00:00
|
|
|
static inline struct d3drm_device *impl_from_IDirect3DRMDevice(IDirect3DRMDevice *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice_iface);
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static inline struct d3drm_device *impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2 *iface)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice2_iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static inline struct d3drm_device *impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2015-08-06 21:47:52 +00:00
|
|
|
void d3drm_device_destroy(struct d3drm_device *device)
|
|
|
|
{
|
2016-07-10 16:41:11 +00:00
|
|
|
d3drm_object_cleanup((IDirect3DRMObject *)&device->IDirect3DRMDevice_iface, &device->obj);
|
2015-08-06 21:47:53 +00:00
|
|
|
if (device->device)
|
|
|
|
{
|
|
|
|
TRACE("Releasing attached ddraw interfaces.\n");
|
|
|
|
IDirect3DDevice_Release(device->device);
|
|
|
|
}
|
|
|
|
if (device->render_target)
|
|
|
|
IDirectDrawSurface_Release(device->render_target);
|
|
|
|
if (device->primary_surface)
|
|
|
|
{
|
|
|
|
TRACE("Releasing primary surface and attached clipper.\n");
|
|
|
|
IDirectDrawSurface_Release(device->primary_surface);
|
|
|
|
IDirectDrawClipper_Release(device->clipper);
|
|
|
|
}
|
|
|
|
if (device->ddraw)
|
|
|
|
{
|
|
|
|
IDirectDraw_Release(device->ddraw);
|
|
|
|
IDirect3DRM_Release(device->d3drm);
|
|
|
|
}
|
2015-08-06 21:47:52 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, device);
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static inline struct d3drm_device *impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice *iface)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMWinDevice_iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2015-08-06 21:47:53 +00:00
|
|
|
HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface)
|
|
|
|
{
|
|
|
|
DDSURFACEDESC surface_desc;
|
|
|
|
IDirectDrawSurface *primary_surface, *render_target;
|
|
|
|
HWND window;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = IDirectDrawClipper_GetHWnd(clipper, &window);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
memset(&surface_desc, 0, sizeof(surface_desc));
|
|
|
|
surface_desc.dwSize = sizeof(surface_desc);
|
|
|
|
surface_desc.dwFlags = DDSD_CAPS;
|
|
|
|
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
|
|
|
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &primary_surface, NULL);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
hr = IDirectDrawSurface_SetClipper(primary_surface, clipper);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
IDirectDrawSurface_Release(primary_surface);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
memset(&surface_desc, 0, sizeof(surface_desc));
|
|
|
|
surface_desc.dwSize = sizeof(surface_desc);
|
|
|
|
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
|
|
|
|
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
|
|
|
|
surface_desc.dwWidth = width;
|
|
|
|
surface_desc.dwHeight = height;
|
|
|
|
|
|
|
|
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &render_target, NULL);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
IDirectDrawSurface_Release(primary_surface);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
object->primary_surface = primary_surface;
|
|
|
|
object->clipper = clipper;
|
|
|
|
IDirectDrawClipper_AddRef(clipper);
|
|
|
|
*surface = render_target;
|
|
|
|
|
|
|
|
return D3DRM_OK;
|
|
|
|
}
|
|
|
|
|
2016-07-12 17:07:24 +00:00
|
|
|
HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw *ddraw, IDirectDrawSurface *surface,
|
2015-08-06 21:47:57 +00:00
|
|
|
BOOL create_z_surface)
|
2015-08-06 21:47:53 +00:00
|
|
|
{
|
2015-08-06 21:47:57 +00:00
|
|
|
DDSCAPS caps = { DDSCAPS_ZBUFFER };
|
2015-08-06 21:47:53 +00:00
|
|
|
IDirectDrawSurface *ds = NULL;
|
|
|
|
IDirect3DDevice *device1 = NULL;
|
|
|
|
IDirect3DDevice2 *device2 = NULL;
|
|
|
|
IDirect3D2 *d3d2 = NULL;
|
|
|
|
DDSURFACEDESC desc, surface_desc;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
device->ddraw = ddraw;
|
|
|
|
IDirectDraw_AddRef(ddraw);
|
2016-07-12 17:07:24 +00:00
|
|
|
IDirect3DRM_AddRef(device->d3drm);
|
2015-08-06 21:47:53 +00:00
|
|
|
device->render_target = surface;
|
|
|
|
IDirectDrawSurface_AddRef(surface);
|
|
|
|
|
|
|
|
desc.dwSize = sizeof(desc);
|
|
|
|
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
2015-08-06 21:47:57 +00:00
|
|
|
if (!(desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
|
|
|
|
return DDERR_INVALIDCAPS;
|
2015-08-06 21:47:53 +00:00
|
|
|
|
2015-08-06 21:47:57 +00:00
|
|
|
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
create_z_surface = FALSE;
|
|
|
|
IDirectDrawSurface_Release(ds);
|
|
|
|
ds = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (create_z_surface)
|
|
|
|
{
|
|
|
|
memset(&surface_desc, 0, sizeof(surface_desc));
|
|
|
|
surface_desc.dwSize = sizeof(surface_desc);
|
|
|
|
surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
|
|
|
|
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
|
|
|
|
surface_desc.dwZBufferBitDepth = 16;
|
|
|
|
surface_desc.dwWidth = desc.dwWidth;
|
|
|
|
surface_desc.dwHeight = desc.dwHeight;
|
|
|
|
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
hr = IDirectDrawSurface_AddAttachedSurface(surface, ds);
|
|
|
|
IDirectDrawSurface_Release(ds);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
}
|
2015-08-06 21:47:53 +00:00
|
|
|
|
|
|
|
if (version == 1)
|
|
|
|
hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DRGBDevice, (void **)&device1);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
IDirectDraw_QueryInterface(ddraw, &IID_IDirect3D2, (void**)&d3d2);
|
|
|
|
hr = IDirect3D2_CreateDevice(d3d2, &IID_IDirect3DRGBDevice, surface, &device2);
|
|
|
|
IDirect3D2_Release(d3d2);
|
|
|
|
}
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (version != 1)
|
|
|
|
{
|
|
|
|
hr = IDirect3DDevice2_QueryInterface(device2, &IID_IDirect3DDevice, (void**)&device1);
|
|
|
|
IDirect3DDevice2_Release(device2);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
device->device = device1;
|
2016-06-30 11:53:54 +00:00
|
|
|
device->width = desc.dwWidth;
|
|
|
|
device->height = desc.dwHeight;
|
2015-08-06 21:47:53 +00:00
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2016-07-12 17:07:24 +00:00
|
|
|
HRESULT d3drm_device_set_ddraw_device_d3d(struct d3drm_device *device, IDirect3D *d3d, IDirect3DDevice *d3d_device)
|
2015-08-20 14:46:39 +00:00
|
|
|
{
|
2016-07-15 15:25:45 +00:00
|
|
|
IDirectDraw *ddraw;
|
2016-06-30 11:53:54 +00:00
|
|
|
IDirectDrawSurface *surface;
|
|
|
|
IDirect3DDevice2 *d3d_device2;
|
|
|
|
DDSURFACEDESC desc;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2016-07-15 15:25:45 +00:00
|
|
|
/* AddRef these interfaces beforehand for the intentional leak on reinitialization. */
|
|
|
|
if (FAILED(hr = IDirect3D_QueryInterface(d3d, &IID_IDirectDraw, (void **)&ddraw)))
|
|
|
|
return hr;
|
|
|
|
IDirect3DRM_AddRef(device->d3drm);
|
|
|
|
IDirect3DDevice_AddRef(d3d_device);
|
|
|
|
|
|
|
|
if (device->ddraw)
|
|
|
|
return D3DRMERR_BADOBJECT;
|
|
|
|
|
2016-06-30 11:53:54 +00:00
|
|
|
/* Fetch render target and get width/height from there */
|
|
|
|
if (FAILED(hr = IDirect3DDevice_QueryInterface(d3d_device, &IID_IDirectDrawSurface, (void **)&surface)))
|
|
|
|
{
|
|
|
|
if (FAILED(hr = IDirect3DDevice_QueryInterface(d3d_device, &IID_IDirect3DDevice2, (void **)&d3d_device2)))
|
|
|
|
return hr;
|
|
|
|
hr = IDirect3DDevice2_GetRenderTarget(d3d_device2, &surface);
|
|
|
|
IDirect3DDevice2_Release(d3d_device2);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
desc.dwSize = sizeof(desc);
|
|
|
|
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc);
|
|
|
|
IDirectDrawSurface_Release(surface);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
2016-07-15 15:25:45 +00:00
|
|
|
device->ddraw = ddraw;
|
2016-06-30 11:53:54 +00:00
|
|
|
device->width = desc.dwWidth;
|
|
|
|
device->height = desc.dwHeight;
|
2015-08-20 14:46:39 +00:00
|
|
|
device->device = d3d_device;
|
|
|
|
|
2016-06-30 11:53:54 +00:00
|
|
|
return hr;
|
2015-08-20 14:46:39 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_QueryInterface(IDirect3DRMDevice3 *iface, REFIID riid, void **out)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
|
|
|
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
if (IsEqualGUID(riid, &IID_IDirect3DRMDevice)
|
|
|
|
|| IsEqualGUID(riid, &IID_IDirect3DRMObject)
|
|
|
|
|| IsEqualGUID(riid, &IID_IUnknown))
|
|
|
|
{
|
|
|
|
*out = &device->IDirect3DRMDevice_iface;
|
|
|
|
}
|
|
|
|
else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice2))
|
|
|
|
{
|
|
|
|
*out = &device->IDirect3DRMDevice2_iface;
|
|
|
|
}
|
|
|
|
else if (IsEqualGUID(riid, &IID_IDirect3DRMDevice3))
|
|
|
|
{
|
|
|
|
*out = &device->IDirect3DRMDevice3_iface;
|
|
|
|
}
|
|
|
|
else if (IsEqualGUID(riid, &IID_IDirect3DRMWinDevice))
|
|
|
|
{
|
|
|
|
*out = &device->IDirect3DRMWinDevice_iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*out = NULL;
|
|
|
|
WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
|
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown *)*out);
|
|
|
|
return S_OK;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_QueryInterface(IDirect3DRMDevice2 *iface, REFIID riid, void **out)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_QueryInterface(IDirect3DRMDevice *iface, REFIID riid, void **out)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static ULONG WINAPI d3drm_device3_AddRef(IDirect3DRMDevice3 *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2016-07-10 16:41:11 +00:00
|
|
|
ULONG refcount = InterlockedIncrement(&device->obj.ref);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("%p increasing refcount to %u.\n", iface, refcount);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return refcount;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static ULONG WINAPI d3drm_device2_AddRef(IDirect3DRMDevice2 *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_AddRef(&device->IDirect3DRMDevice3_iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static ULONG WINAPI d3drm_device1_AddRef(IDirect3DRMDevice *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_AddRef(&device->IDirect3DRMDevice3_iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static ULONG WINAPI d3drm_device3_Release(IDirect3DRMDevice3 *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2016-07-10 16:41:11 +00:00
|
|
|
ULONG refcount = InterlockedDecrement(&device->obj.ref);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("%p decreasing refcount to %u.\n", iface, refcount);
|
|
|
|
|
|
|
|
if (!refcount)
|
|
|
|
d3drm_device_destroy(device);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return refcount;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static ULONG WINAPI d3drm_device2_Release(IDirect3DRMDevice2 *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_Release(&device->IDirect3DRMDevice3_iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static ULONG WINAPI d3drm_device1_Release(IDirect3DRMDevice *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_Release(&device->IDirect3DRMDevice3_iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_Clone(IDirect3DRMDevice3 *iface,
|
|
|
|
IUnknown *outer, REFIID iid, void **out)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_Clone(IDirect3DRMDevice2 *iface,
|
|
|
|
IUnknown *outer, REFIID iid, void **out)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, outer %p, iid %s, out %p\n", iface, outer, debugstr_guid(iid), out);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_Clone(IDirect3DRMDevice *iface,
|
|
|
|
IUnknown *outer, REFIID iid, void **out)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_AddDestroyCallback(IDirect3DRMDevice3 *iface,
|
|
|
|
D3DRMOBJECTCALLBACK cb, void *ctx)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:11 +00:00
|
|
|
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
|
|
|
|
|
|
|
|
return d3drm_object_add_destroy_callback(&device->obj, cb, ctx);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_AddDestroyCallback(IDirect3DRMDevice2 *iface,
|
|
|
|
D3DRMOBJECTCALLBACK cb, void *ctx)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:11 +00:00
|
|
|
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
|
|
|
|
|
|
|
|
return d3drm_device3_AddDestroyCallback(&device->IDirect3DRMDevice3_iface, cb, ctx);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_AddDestroyCallback(IDirect3DRMDevice *iface,
|
|
|
|
D3DRMOBJECTCALLBACK cb, void *ctx)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:11 +00:00
|
|
|
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
|
|
|
|
|
|
|
|
return d3drm_device3_AddDestroyCallback(&device->IDirect3DRMDevice3_iface, cb, ctx);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_DeleteDestroyCallback(IDirect3DRMDevice3 *iface,
|
|
|
|
D3DRMOBJECTCALLBACK cb, void *ctx)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:11 +00:00
|
|
|
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
|
|
|
|
|
|
|
|
return d3drm_object_delete_destroy_callback(&device->obj, cb, ctx);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_DeleteDestroyCallback(IDirect3DRMDevice2 *iface,
|
|
|
|
D3DRMOBJECTCALLBACK cb, void *ctx)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:11 +00:00
|
|
|
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
|
|
|
|
|
|
|
|
return d3drm_device3_DeleteDestroyCallback(&device->IDirect3DRMDevice3_iface, cb, ctx);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_DeleteDestroyCallback(IDirect3DRMDevice *iface,
|
|
|
|
D3DRMOBJECTCALLBACK cb, void *ctx)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:11 +00:00
|
|
|
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
|
|
|
|
|
|
|
|
return d3drm_device3_DeleteDestroyCallback(&device->IDirect3DRMDevice3_iface, cb, ctx);
|
2016-07-10 16:41:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI d3drm_device3_SetAppData(IDirect3DRMDevice3 *iface, DWORD data)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, data %#x stub!\n", iface, data);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_SetAppData(IDirect3DRMDevice2 *iface, DWORD data)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, data %#x.\n", iface, data);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetAppData(&device->IDirect3DRMDevice3_iface, data);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_SetAppData(IDirect3DRMDevice *iface, DWORD data)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, data %#x.\n", iface, data);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetAppData(&device->IDirect3DRMDevice3_iface, data);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device3_GetAppData(IDirect3DRMDevice3 *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return 0;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device2_GetAppData(IDirect3DRMDevice2 *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetAppData(&device->IDirect3DRMDevice3_iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device1_GetAppData(IDirect3DRMDevice *iface)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetAppData(&device->IDirect3DRMDevice3_iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_SetName(IDirect3DRMDevice3 *iface, const char *name)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_SetName(IDirect3DRMDevice2 *iface, const char *name)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetName(&device->IDirect3DRMDevice3_iface, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_SetName(IDirect3DRMDevice *iface, const char *name)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetName(&device->IDirect3DRMDevice3_iface, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_GetName(IDirect3DRMDevice3 *iface, DWORD *size, char *name)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI d3drm_device2_GetName(IDirect3DRMDevice2 *iface, DWORD *size, char *name)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetName(&device->IDirect3DRMDevice3_iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_GetName(IDirect3DRMDevice *iface, DWORD *size, char *name)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetName(&device->IDirect3DRMDevice3_iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_GetClassName(IDirect3DRMDevice3 *iface, DWORD *size, char *name)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
if (!size || *size < strlen("Device") || !name)
|
|
|
|
return E_INVALIDARG;
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
strcpy(name, "Device");
|
|
|
|
*size = sizeof("Device");
|
|
|
|
|
|
|
|
return D3DRM_OK;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_GetClassName(IDirect3DRMDevice2 *iface, DWORD *size, char *name)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_GetClassName(IDirect3DRMDevice *iface, DWORD *size, char *name)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_Init(IDirect3DRMDevice3 *iface, ULONG width, ULONG height)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, width %u, height %u stub!\n", iface, width, height);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
device->height = height;
|
|
|
|
device->width = width;
|
|
|
|
|
|
|
|
return D3DRM_OK;
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_Init(IDirect3DRMDevice2 *iface, ULONG width, ULONG height)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, width %u, height %u.\n", iface, width, height);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_Init(&device->IDirect3DRMDevice3_iface, width, height);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_Init(IDirect3DRMDevice *iface, ULONG width, ULONG height)
|
2015-07-22 09:58:12 +00:00
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, width %u, height %u.\n", iface, width, height);
|
2015-07-22 09:58:12 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_Init(&device->IDirect3DRMDevice3_iface, width, height);
|
2015-07-22 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_InitFromD3D(IDirect3DRMDevice3 *iface,
|
|
|
|
IDirect3D *d3d, IDirect3DDevice *d3d_device)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, d3d %p, d3d_device %p stub!\n", iface, d3d, d3d_device);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-15 15:25:45 +00:00
|
|
|
if (!d3d || !d3d_device)
|
|
|
|
return D3DRMERR_BADVALUE;
|
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_InitFromD3D(IDirect3DRMDevice2 *iface,
|
|
|
|
IDirect3D *d3d, IDirect3DDevice *d3d_device)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_InitFromD3D(&device->IDirect3DRMDevice3_iface, d3d, d3d_device);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_InitFromD3D(IDirect3DRMDevice *iface,
|
|
|
|
IDirect3D *d3d, IDirect3DDevice *d3d_device)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-15 15:25:45 +00:00
|
|
|
if (!d3d || !d3d_device)
|
|
|
|
return D3DRMERR_BADVALUE;
|
|
|
|
|
|
|
|
return d3drm_device_set_ddraw_device_d3d(device, d3d, d3d_device);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_InitFromClipper(IDirect3DRMDevice3 *iface,
|
|
|
|
IDirectDrawClipper *clipper, GUID *guid, int width, int height)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, clipper %p, guid %s, width %d, height %d stub!\n",
|
|
|
|
iface, clipper, debugstr_guid(guid), width, height);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
device->height = height;
|
|
|
|
device->width = width;
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_InitFromClipper(IDirect3DRMDevice2 *iface,
|
|
|
|
IDirectDrawClipper *clipper, GUID *guid, int width, int height)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2015-07-22 09:58:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, clipper %p, guid %s, width %d, height %d.\n",
|
|
|
|
iface, clipper, debugstr_guid(guid), width, height);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_InitFromClipper(&device->IDirect3DRMDevice3_iface,
|
|
|
|
clipper, guid, width, height);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_InitFromClipper(IDirect3DRMDevice *iface,
|
|
|
|
IDirectDrawClipper *clipper, GUID *guid, int width, int height)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, clipper %p, guid %s, width %d, height %d.\n",
|
|
|
|
iface, clipper, debugstr_guid(guid), width, height);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_InitFromClipper(&device->IDirect3DRMDevice3_iface,
|
|
|
|
clipper, guid, width, height);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_Update(IDirect3DRMDevice3 *iface)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_Update(IDirect3DRMDevice2 *iface)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_Update(IDirect3DRMDevice *iface)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_AddUpdateCallback(IDirect3DRMDevice3 *iface,
|
|
|
|
D3DRMUPDATECALLBACK cb, void *ctx)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_AddUpdateCallback(IDirect3DRMDevice2 *iface,
|
|
|
|
D3DRMUPDATECALLBACK cb, void *ctx)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_AddUpdateCallback(IDirect3DRMDevice *iface,
|
|
|
|
D3DRMUPDATECALLBACK cb, void *ctx)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_DeleteUpdateCallback(IDirect3DRMDevice3 *iface,
|
2013-09-09 08:26:21 +00:00
|
|
|
D3DRMUPDATECALLBACK cb, void *ctx)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2013-09-09 08:26:21 +00:00
|
|
|
FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_DeleteUpdateCallback(IDirect3DRMDevice2 *iface,
|
2013-09-09 08:26:21 +00:00
|
|
|
D3DRMUPDATECALLBACK cb, void *ctx)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2013-09-09 08:26:21 +00:00
|
|
|
FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_DeleteUpdateCallback(IDirect3DRMDevice *iface,
|
|
|
|
D3DRMUPDATECALLBACK cb, void *ctx)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_SetBufferCount(IDirect3DRMDevice3 *iface, DWORD count)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, count %u stub!\n", iface, count);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_SetBufferCount(IDirect3DRMDevice2 *iface, DWORD count)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2015-07-22 09:58:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p, count %u.\n", iface, count);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetBufferCount(&device->IDirect3DRMDevice3_iface, count);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_SetBufferCount(IDirect3DRMDevice *iface, DWORD count)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, count %u.\n", iface, count);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetBufferCount(&device->IDirect3DRMDevice3_iface, count);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device3_GetBufferCount(IDirect3DRMDevice3 *iface)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device2_GetBufferCount(IDirect3DRMDevice2 *iface)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetBufferCount(&device->IDirect3DRMDevice3_iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device1_GetBufferCount(IDirect3DRMDevice *iface)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2015-08-07 09:53:32 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetBufferCount(&device->IDirect3DRMDevice3_iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_SetDither(IDirect3DRMDevice3 *iface, BOOL enable)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, enable %#x.\n", iface, enable);
|
|
|
|
|
|
|
|
device->dither = enable;
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_SetDither(IDirect3DRMDevice2 *iface, BOOL enable)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, enabled %#x.\n", iface, enable);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetDither(&device->IDirect3DRMDevice3_iface, enable);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_SetDither(IDirect3DRMDevice *iface, BOOL enable)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, enabled %#x.\n", iface, enable);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetDither(&device->IDirect3DRMDevice3_iface, enable);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_SetShades(IDirect3DRMDevice3 *iface, DWORD count)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, count %u stub!\n", iface, count);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_SetShades(IDirect3DRMDevice2 *iface, DWORD count)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, count %u.\n", iface, count);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetShades(&device->IDirect3DRMDevice3_iface, count);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_SetShades(IDirect3DRMDevice *iface, DWORD count)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, count %u.\n", iface, count);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetShades(&device->IDirect3DRMDevice3_iface, count);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_SetQuality(IDirect3DRMDevice3 *iface, D3DRMRENDERQUALITY quality)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, quality %u.\n", iface, quality);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
device->quality = quality;
|
|
|
|
|
|
|
|
return D3DRM_OK;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_SetQuality(IDirect3DRMDevice2 *iface, D3DRMRENDERQUALITY quality)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2015-07-22 09:58:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, quality %u.\n", iface, quality);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetQuality(&device->IDirect3DRMDevice3_iface, quality);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_SetQuality(IDirect3DRMDevice *iface, D3DRMRENDERQUALITY quality)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, quality %u.\n", iface, quality);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetQuality(&device->IDirect3DRMDevice3_iface, quality);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_SetTextureQuality(IDirect3DRMDevice3 *iface, D3DRMTEXTUREQUALITY quality)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, quality %u stub!\n", iface, quality);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_SetTextureQuality(IDirect3DRMDevice2 *iface, D3DRMTEXTUREQUALITY quality)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, quality %u.\n", iface, quality);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetTextureQuality(&device->IDirect3DRMDevice3_iface, quality);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_SetTextureQuality(IDirect3DRMDevice *iface, D3DRMTEXTUREQUALITY quality)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, quality %u.\n", iface, quality);
|
2012-01-12 23:16:02 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetTextureQuality(&device->IDirect3DRMDevice3_iface, quality);
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_GetViewports(IDirect3DRMDevice3 *iface, IDirect3DRMViewportArray **array)
|
2012-01-12 23:16:02 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p, array %p stub!\n", iface, array);
|
2015-07-22 09:58:11 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return E_NOTIMPL;
|
2012-01-12 23:16:02 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_GetViewports(IDirect3DRMDevice2 *iface, IDirect3DRMViewportArray **array)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2015-07-11 12:40:44 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, array %p.\n", iface, array);
|
2015-07-11 12:40:44 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetViewports(&device->IDirect3DRMDevice3_iface, array);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device1_GetViewports(IDirect3DRMDevice *iface, IDirect3DRMViewportArray **array)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2015-07-11 12:40:42 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p, array %p.\n", iface, array);
|
2013-10-06 15:33:08 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetViewports(&device->IDirect3DRMDevice3_iface, array);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static BOOL WINAPI d3drm_device3_GetDither(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2015-07-11 12:40:43 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return device->dither;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static BOOL WINAPI d3drm_device2_GetDither(IDirect3DRMDevice2 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetDither(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static BOOL WINAPI d3drm_device1_GetDither(IDirect3DRMDevice *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetDither(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device3_GetShades(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device2_GetShades(IDirect3DRMDevice2 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-06-17 17:02:53 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-06-17 17:02:53 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetShades(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device1_GetShades(IDirect3DRMDevice *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetShades(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device3_GetHeight(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-05-27 13:37:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return device->height;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device2_GetHeight(IDirect3DRMDevice2 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetHeight(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device1_GetHeight(IDirect3DRMDevice *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetHeight(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device3_GetWidth(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return device->width;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device2_GetWidth(IDirect3DRMDevice2 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetWidth(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device1_GetWidth(IDirect3DRMDevice *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-05-27 13:34:40 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetWidth(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device3_GetTrianglesDrawn(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device2_GetTrianglesDrawn(IDirect3DRMDevice2 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-05-27 13:35:01 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetTrianglesDrawn(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device1_GetTrianglesDrawn(IDirect3DRMDevice *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetTrianglesDrawn(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device3_GetWireframeOptions(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device2_GetWireframeOptions(IDirect3DRMDevice2 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetWireframeOptions(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device1_GetWireframeOptions(IDirect3DRMDevice *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetWireframeOptions(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static D3DRMRENDERQUALITY WINAPI d3drm_device3_GetQuality(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return device->quality;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static D3DRMRENDERQUALITY WINAPI d3drm_device2_GetQuality(IDirect3DRMDevice2 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetQuality(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static D3DRMRENDERQUALITY WINAPI d3drm_device1_GetQuality(IDirect3DRMDevice *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetQuality(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static D3DCOLORMODEL WINAPI d3drm_device3_GetColorModel(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static D3DCOLORMODEL WINAPI d3drm_device2_GetColorModel(IDirect3DRMDevice2 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetColorModel(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static D3DCOLORMODEL WINAPI d3drm_device1_GetColorModel(IDirect3DRMDevice *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-10 16:41:10 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
TRACE("iface %p stub!\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetColorModel(&device->IDirect3DRMDevice3_iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static D3DRMTEXTUREQUALITY WINAPI d3drm_device3_GetTextureQuality(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p stub!\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static D3DRMTEXTUREQUALITY WINAPI d3drm_device2_GetTextureQuality(IDirect3DRMDevice2 *iface)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetTextureQuality(&device->IDirect3DRMDevice3_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static D3DRMTEXTUREQUALITY WINAPI d3drm_device1_GetTextureQuality(IDirect3DRMDevice *iface)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetTextureQuality(&device->IDirect3DRMDevice3_iface);
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_GetDirect3DDevice(IDirect3DRMDevice3 *iface, IDirect3DDevice **d3d_device)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2015-08-06 21:47:54 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
|
|
|
TRACE("iface %p, d3d_device %p!\n", iface, d3d_device);
|
|
|
|
|
2015-08-20 14:46:40 +00:00
|
|
|
*d3d_device = device->device;
|
|
|
|
IDirect3DDevice_AddRef(*d3d_device);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2015-08-20 14:46:40 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_GetDirect3DDevice(IDirect3DRMDevice2 *iface, IDirect3DDevice **d3d_device)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
|
|
|
|
|
|
|
|
return d3drm_device3_GetDirect3DDevice(&device->IDirect3DRMDevice3_iface, d3d_device);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI d3drm_device1_GetDirect3DDevice(IDirect3DRMDevice *iface, IDirect3DDevice **d3d_device)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
|
|
|
|
|
|
|
|
return d3drm_device3_GetDirect3DDevice(&device->IDirect3DRMDevice3_iface, d3d_device);
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_InitFromD3D2(IDirect3DRMDevice3 *iface,
|
|
|
|
IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2016-07-15 15:25:46 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
|
|
|
IDirect3D *d3d1;
|
|
|
|
IDirect3DDevice *d3d_device1;
|
|
|
|
HRESULT hr;
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2016-07-15 15:25:46 +00:00
|
|
|
TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
|
|
|
|
|
|
|
|
if (!d3d || !d3d_device)
|
|
|
|
return D3DRMERR_BADVALUE;
|
|
|
|
|
|
|
|
if (FAILED(hr = IDirect3D2_QueryInterface(d3d, &IID_IDirect3D, (void **)&d3d1)))
|
|
|
|
return hr;
|
|
|
|
if (FAILED(hr = IDirect3DDevice2_QueryInterface(d3d_device, &IID_IDirect3DDevice, (void **)&d3d_device1)))
|
|
|
|
{
|
|
|
|
IDirect3D_Release(d3d1);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = d3drm_device_set_ddraw_device_d3d(device, d3d1, d3d_device1);
|
|
|
|
IDirect3D_Release(d3d1);
|
|
|
|
IDirect3DDevice_Release(d3d_device1);
|
|
|
|
|
|
|
|
return hr;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_InitFromD3D2(IDirect3DRMDevice2 *iface,
|
|
|
|
IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, d3d %p, d3d_device %p.\n", iface, d3d, d3d_device);
|
|
|
|
|
|
|
|
return d3drm_device3_InitFromD3D2(&device->IDirect3DRMDevice3_iface, d3d, d3d_device);
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_InitFromSurface(IDirect3DRMDevice3 *iface,
|
|
|
|
GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p, guid %s, ddraw %p, backbuffer %p stub!\n",
|
|
|
|
iface, debugstr_guid(guid), ddraw, backbuffer);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_InitFromSurface(IDirect3DRMDevice2 *iface,
|
|
|
|
GUID *guid, IDirectDraw *ddraw, IDirectDrawSurface *backbuffer)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, guid %s, ddraw %p, backbuffer %p.\n",
|
|
|
|
iface, debugstr_guid(guid), ddraw, backbuffer);
|
|
|
|
|
|
|
|
return d3drm_device3_InitFromSurface(&device->IDirect3DRMDevice3_iface, guid, ddraw, backbuffer);
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_SetRenderMode(IDirect3DRMDevice3 *iface, DWORD flags)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
TRACE("iface %p, flags %#x.\n", iface, flags);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
device->rendermode = flags;
|
2012-05-27 13:35:34 +00:00
|
|
|
|
|
|
|
return D3DRM_OK;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_SetRenderMode(IDirect3DRMDevice2 *iface, DWORD flags)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, flags %#x.\n", iface, flags);
|
|
|
|
|
|
|
|
return d3drm_device3_SetRenderMode(&device->IDirect3DRMDevice3_iface, flags);
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static DWORD WINAPI d3drm_device3_GetRenderMode(IDirect3DRMDevice3 *iface)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
return device->rendermode;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static DWORD WINAPI d3drm_device2_GetRenderMode(IDirect3DRMDevice2 *iface)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
|
|
|
return d3drm_device3_GetRenderMode(&device->IDirect3DRMDevice3_iface);
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_GetDirect3DDevice2(IDirect3DRMDevice3 *iface, IDirect3DDevice2 **d3d_device)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2015-08-06 22:20:37 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
|
|
|
|
|
2016-07-15 10:16:06 +00:00
|
|
|
if (FAILED(IDirect3DDevice_QueryInterface(device->device, &IID_IDirect3DDevice2, (void**)d3d_device)))
|
|
|
|
return D3DRMERR_BADOBJECT;
|
2015-08-20 14:46:41 +00:00
|
|
|
|
|
|
|
return D3DRM_OK;
|
2012-01-15 16:01:09 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static HRESULT WINAPI d3drm_device2_GetDirect3DDevice2(IDirect3DRMDevice2 *iface, IDirect3DDevice2 **d3d_device)
|
|
|
|
{
|
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface);
|
|
|
|
|
|
|
|
TRACE("iface %p, d3d_device %p.\n", iface, d3d_device);
|
|
|
|
|
2016-07-15 10:16:06 +00:00
|
|
|
IDirect3DDevice_QueryInterface(device->device, &IID_IDirect3DDevice2, (void**)d3d_device);
|
|
|
|
|
|
|
|
/* d3drm returns D3DRM_OK even if the call fails. */
|
|
|
|
return D3DRM_OK;
|
2016-07-10 16:41:10 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_FindPreferredTextureFormat(IDirect3DRMDevice3 *iface,
|
|
|
|
DWORD bitdepths, DWORD flags, DDPIXELFORMAT *pf)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p, bitdepths %u, flags %#x, pf %p stub!\n", iface, bitdepths, flags, pf);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_RenderStateChange(IDirect3DRMDevice3 *iface,
|
|
|
|
D3DRENDERSTATETYPE state, DWORD value, DWORD flags)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p, state %#x, value %#x, flags %#x stub!\n", iface, state, value, flags);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_LightStateChange(IDirect3DRMDevice3 *iface,
|
|
|
|
D3DLIGHTSTATETYPE state, DWORD value, DWORD flags)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p, state %#x, value %#x, flags %#x stub!\n", iface, state, value, flags);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_GetStateChangeOptions(IDirect3DRMDevice3 *iface,
|
2013-09-10 07:32:35 +00:00
|
|
|
DWORD state_class, DWORD state_idx, DWORD *flags)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-09-10 07:32:35 +00:00
|
|
|
FIXME("iface %p, state_class %#x, state_idx %#x, flags %p stub!\n",
|
|
|
|
iface, state_class, state_idx, flags);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device3_SetStateChangeOptions(IDirect3DRMDevice3 *iface,
|
|
|
|
DWORD state_class, DWORD state_idx, DWORD flags)
|
2012-01-15 16:01:09 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p, state_class %#x, state_idx %#x, flags %#x stub!\n",
|
|
|
|
iface, state_class, state_idx, flags);
|
2012-01-15 16:01:09 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static const struct IDirect3DRMDevice3Vtbl d3drm_device3_vtbl =
|
|
|
|
{
|
|
|
|
d3drm_device3_QueryInterface,
|
|
|
|
d3drm_device3_AddRef,
|
|
|
|
d3drm_device3_Release,
|
|
|
|
d3drm_device3_Clone,
|
|
|
|
d3drm_device3_AddDestroyCallback,
|
|
|
|
d3drm_device3_DeleteDestroyCallback,
|
|
|
|
d3drm_device3_SetAppData,
|
|
|
|
d3drm_device3_GetAppData,
|
|
|
|
d3drm_device3_SetName,
|
|
|
|
d3drm_device3_GetName,
|
|
|
|
d3drm_device3_GetClassName,
|
|
|
|
d3drm_device3_Init,
|
|
|
|
d3drm_device3_InitFromD3D,
|
|
|
|
d3drm_device3_InitFromClipper,
|
|
|
|
d3drm_device3_Update,
|
|
|
|
d3drm_device3_AddUpdateCallback,
|
|
|
|
d3drm_device3_DeleteUpdateCallback,
|
|
|
|
d3drm_device3_SetBufferCount,
|
|
|
|
d3drm_device3_GetBufferCount,
|
|
|
|
d3drm_device3_SetDither,
|
|
|
|
d3drm_device3_SetShades,
|
|
|
|
d3drm_device3_SetQuality,
|
|
|
|
d3drm_device3_SetTextureQuality,
|
|
|
|
d3drm_device3_GetViewports,
|
|
|
|
d3drm_device3_GetDither,
|
|
|
|
d3drm_device3_GetShades,
|
|
|
|
d3drm_device3_GetHeight,
|
|
|
|
d3drm_device3_GetWidth,
|
|
|
|
d3drm_device3_GetTrianglesDrawn,
|
|
|
|
d3drm_device3_GetWireframeOptions,
|
|
|
|
d3drm_device3_GetQuality,
|
|
|
|
d3drm_device3_GetColorModel,
|
|
|
|
d3drm_device3_GetTextureQuality,
|
|
|
|
d3drm_device3_GetDirect3DDevice,
|
|
|
|
d3drm_device3_InitFromD3D2,
|
|
|
|
d3drm_device3_InitFromSurface,
|
|
|
|
d3drm_device3_SetRenderMode,
|
|
|
|
d3drm_device3_GetRenderMode,
|
|
|
|
d3drm_device3_GetDirect3DDevice2,
|
|
|
|
d3drm_device3_FindPreferredTextureFormat,
|
|
|
|
d3drm_device3_RenderStateChange,
|
|
|
|
d3drm_device3_LightStateChange,
|
|
|
|
d3drm_device3_GetStateChangeOptions,
|
|
|
|
d3drm_device3_SetStateChangeOptions,
|
2012-01-15 16:01:09 +00:00
|
|
|
};
|
2012-01-17 21:56:13 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl =
|
|
|
|
{
|
|
|
|
d3drm_device2_QueryInterface,
|
|
|
|
d3drm_device2_AddRef,
|
|
|
|
d3drm_device2_Release,
|
|
|
|
d3drm_device2_Clone,
|
|
|
|
d3drm_device2_AddDestroyCallback,
|
|
|
|
d3drm_device2_DeleteDestroyCallback,
|
|
|
|
d3drm_device2_SetAppData,
|
|
|
|
d3drm_device2_GetAppData,
|
|
|
|
d3drm_device2_SetName,
|
|
|
|
d3drm_device2_GetName,
|
|
|
|
d3drm_device2_GetClassName,
|
|
|
|
d3drm_device2_Init,
|
|
|
|
d3drm_device2_InitFromD3D,
|
|
|
|
d3drm_device2_InitFromClipper,
|
|
|
|
d3drm_device2_Update,
|
|
|
|
d3drm_device2_AddUpdateCallback,
|
|
|
|
d3drm_device2_DeleteUpdateCallback,
|
|
|
|
d3drm_device2_SetBufferCount,
|
|
|
|
d3drm_device2_GetBufferCount,
|
|
|
|
d3drm_device2_SetDither,
|
|
|
|
d3drm_device2_SetShades,
|
|
|
|
d3drm_device2_SetQuality,
|
|
|
|
d3drm_device2_SetTextureQuality,
|
|
|
|
d3drm_device2_GetViewports,
|
|
|
|
d3drm_device2_GetDither,
|
|
|
|
d3drm_device2_GetShades,
|
|
|
|
d3drm_device2_GetHeight,
|
|
|
|
d3drm_device2_GetWidth,
|
|
|
|
d3drm_device2_GetTrianglesDrawn,
|
|
|
|
d3drm_device2_GetWireframeOptions,
|
|
|
|
d3drm_device2_GetQuality,
|
|
|
|
d3drm_device2_GetColorModel,
|
|
|
|
d3drm_device2_GetTextureQuality,
|
|
|
|
d3drm_device2_GetDirect3DDevice,
|
|
|
|
d3drm_device2_InitFromD3D2,
|
|
|
|
d3drm_device2_InitFromSurface,
|
|
|
|
d3drm_device2_SetRenderMode,
|
|
|
|
d3drm_device2_GetRenderMode,
|
|
|
|
d3drm_device2_GetDirect3DDevice2,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct IDirect3DRMDeviceVtbl d3drm_device1_vtbl =
|
|
|
|
{
|
|
|
|
d3drm_device1_QueryInterface,
|
|
|
|
d3drm_device1_AddRef,
|
|
|
|
d3drm_device1_Release,
|
|
|
|
d3drm_device1_Clone,
|
|
|
|
d3drm_device1_AddDestroyCallback,
|
|
|
|
d3drm_device1_DeleteDestroyCallback,
|
|
|
|
d3drm_device1_SetAppData,
|
|
|
|
d3drm_device1_GetAppData,
|
|
|
|
d3drm_device1_SetName,
|
|
|
|
d3drm_device1_GetName,
|
|
|
|
d3drm_device1_GetClassName,
|
|
|
|
d3drm_device1_Init,
|
|
|
|
d3drm_device1_InitFromD3D,
|
|
|
|
d3drm_device1_InitFromClipper,
|
|
|
|
d3drm_device1_Update,
|
|
|
|
d3drm_device1_AddUpdateCallback,
|
|
|
|
d3drm_device1_DeleteUpdateCallback,
|
|
|
|
d3drm_device1_SetBufferCount,
|
|
|
|
d3drm_device1_GetBufferCount,
|
|
|
|
d3drm_device1_SetDither,
|
|
|
|
d3drm_device1_SetShades,
|
|
|
|
d3drm_device1_SetQuality,
|
|
|
|
d3drm_device1_SetTextureQuality,
|
|
|
|
d3drm_device1_GetViewports,
|
|
|
|
d3drm_device1_GetDither,
|
|
|
|
d3drm_device1_GetShades,
|
|
|
|
d3drm_device1_GetHeight,
|
|
|
|
d3drm_device1_GetWidth,
|
|
|
|
d3drm_device1_GetTrianglesDrawn,
|
|
|
|
d3drm_device1_GetWireframeOptions,
|
|
|
|
d3drm_device1_GetQuality,
|
|
|
|
d3drm_device1_GetColorModel,
|
|
|
|
d3drm_device1_GetTextureQuality,
|
|
|
|
d3drm_device1_GetDirect3DDevice,
|
|
|
|
};
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_QueryInterface(IDirect3DRMWinDevice *iface, REFIID riid, void **out)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
|
|
|
|
|
2015-07-11 12:40:44 +00:00
|
|
|
return d3drm_device3_QueryInterface(&device->IDirect3DRMDevice3_iface, riid, out);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static ULONG WINAPI d3drm_device_win_AddRef(IDirect3DRMWinDevice *iface)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
2015-07-11 12:40:42 +00:00
|
|
|
return d3drm_device3_AddRef(&device->IDirect3DRMDevice3_iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static ULONG WINAPI d3drm_device_win_Release(IDirect3DRMWinDevice *iface)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
2015-07-11 12:40:43 +00:00
|
|
|
return d3drm_device3_Release(&device->IDirect3DRMDevice3_iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_Clone(IDirect3DRMWinDevice *iface,
|
2013-08-20 08:20:13 +00:00
|
|
|
IUnknown *outer, REFIID iid, void **out)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2015-07-22 09:58:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p, outer %p, iid %s, out %p\n", iface, outer, debugstr_guid(iid), out);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_Clone(&device->IDirect3DRMDevice3_iface, outer, iid, out);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_AddDestroyCallback(IDirect3DRMWinDevice *iface,
|
2013-09-09 08:26:21 +00:00
|
|
|
D3DRMOBJECTCALLBACK cb, void *ctx)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-09-09 08:26:21 +00:00
|
|
|
FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_DeleteDestroyCallback(IDirect3DRMWinDevice *iface,
|
2013-09-09 08:26:21 +00:00
|
|
|
D3DRMOBJECTCALLBACK cb, void *ctx)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-09-09 08:26:21 +00:00
|
|
|
FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_SetAppData(IDirect3DRMWinDevice *iface, DWORD data)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2015-07-22 09:58:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p, data %#x.\n", iface, data);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetAppData(&device->IDirect3DRMDevice3_iface, data);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static DWORD WINAPI d3drm_device_win_GetAppData(IDirect3DRMWinDevice *iface)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2015-07-22 09:58:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p.\n", iface);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetAppData(&device->IDirect3DRMDevice3_iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_SetName(IDirect3DRMWinDevice *iface, const char *name)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2015-07-22 09:58:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_SetName(&device->IDirect3DRMDevice3_iface, name);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_GetName(IDirect3DRMWinDevice *iface, DWORD *size, char *name)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2015-07-22 09:58:11 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2015-07-22 09:58:11 +00:00
|
|
|
TRACE("iface %p, size %p, name %p stub!\n", iface, size, name);
|
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetName(&device->IDirect3DRMDevice3_iface, size, name);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_GetClassName(IDirect3DRMWinDevice *iface, DWORD *size, char *name)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *device = impl_from_IDirect3DRMWinDevice(iface);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2013-09-09 08:26:20 +00:00
|
|
|
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2016-07-10 16:41:10 +00:00
|
|
|
return d3drm_device3_GetClassName(&device->IDirect3DRMDevice3_iface, size, name);
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_HandlePaint(IDirect3DRMWinDevice *iface, HDC dc)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p, dc %p stub!\n", iface, dc);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2012-06-07 11:55:03 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static HRESULT WINAPI d3drm_device_win_HandleActivate(IDirect3DRMWinDevice *iface, WORD wparam)
|
2012-01-17 21:56:24 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
FIXME("iface %p, wparam %#x stub!\n", iface, wparam);
|
2012-01-17 21:56:24 +00:00
|
|
|
|
2012-05-27 13:37:40 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-17 21:56:24 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
static const struct IDirect3DRMWinDeviceVtbl d3drm_device_win_vtbl =
|
|
|
|
{
|
|
|
|
d3drm_device_win_QueryInterface,
|
|
|
|
d3drm_device_win_AddRef,
|
|
|
|
d3drm_device_win_Release,
|
|
|
|
d3drm_device_win_Clone,
|
|
|
|
d3drm_device_win_AddDestroyCallback,
|
|
|
|
d3drm_device_win_DeleteDestroyCallback,
|
|
|
|
d3drm_device_win_SetAppData,
|
|
|
|
d3drm_device_win_GetAppData,
|
|
|
|
d3drm_device_win_SetName,
|
|
|
|
d3drm_device_win_GetName,
|
|
|
|
d3drm_device_win_GetClassName,
|
|
|
|
d3drm_device_win_HandlePaint,
|
|
|
|
d3drm_device_win_HandleActivate,
|
2012-01-17 21:56:24 +00:00
|
|
|
};
|
|
|
|
|
2016-07-12 17:07:24 +00:00
|
|
|
HRESULT d3drm_device_create(struct d3drm_device **device, IDirect3DRM *d3drm)
|
2012-01-17 21:56:13 +00:00
|
|
|
{
|
2013-10-06 15:33:08 +00:00
|
|
|
struct d3drm_device *object;
|
2012-01-17 21:56:13 +00:00
|
|
|
|
2016-07-12 17:07:24 +00:00
|
|
|
TRACE("device %p, d3drm %p.\n", device, d3drm);
|
2012-01-17 21:56:13 +00:00
|
|
|
|
2013-10-06 15:33:08 +00:00
|
|
|
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
2012-01-17 21:56:13 +00:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2015-07-22 09:58:12 +00:00
|
|
|
object->IDirect3DRMDevice_iface.lpVtbl = &d3drm_device1_vtbl;
|
2013-10-06 15:33:08 +00:00
|
|
|
object->IDirect3DRMDevice2_iface.lpVtbl = &d3drm_device2_vtbl;
|
|
|
|
object->IDirect3DRMDevice3_iface.lpVtbl = &d3drm_device3_vtbl;
|
|
|
|
object->IDirect3DRMWinDevice_iface.lpVtbl = &d3drm_device_win_vtbl;
|
2016-07-12 17:07:24 +00:00
|
|
|
object->d3drm = d3drm;
|
2016-07-10 16:41:11 +00:00
|
|
|
d3drm_object_init(&object->obj);
|
2012-01-17 21:56:13 +00:00
|
|
|
|
2016-07-12 17:07:24 +00:00
|
|
|
*device = object;
|
2012-01-17 21:56:13 +00:00
|
|
|
|
2015-08-06 21:47:51 +00:00
|
|
|
return D3DRM_OK;
|
2012-01-17 21:56:13 +00:00
|
|
|
}
|