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 static inline struct d3d10_blend_state
*impl_from_ID3D10BlendState(ID3D10BlendState
*iface
)
29 return CONTAINING_RECORD(iface
, struct d3d10_blend_state
, ID3D10BlendState_iface
);
32 /* IUnknown methods */
34 static HRESULT STDMETHODCALLTYPE
d3d10_blend_state_QueryInterface(ID3D10BlendState
*iface
,
35 REFIID riid
, void **object
)
37 TRACE("iface %p, riid %s, object %p.\n", iface
, debugstr_guid(riid
), object
);
39 if (IsEqualGUID(riid
, &IID_ID3D10BlendState
)
40 || IsEqualGUID(riid
, &IID_ID3D10DeviceChild
)
41 || IsEqualGUID(riid
, &IID_IUnknown
))
43 IUnknown_AddRef(iface
);
48 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
54 static ULONG STDMETHODCALLTYPE
d3d10_blend_state_AddRef(ID3D10BlendState
*iface
)
56 struct d3d10_blend_state
*This
= impl_from_ID3D10BlendState(iface
);
57 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
59 TRACE("%p increasing refcount to %u.\n", This
, refcount
);
64 static ULONG STDMETHODCALLTYPE
d3d10_blend_state_Release(ID3D10BlendState
*iface
)
66 struct d3d10_blend_state
*This
= impl_from_ID3D10BlendState(iface
);
67 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
69 TRACE("%p decreasing refcount to %u.\n", This
, refcount
);
73 HeapFree(GetProcessHeap(), 0, This
);
79 /* ID3D10DeviceChild methods */
81 static void STDMETHODCALLTYPE
d3d10_blend_state_GetDevice(ID3D10BlendState
*iface
, ID3D10Device
**device
)
83 FIXME("iface %p, device %p stub!\n", iface
, device
);
86 static HRESULT STDMETHODCALLTYPE
d3d10_blend_state_GetPrivateData(ID3D10BlendState
*iface
,
87 REFGUID guid
, UINT
*data_size
, void *data
)
89 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
90 iface
, debugstr_guid(guid
), data_size
, data
);
95 static HRESULT STDMETHODCALLTYPE
d3d10_blend_state_SetPrivateData(ID3D10BlendState
*iface
,
96 REFGUID guid
, UINT data_size
, const void *data
)
98 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
99 iface
, debugstr_guid(guid
), data_size
, data
);
104 static HRESULT STDMETHODCALLTYPE
d3d10_blend_state_SetPrivateDataInterface(ID3D10BlendState
*iface
,
105 REFGUID guid
, const IUnknown
*data
)
107 FIXME("iface %p, guid %s, data %p stub!\n", iface
, debugstr_guid(guid
), data
);
112 /* ID3D10BlendState methods */
114 static void STDMETHODCALLTYPE
d3d10_blend_state_GetDesc(ID3D10BlendState
*iface
,
115 D3D10_BLEND_DESC
*desc
)
117 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
120 static const struct ID3D10BlendStateVtbl d3d10_blend_state_vtbl
=
122 /* IUnknown methods */
123 d3d10_blend_state_QueryInterface
,
124 d3d10_blend_state_AddRef
,
125 d3d10_blend_state_Release
,
126 /* ID3D10DeviceChild methods */
127 d3d10_blend_state_GetDevice
,
128 d3d10_blend_state_GetPrivateData
,
129 d3d10_blend_state_SetPrivateData
,
130 d3d10_blend_state_SetPrivateDataInterface
,
131 /* ID3D10BlendState methods */
132 d3d10_blend_state_GetDesc
,
135 HRESULT
d3d10_blend_state_init(struct d3d10_blend_state
*state
)
137 state
->ID3D10BlendState_iface
.lpVtbl
= &d3d10_blend_state_vtbl
;
143 static inline struct d3d10_depthstencil_state
*impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState
*iface
)
145 return CONTAINING_RECORD(iface
, struct d3d10_depthstencil_state
, ID3D10DepthStencilState_iface
);
148 /* IUnknown methods */
150 static HRESULT STDMETHODCALLTYPE
d3d10_depthstencil_state_QueryInterface(ID3D10DepthStencilState
*iface
,
151 REFIID riid
, void **object
)
153 TRACE("iface %p, riid %s, object %p.\n", iface
, debugstr_guid(riid
), object
);
155 if (IsEqualGUID(riid
, &IID_ID3D10DepthStencilState
)
156 || IsEqualGUID(riid
, &IID_ID3D10DeviceChild
)
157 || IsEqualGUID(riid
, &IID_IUnknown
))
159 IUnknown_AddRef(iface
);
164 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
167 return E_NOINTERFACE
;
170 static ULONG STDMETHODCALLTYPE
d3d10_depthstencil_state_AddRef(ID3D10DepthStencilState
*iface
)
172 struct d3d10_depthstencil_state
*This
= impl_from_ID3D10DepthStencilState(iface
);
173 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
175 TRACE("%p increasing refcount to %u.\n", This
, refcount
);
180 static ULONG STDMETHODCALLTYPE
d3d10_depthstencil_state_Release(ID3D10DepthStencilState
*iface
)
182 struct d3d10_depthstencil_state
*This
= impl_from_ID3D10DepthStencilState(iface
);
183 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
185 TRACE("%p decreasing refcount to %u.\n", This
, refcount
);
189 HeapFree(GetProcessHeap(), 0, This
);
195 /* ID3D10DeviceChild methods */
197 static void STDMETHODCALLTYPE
d3d10_depthstencil_state_GetDevice(ID3D10DepthStencilState
*iface
, ID3D10Device
**device
)
199 FIXME("iface %p, device %p stub!\n", iface
, device
);
202 static HRESULT STDMETHODCALLTYPE
d3d10_depthstencil_state_GetPrivateData(ID3D10DepthStencilState
*iface
,
203 REFGUID guid
, UINT
*data_size
, void *data
)
205 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
206 iface
, debugstr_guid(guid
), data_size
, data
);
211 static HRESULT STDMETHODCALLTYPE
d3d10_depthstencil_state_SetPrivateData(ID3D10DepthStencilState
*iface
,
212 REFGUID guid
, UINT data_size
, const void *data
)
214 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
215 iface
, debugstr_guid(guid
), data_size
, data
);
220 static HRESULT STDMETHODCALLTYPE
d3d10_depthstencil_state_SetPrivateDataInterface(ID3D10DepthStencilState
*iface
,
221 REFGUID guid
, const IUnknown
*data
)
223 FIXME("iface %p, guid %s, data %p stub!\n", iface
, debugstr_guid(guid
), data
);
228 /* ID3D10DepthStencilState methods */
230 static void STDMETHODCALLTYPE
d3d10_depthstencil_state_GetDesc(ID3D10DepthStencilState
*iface
,
231 D3D10_DEPTH_STENCIL_DESC
*desc
)
233 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
236 static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl
=
238 /* IUnknown methods */
239 d3d10_depthstencil_state_QueryInterface
,
240 d3d10_depthstencil_state_AddRef
,
241 d3d10_depthstencil_state_Release
,
242 /* ID3D10DeviceChild methods */
243 d3d10_depthstencil_state_GetDevice
,
244 d3d10_depthstencil_state_GetPrivateData
,
245 d3d10_depthstencil_state_SetPrivateData
,
246 d3d10_depthstencil_state_SetPrivateDataInterface
,
247 /* ID3D10DepthStencilState methods */
248 d3d10_depthstencil_state_GetDesc
,
251 HRESULT
d3d10_depthstencil_state_init(struct d3d10_depthstencil_state
*state
)
253 state
->ID3D10DepthStencilState_iface
.lpVtbl
= &d3d10_depthstencil_state_vtbl
;
259 static inline struct d3d10_rasterizer_state
*impl_from_ID3D10RasterizerState(ID3D10RasterizerState
*iface
)
261 return CONTAINING_RECORD(iface
, struct d3d10_rasterizer_state
, ID3D10RasterizerState_iface
);
264 /* IUnknown methods */
266 static HRESULT STDMETHODCALLTYPE
d3d10_rasterizer_state_QueryInterface(ID3D10RasterizerState
*iface
,
267 REFIID riid
, void **object
)
269 TRACE("iface %p, riid %s, object %p.\n", iface
, debugstr_guid(riid
), object
);
271 if (IsEqualGUID(riid
, &IID_ID3D10RasterizerState
)
272 || IsEqualGUID(riid
, &IID_ID3D10DeviceChild
)
273 || IsEqualGUID(riid
, &IID_IUnknown
))
275 IUnknown_AddRef(iface
);
280 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
283 return E_NOINTERFACE
;
286 static ULONG STDMETHODCALLTYPE
d3d10_rasterizer_state_AddRef(ID3D10RasterizerState
*iface
)
288 struct d3d10_rasterizer_state
*This
= impl_from_ID3D10RasterizerState(iface
);
289 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
291 TRACE("%p increasing refcount to %u.\n", This
, refcount
);
296 static ULONG STDMETHODCALLTYPE
d3d10_rasterizer_state_Release(ID3D10RasterizerState
*iface
)
298 struct d3d10_rasterizer_state
*This
= impl_from_ID3D10RasterizerState(iface
);
299 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
301 TRACE("%p decreasing refcount to %u.\n", This
, refcount
);
305 HeapFree(GetProcessHeap(), 0, This
);
311 /* ID3D10DeviceChild methods */
313 static void STDMETHODCALLTYPE
d3d10_rasterizer_state_GetDevice(ID3D10RasterizerState
*iface
, ID3D10Device
**device
)
315 FIXME("iface %p, device %p stub!\n", iface
, device
);
318 static HRESULT STDMETHODCALLTYPE
d3d10_rasterizer_state_GetPrivateData(ID3D10RasterizerState
*iface
,
319 REFGUID guid
, UINT
*data_size
, void *data
)
321 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
322 iface
, debugstr_guid(guid
), data_size
, data
);
327 static HRESULT STDMETHODCALLTYPE
d3d10_rasterizer_state_SetPrivateData(ID3D10RasterizerState
*iface
,
328 REFGUID guid
, UINT data_size
, const void *data
)
330 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
331 iface
, debugstr_guid(guid
), data_size
, data
);
336 static HRESULT STDMETHODCALLTYPE
d3d10_rasterizer_state_SetPrivateDataInterface(ID3D10RasterizerState
*iface
,
337 REFGUID guid
, const IUnknown
*data
)
339 FIXME("iface %p, guid %s, data %p stub!\n", iface
, debugstr_guid(guid
), data
);
344 /* ID3D10RasterizerState methods */
346 static void STDMETHODCALLTYPE
d3d10_rasterizer_state_GetDesc(ID3D10RasterizerState
*iface
,
347 D3D10_RASTERIZER_DESC
*desc
)
349 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
352 static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl
=
354 /* IUnknown methods */
355 d3d10_rasterizer_state_QueryInterface
,
356 d3d10_rasterizer_state_AddRef
,
357 d3d10_rasterizer_state_Release
,
358 /* ID3D10DeviceChild methods */
359 d3d10_rasterizer_state_GetDevice
,
360 d3d10_rasterizer_state_GetPrivateData
,
361 d3d10_rasterizer_state_SetPrivateData
,
362 d3d10_rasterizer_state_SetPrivateDataInterface
,
363 /* ID3D10RasterizerState methods */
364 d3d10_rasterizer_state_GetDesc
,
367 HRESULT
d3d10_rasterizer_state_init(struct d3d10_rasterizer_state
*state
)
369 state
->ID3D10RasterizerState_iface
.lpVtbl
= &d3d10_rasterizer_state_vtbl
;
375 static inline struct d3d10_sampler_state
*impl_from_ID3D10SamplerState(ID3D10SamplerState
*iface
)
377 return CONTAINING_RECORD(iface
, struct d3d10_sampler_state
, ID3D10SamplerState_iface
);
380 /* IUnknown methods */
382 static HRESULT STDMETHODCALLTYPE
d3d10_sampler_state_QueryInterface(ID3D10SamplerState
*iface
,
383 REFIID riid
, void **object
)
385 TRACE("iface %p, riid %s, object %p.\n", iface
, debugstr_guid(riid
), object
);
387 if (IsEqualGUID(riid
, &IID_ID3D10SamplerState
)
388 || IsEqualGUID(riid
, &IID_ID3D10DeviceChild
)
389 || IsEqualGUID(riid
, &IID_IUnknown
))
391 IUnknown_AddRef(iface
);
396 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
399 return E_NOINTERFACE
;
402 static ULONG STDMETHODCALLTYPE
d3d10_sampler_state_AddRef(ID3D10SamplerState
*iface
)
404 struct d3d10_sampler_state
*This
= impl_from_ID3D10SamplerState(iface
);
405 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
407 TRACE("%p increasing refcount to %u.\n", This
, refcount
);
412 static ULONG STDMETHODCALLTYPE
d3d10_sampler_state_Release(ID3D10SamplerState
*iface
)
414 struct d3d10_sampler_state
*This
= impl_from_ID3D10SamplerState(iface
);
415 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
417 TRACE("%p decreasing refcount to %u.\n", This
, refcount
);
421 HeapFree(GetProcessHeap(), 0, This
);
427 /* ID3D10DeviceChild methods */
429 static void STDMETHODCALLTYPE
d3d10_sampler_state_GetDevice(ID3D10SamplerState
*iface
, ID3D10Device
**device
)
431 FIXME("iface %p, device %p stub!\n", iface
, device
);
434 static HRESULT STDMETHODCALLTYPE
d3d10_sampler_state_GetPrivateData(ID3D10SamplerState
*iface
,
435 REFGUID guid
, UINT
*data_size
, void *data
)
437 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
438 iface
, debugstr_guid(guid
), data_size
, data
);
443 static HRESULT STDMETHODCALLTYPE
d3d10_sampler_state_SetPrivateData(ID3D10SamplerState
*iface
,
444 REFGUID guid
, UINT data_size
, const void *data
)
446 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
447 iface
, debugstr_guid(guid
), data_size
, data
);
452 static HRESULT STDMETHODCALLTYPE
d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState
*iface
,
453 REFGUID guid
, const IUnknown
*data
)
455 FIXME("iface %p, guid %s, data %p stub!\n", iface
, debugstr_guid(guid
), data
);
460 /* ID3D10SamplerState methods */
462 static void STDMETHODCALLTYPE
d3d10_sampler_state_GetDesc(ID3D10SamplerState
*iface
,
463 D3D10_SAMPLER_DESC
*desc
)
465 FIXME("iface %p, desc %p stub!\n", iface
, desc
);
468 static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl
=
470 /* IUnknown methods */
471 d3d10_sampler_state_QueryInterface
,
472 d3d10_sampler_state_AddRef
,
473 d3d10_sampler_state_Release
,
474 /* ID3D10DeviceChild methods */
475 d3d10_sampler_state_GetDevice
,
476 d3d10_sampler_state_GetPrivateData
,
477 d3d10_sampler_state_SetPrivateData
,
478 d3d10_sampler_state_SetPrivateDataInterface
,
479 /* ID3D10SamplerState methods */
480 d3d10_sampler_state_GetDesc
,
483 HRESULT
d3d10_sampler_state_init(struct d3d10_sampler_state
*state
)
485 state
->ID3D10SamplerState_iface
.lpVtbl
= &d3d10_sampler_state_vtbl
;