2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/port.h"
23 #include "d3d10core_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core
);
27 /* IUnknown methods */
29 static HRESULT STDMETHODCALLTYPE
d3d10_rendertarget_view_QueryInterface(ID3D10RenderTargetView
*iface
,
30 REFIID riid
, void **object
)
32 TRACE("iface %p, riid %s, object %p\n", iface
, debugstr_guid(riid
), object
);
34 if (IsEqualGUID(riid
, &IID_ID3D10RenderTargetView
)
35 || IsEqualGUID(riid
, &IID_ID3D10View
)
36 || IsEqualGUID(riid
, &IID_ID3D10DeviceChild
)
37 || IsEqualGUID(riid
, &IID_IUnknown
))
39 IUnknown_AddRef(iface
);
44 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
50 static ULONG STDMETHODCALLTYPE
d3d10_rendertarget_view_AddRef(ID3D10RenderTargetView
*iface
)
52 struct d3d10_rendertarget_view
*This
= (struct d3d10_rendertarget_view
*)iface
;
53 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
55 TRACE("%p increasing refcount to %u\n", This
, refcount
);
60 static ULONG STDMETHODCALLTYPE
d3d10_rendertarget_view_Release(ID3D10RenderTargetView
*iface
)
62 struct d3d10_rendertarget_view
*This
= (struct d3d10_rendertarget_view
*)iface
;
63 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
65 TRACE("%p decreasing refcount to %u\n", This
, refcount
);
69 ID3D10Resource_Release(This
->resource
);
70 HeapFree(GetProcessHeap(), 0, This
);
76 /* ID3D10DeviceChild methods */
78 static void STDMETHODCALLTYPE
d3d10_rendertarget_view_GetDevice(ID3D10RenderTargetView
*iface
, ID3D10Device
**device
)
80 FIXME("iface %p, device %p stub!\n", iface
, device
);
83 static HRESULT STDMETHODCALLTYPE
d3d10_rendertarget_view_GetPrivateData(ID3D10RenderTargetView
*iface
,
84 REFGUID guid
, UINT
*data_size
, void *data
)
86 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
87 iface
, debugstr_guid(guid
), data_size
, data
);
92 static HRESULT STDMETHODCALLTYPE
d3d10_rendertarget_view_SetPrivateData(ID3D10RenderTargetView
*iface
,
93 REFGUID guid
, UINT data_size
, const void *data
)
95 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
96 iface
, debugstr_guid(guid
), data_size
, data
);
101 static HRESULT STDMETHODCALLTYPE
d3d10_rendertarget_view_SetPrivateDataInterface(ID3D10RenderTargetView
*iface
,
102 REFGUID guid
, const IUnknown
*data
)
104 FIXME("iface %p, guid %s, data %p stub!\n", iface
, debugstr_guid(guid
), data
);
109 /* ID3D10View methods */
111 static void STDMETHODCALLTYPE
d3d10_rendertarget_view_GetResource(ID3D10RenderTargetView
*iface
,
112 ID3D10Resource
**resource
)
114 struct d3d10_rendertarget_view
*This
= (struct d3d10_rendertarget_view
*)iface
;
116 TRACE("iface %p, resource %p\n", iface
, resource
);
118 ID3D10Resource_AddRef(This
->resource
);
119 *resource
= This
->resource
;
122 /* ID3D10RenderTargetView methods */
124 static void STDMETHODCALLTYPE
d3d10_rendertarget_view_GetDesc(ID3D10RenderTargetView
* iface
,
125 D3D10_RENDER_TARGET_VIEW_DESC
*desc
)
127 struct d3d10_rendertarget_view
*This
= (struct d3d10_rendertarget_view
*)iface
;
129 TRACE("iface %p, desc %p\n", iface
, desc
);
134 const struct ID3D10RenderTargetViewVtbl d3d10_rendertarget_view_vtbl
=
136 /* IUnknown methods */
137 d3d10_rendertarget_view_QueryInterface
,
138 d3d10_rendertarget_view_AddRef
,
139 d3d10_rendertarget_view_Release
,
140 /* ID3D10DeviceChild methods */
141 d3d10_rendertarget_view_GetDevice
,
142 d3d10_rendertarget_view_GetPrivateData
,
143 d3d10_rendertarget_view_SetPrivateData
,
144 d3d10_rendertarget_view_SetPrivateDataInterface
,
145 /* ID3D10View methods */
146 d3d10_rendertarget_view_GetResource
,
147 /* ID3D10RenderTargetView methods */
148 d3d10_rendertarget_view_GetDesc
,