winegcc: Add detection for --param options.
[wine/multimedia.git] / dlls / d3d10core / state.c
blob2eaa652a3ce0d1c2ba118915341d4479b61e6630
1 /*
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
20 #include "config.h"
21 #include "wine/port.h"
23 #include "d3d10core_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
27 /* IUnknown methods */
29 static HRESULT STDMETHODCALLTYPE d3d10_blend_state_QueryInterface(ID3D10BlendState *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_ID3D10BlendState)
35 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
36 || IsEqualGUID(riid, &IID_IUnknown))
38 IUnknown_AddRef(iface);
39 *object = iface;
40 return S_OK;
43 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
45 *object = NULL;
46 return E_NOINTERFACE;
49 static ULONG STDMETHODCALLTYPE d3d10_blend_state_AddRef(ID3D10BlendState *iface)
51 struct d3d10_blend_state *This = (struct d3d10_blend_state *)iface;
52 ULONG refcount = InterlockedIncrement(&This->refcount);
54 TRACE("%p increasing refcount to %u.\n", This, refcount);
56 return refcount;
59 static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface)
61 struct d3d10_blend_state *This = (struct d3d10_blend_state *)iface;
62 ULONG refcount = InterlockedDecrement(&This->refcount);
64 TRACE("%p decreasing refcount to %u.\n", This, refcount);
66 if (!refcount)
68 HeapFree(GetProcessHeap(), 0, This);
71 return refcount;
74 /* ID3D10DeviceChild methods */
76 static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState *iface, ID3D10Device **device)
78 FIXME("iface %p, device %p stub!\n", iface, device);
81 static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendState *iface,
82 REFGUID guid, UINT *data_size, void *data)
84 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
85 iface, debugstr_guid(guid), data_size, data);
87 return E_NOTIMPL;
90 static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateData(ID3D10BlendState *iface,
91 REFGUID guid, UINT data_size, const void *data)
93 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
94 iface, debugstr_guid(guid), data_size, data);
96 return E_NOTIMPL;
99 static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D10BlendState *iface,
100 REFGUID guid, const IUnknown *data)
102 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
104 return E_NOTIMPL;
107 /* ID3D10BlendState methods */
109 static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState *iface,
110 D3D10_BLEND_DESC *desc)
112 FIXME("iface %p, desc %p stub!\n", iface, desc);
115 static const struct ID3D10BlendStateVtbl d3d10_blend_state_vtbl =
117 /* IUnknown methods */
118 d3d10_blend_state_QueryInterface,
119 d3d10_blend_state_AddRef,
120 d3d10_blend_state_Release,
121 /* ID3D10DeviceChild methods */
122 d3d10_blend_state_GetDevice,
123 d3d10_blend_state_GetPrivateData,
124 d3d10_blend_state_SetPrivateData,
125 d3d10_blend_state_SetPrivateDataInterface,
126 /* ID3D10BlendState methods */
127 d3d10_blend_state_GetDesc,
130 HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state)
132 state->vtbl = &d3d10_blend_state_vtbl;
133 state->refcount = 1;
135 return S_OK;
138 /* IUnknown methods */
140 static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_QueryInterface(ID3D10DepthStencilState *iface,
141 REFIID riid, void **object)
143 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
145 if (IsEqualGUID(riid, &IID_ID3D10DepthStencilState)
146 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
147 || IsEqualGUID(riid, &IID_IUnknown))
149 IUnknown_AddRef(iface);
150 *object = iface;
151 return S_OK;
154 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
156 *object = NULL;
157 return E_NOINTERFACE;
160 static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_AddRef(ID3D10DepthStencilState *iface)
162 struct d3d10_depthstencil_state *This = (struct d3d10_depthstencil_state *)iface;
163 ULONG refcount = InterlockedIncrement(&This->refcount);
165 TRACE("%p increasing refcount to %u.\n", This, refcount);
167 return refcount;
170 static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_Release(ID3D10DepthStencilState *iface)
172 struct d3d10_depthstencil_state *This = (struct d3d10_depthstencil_state *)iface;
173 ULONG refcount = InterlockedDecrement(&This->refcount);
175 TRACE("%p decreasing refcount to %u.\n", This, refcount);
177 if (!refcount)
179 HeapFree(GetProcessHeap(), 0, This);
182 return refcount;
185 /* ID3D10DeviceChild methods */
187 static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDevice(ID3D10DepthStencilState *iface, ID3D10Device **device)
189 FIXME("iface %p, device %p stub!\n", iface, device);
192 static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_GetPrivateData(ID3D10DepthStencilState *iface,
193 REFGUID guid, UINT *data_size, void *data)
195 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
196 iface, debugstr_guid(guid), data_size, data);
198 return E_NOTIMPL;
201 static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateData(ID3D10DepthStencilState *iface,
202 REFGUID guid, UINT data_size, const void *data)
204 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
205 iface, debugstr_guid(guid), data_size, data);
207 return E_NOTIMPL;
210 static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateDataInterface(ID3D10DepthStencilState *iface,
211 REFGUID guid, const IUnknown *data)
213 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
215 return E_NOTIMPL;
218 /* ID3D10DepthStencilState methods */
220 static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDesc(ID3D10DepthStencilState *iface,
221 D3D10_DEPTH_STENCIL_DESC *desc)
223 FIXME("iface %p, desc %p stub!\n", iface, desc);
226 static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl =
228 /* IUnknown methods */
229 d3d10_depthstencil_state_QueryInterface,
230 d3d10_depthstencil_state_AddRef,
231 d3d10_depthstencil_state_Release,
232 /* ID3D10DeviceChild methods */
233 d3d10_depthstencil_state_GetDevice,
234 d3d10_depthstencil_state_GetPrivateData,
235 d3d10_depthstencil_state_SetPrivateData,
236 d3d10_depthstencil_state_SetPrivateDataInterface,
237 /* ID3D10DepthStencilState methods */
238 d3d10_depthstencil_state_GetDesc,
241 HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state)
243 state->vtbl = &d3d10_depthstencil_state_vtbl;
244 state->refcount = 1;
246 return S_OK;
249 /* IUnknown methods */
251 static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10RasterizerState *iface,
252 REFIID riid, void **object)
254 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
256 if (IsEqualGUID(riid, &IID_ID3D10RasterizerState)
257 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
258 || IsEqualGUID(riid, &IID_IUnknown))
260 IUnknown_AddRef(iface);
261 *object = iface;
262 return S_OK;
265 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
267 *object = NULL;
268 return E_NOINTERFACE;
271 static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerState *iface)
273 struct d3d10_rasterizer_state *This = (struct d3d10_rasterizer_state *)iface;
274 ULONG refcount = InterlockedIncrement(&This->refcount);
276 TRACE("%p increasing refcount to %u.\n", This, refcount);
278 return refcount;
281 static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_Release(ID3D10RasterizerState *iface)
283 struct d3d10_rasterizer_state *This = (struct d3d10_rasterizer_state *)iface;
284 ULONG refcount = InterlockedDecrement(&This->refcount);
286 TRACE("%p decreasing refcount to %u.\n", This, refcount);
288 if (!refcount)
290 HeapFree(GetProcessHeap(), 0, This);
293 return refcount;
296 /* ID3D10DeviceChild methods */
298 static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDevice(ID3D10RasterizerState *iface, ID3D10Device **device)
300 FIXME("iface %p, device %p stub!\n", iface, device);
303 static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_GetPrivateData(ID3D10RasterizerState *iface,
304 REFGUID guid, UINT *data_size, void *data)
306 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
307 iface, debugstr_guid(guid), data_size, data);
309 return E_NOTIMPL;
312 static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateData(ID3D10RasterizerState *iface,
313 REFGUID guid, UINT data_size, const void *data)
315 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
316 iface, debugstr_guid(guid), data_size, data);
318 return E_NOTIMPL;
321 static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateDataInterface(ID3D10RasterizerState *iface,
322 REFGUID guid, const IUnknown *data)
324 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
326 return E_NOTIMPL;
329 /* ID3D10RasterizerState methods */
331 static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDesc(ID3D10RasterizerState *iface,
332 D3D10_RASTERIZER_DESC *desc)
334 FIXME("iface %p, desc %p stub!\n", iface, desc);
337 static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl =
339 /* IUnknown methods */
340 d3d10_rasterizer_state_QueryInterface,
341 d3d10_rasterizer_state_AddRef,
342 d3d10_rasterizer_state_Release,
343 /* ID3D10DeviceChild methods */
344 d3d10_rasterizer_state_GetDevice,
345 d3d10_rasterizer_state_GetPrivateData,
346 d3d10_rasterizer_state_SetPrivateData,
347 d3d10_rasterizer_state_SetPrivateDataInterface,
348 /* ID3D10RasterizerState methods */
349 d3d10_rasterizer_state_GetDesc,
352 HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state)
354 state->vtbl = &d3d10_rasterizer_state_vtbl;
355 state->refcount = 1;
357 return S_OK;
360 /* IUnknown methods */
362 static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_QueryInterface(ID3D10SamplerState *iface,
363 REFIID riid, void **object)
365 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
367 if (IsEqualGUID(riid, &IID_ID3D10SamplerState)
368 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
369 || IsEqualGUID(riid, &IID_IUnknown))
371 IUnknown_AddRef(iface);
372 *object = iface;
373 return S_OK;
376 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
378 *object = NULL;
379 return E_NOINTERFACE;
382 static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *iface)
384 struct d3d10_sampler_state *This = (struct d3d10_sampler_state *)iface;
385 ULONG refcount = InterlockedIncrement(&This->refcount);
387 TRACE("%p increasing refcount to %u.\n", This, refcount);
389 return refcount;
392 static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *iface)
394 struct d3d10_sampler_state *This = (struct d3d10_sampler_state *)iface;
395 ULONG refcount = InterlockedDecrement(&This->refcount);
397 TRACE("%p decreasing refcount to %u.\n", This, refcount);
399 if (!refcount)
401 HeapFree(GetProcessHeap(), 0, This);
404 return refcount;
407 /* ID3D10DeviceChild methods */
409 static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *iface, ID3D10Device **device)
411 FIXME("iface %p, device %p stub!\n", iface, device);
414 static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10SamplerState *iface,
415 REFGUID guid, UINT *data_size, void *data)
417 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
418 iface, debugstr_guid(guid), data_size, data);
420 return E_NOTIMPL;
423 static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateData(ID3D10SamplerState *iface,
424 REFGUID guid, UINT data_size, const void *data)
426 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
427 iface, debugstr_guid(guid), data_size, data);
429 return E_NOTIMPL;
432 static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState *iface,
433 REFGUID guid, const IUnknown *data)
435 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
437 return E_NOTIMPL;
440 /* ID3D10SamplerState methods */
442 static void STDMETHODCALLTYPE d3d10_sampler_state_GetDesc(ID3D10SamplerState *iface,
443 D3D10_SAMPLER_DESC *desc)
445 FIXME("iface %p, desc %p stub!\n", iface, desc);
448 static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
450 /* IUnknown methods */
451 d3d10_sampler_state_QueryInterface,
452 d3d10_sampler_state_AddRef,
453 d3d10_sampler_state_Release,
454 /* ID3D10DeviceChild methods */
455 d3d10_sampler_state_GetDevice,
456 d3d10_sampler_state_GetPrivateData,
457 d3d10_sampler_state_SetPrivateData,
458 d3d10_sampler_state_SetPrivateDataInterface,
459 /* ID3D10SamplerState methods */
460 d3d10_sampler_state_GetDesc,
463 HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state)
465 state->vtbl = &d3d10_sampler_state_vtbl;
466 state->refcount = 1;
468 return S_OK;