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 struct d3d10_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface)
147 assert(iface->lpVtbl == &d3d10_blend_state_vtbl);
149 return impl_from_ID3D10BlendState(iface);
152 static inline struct d3d10_depthstencil_state *impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface)
154 return CONTAINING_RECORD(iface, struct d3d10_depthstencil_state, ID3D10DepthStencilState_iface);
157 /* IUnknown methods */
159 static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_QueryInterface(ID3D10DepthStencilState *iface,
160 REFIID riid, void **object)
162 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
164 if (IsEqualGUID(riid, &IID_ID3D10DepthStencilState)
165 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
166 || IsEqualGUID(riid, &IID_IUnknown))
168 IUnknown_AddRef(iface);
173 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
176 return E_NOINTERFACE;
179 static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_AddRef(ID3D10DepthStencilState *iface)
181 struct d3d10_depthstencil_state *This = impl_from_ID3D10DepthStencilState(iface);
182 ULONG refcount = InterlockedIncrement(&This->refcount);
184 TRACE("%p increasing refcount to %u.\n", This, refcount);
189 static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_Release(ID3D10DepthStencilState *iface)
191 struct d3d10_depthstencil_state *This = impl_from_ID3D10DepthStencilState(iface);
192 ULONG refcount = InterlockedDecrement(&This->refcount);
194 TRACE("%p decreasing refcount to %u.\n", This, refcount);
198 HeapFree(GetProcessHeap(), 0, This);
204 /* ID3D10DeviceChild methods */
206 static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDevice(ID3D10DepthStencilState *iface, ID3D10Device **device)
208 FIXME("iface %p, device %p stub!\n", iface, device);
211 static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_GetPrivateData(ID3D10DepthStencilState *iface,
212 REFGUID guid, UINT *data_size, void *data)
214 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
215 iface, debugstr_guid(guid), data_size, data);
220 static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateData(ID3D10DepthStencilState *iface,
221 REFGUID guid, UINT data_size, const void *data)
223 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
224 iface, debugstr_guid(guid), data_size, data);
229 static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateDataInterface(ID3D10DepthStencilState *iface,
230 REFGUID guid, const IUnknown *data)
232 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
237 /* ID3D10DepthStencilState methods */
239 static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDesc(ID3D10DepthStencilState *iface,
240 D3D10_DEPTH_STENCIL_DESC *desc)
242 FIXME("iface %p, desc %p stub!\n", iface, desc);
245 static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl =
247 /* IUnknown methods */
248 d3d10_depthstencil_state_QueryInterface,
249 d3d10_depthstencil_state_AddRef,
250 d3d10_depthstencil_state_Release,
251 /* ID3D10DeviceChild methods */
252 d3d10_depthstencil_state_GetDevice,
253 d3d10_depthstencil_state_GetPrivateData,
254 d3d10_depthstencil_state_SetPrivateData,
255 d3d10_depthstencil_state_SetPrivateDataInterface,
256 /* ID3D10DepthStencilState methods */
257 d3d10_depthstencil_state_GetDesc,
260 HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state)
262 state->ID3D10DepthStencilState_iface.lpVtbl = &d3d10_depthstencil_state_vtbl;
268 struct d3d10_depthstencil_state *unsafe_impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface)
272 assert(iface->lpVtbl == &d3d10_depthstencil_state_vtbl);
274 return impl_from_ID3D10DepthStencilState(iface);
277 static inline struct d3d10_rasterizer_state *impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface)
279 return CONTAINING_RECORD(iface, struct d3d10_rasterizer_state, ID3D10RasterizerState_iface);
282 /* IUnknown methods */
284 static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10RasterizerState *iface,
285 REFIID riid, void **object)
287 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
289 if (IsEqualGUID(riid, &IID_ID3D10RasterizerState)
290 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
291 || IsEqualGUID(riid, &IID_IUnknown))
293 IUnknown_AddRef(iface);
298 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
301 return E_NOINTERFACE;
304 static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerState *iface)
306 struct d3d10_rasterizer_state *This = impl_from_ID3D10RasterizerState(iface);
307 ULONG refcount = InterlockedIncrement(&This->refcount);
309 TRACE("%p increasing refcount to %u.\n", This, refcount);
314 static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_Release(ID3D10RasterizerState *iface)
316 struct d3d10_rasterizer_state *This = impl_from_ID3D10RasterizerState(iface);
317 ULONG refcount = InterlockedDecrement(&This->refcount);
319 TRACE("%p decreasing refcount to %u.\n", This, refcount);
323 HeapFree(GetProcessHeap(), 0, This);
329 /* ID3D10DeviceChild methods */
331 static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDevice(ID3D10RasterizerState *iface, ID3D10Device **device)
333 FIXME("iface %p, device %p stub!\n", iface, device);
336 static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_GetPrivateData(ID3D10RasterizerState *iface,
337 REFGUID guid, UINT *data_size, void *data)
339 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
340 iface, debugstr_guid(guid), data_size, data);
345 static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateData(ID3D10RasterizerState *iface,
346 REFGUID guid, UINT data_size, const void *data)
348 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
349 iface, debugstr_guid(guid), data_size, data);
354 static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateDataInterface(ID3D10RasterizerState *iface,
355 REFGUID guid, const IUnknown *data)
357 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
362 /* ID3D10RasterizerState methods */
364 static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDesc(ID3D10RasterizerState *iface,
365 D3D10_RASTERIZER_DESC *desc)
367 FIXME("iface %p, desc %p stub!\n", iface, desc);
370 static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl =
372 /* IUnknown methods */
373 d3d10_rasterizer_state_QueryInterface,
374 d3d10_rasterizer_state_AddRef,
375 d3d10_rasterizer_state_Release,
376 /* ID3D10DeviceChild methods */
377 d3d10_rasterizer_state_GetDevice,
378 d3d10_rasterizer_state_GetPrivateData,
379 d3d10_rasterizer_state_SetPrivateData,
380 d3d10_rasterizer_state_SetPrivateDataInterface,
381 /* ID3D10RasterizerState methods */
382 d3d10_rasterizer_state_GetDesc,
385 HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state)
387 state->ID3D10RasterizerState_iface.lpVtbl = &d3d10_rasterizer_state_vtbl;
393 struct d3d10_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface)
397 assert(iface->lpVtbl == &d3d10_rasterizer_state_vtbl);
399 return impl_from_ID3D10RasterizerState(iface);
402 static inline struct d3d10_sampler_state *impl_from_ID3D10SamplerState(ID3D10SamplerState *iface)
404 return CONTAINING_RECORD(iface, struct d3d10_sampler_state, ID3D10SamplerState_iface);
407 /* IUnknown methods */
409 static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_QueryInterface(ID3D10SamplerState *iface,
410 REFIID riid, void **object)
412 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
414 if (IsEqualGUID(riid, &IID_ID3D10SamplerState)
415 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
416 || IsEqualGUID(riid, &IID_IUnknown))
418 IUnknown_AddRef(iface);
423 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
426 return E_NOINTERFACE;
429 static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *iface)
431 struct d3d10_sampler_state *This = impl_from_ID3D10SamplerState(iface);
432 ULONG refcount = InterlockedIncrement(&This->refcount);
434 TRACE("%p increasing refcount to %u.\n", This, refcount);
439 static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *iface)
441 struct d3d10_sampler_state *This = impl_from_ID3D10SamplerState(iface);
442 ULONG refcount = InterlockedDecrement(&This->refcount);
444 TRACE("%p decreasing refcount to %u.\n", This, refcount);
448 HeapFree(GetProcessHeap(), 0, This);
454 /* ID3D10DeviceChild methods */
456 static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *iface, ID3D10Device **device)
458 FIXME("iface %p, device %p stub!\n", iface, device);
461 static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10SamplerState *iface,
462 REFGUID guid, UINT *data_size, void *data)
464 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
465 iface, debugstr_guid(guid), data_size, data);
470 static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateData(ID3D10SamplerState *iface,
471 REFGUID guid, UINT data_size, const void *data)
473 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
474 iface, debugstr_guid(guid), data_size, data);
479 static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState *iface,
480 REFGUID guid, const IUnknown *data)
482 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
487 /* ID3D10SamplerState methods */
489 static void STDMETHODCALLTYPE d3d10_sampler_state_GetDesc(ID3D10SamplerState *iface,
490 D3D10_SAMPLER_DESC *desc)
492 FIXME("iface %p, desc %p stub!\n", iface, desc);
495 static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
497 /* IUnknown methods */
498 d3d10_sampler_state_QueryInterface,
499 d3d10_sampler_state_AddRef,
500 d3d10_sampler_state_Release,
501 /* ID3D10DeviceChild methods */
502 d3d10_sampler_state_GetDevice,
503 d3d10_sampler_state_GetPrivateData,
504 d3d10_sampler_state_SetPrivateData,
505 d3d10_sampler_state_SetPrivateDataInterface,
506 /* ID3D10SamplerState methods */
507 d3d10_sampler_state_GetDesc,
510 HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state)
512 state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl;