2 * Copyright 2008 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 "dxgi_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
27 /* IUnknown methods */
29 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_QueryInterface(IDXGISwapChain *iface, REFIID riid, void **object)
31 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
33 if (IsEqualGUID(riid, &IID_IUnknown)
34 || IsEqualGUID(riid, &IID_IDXGIObject)
35 || IsEqualGUID(riid, &IID_IDXGIDeviceSubObject)
36 || IsEqualGUID(riid, &IID_IDXGISwapChain))
38 IUnknown_AddRef(iface);
43 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
49 static ULONG STDMETHODCALLTYPE dxgi_swapchain_AddRef(IDXGISwapChain *iface)
51 struct dxgi_swapchain *This = (struct dxgi_swapchain *)iface;
52 ULONG refcount = InterlockedIncrement(&This->refcount);
54 TRACE("%p increasing refcount to %u\n", This, refcount);
59 static ULONG STDMETHODCALLTYPE dxgi_swapchain_Release(IDXGISwapChain *iface)
61 struct dxgi_swapchain *This = (struct dxgi_swapchain *)iface;
62 ULONG refcount = InterlockedDecrement(&This->refcount);
64 TRACE("%p decreasing refcount to %u\n", This, refcount);
68 HeapFree(GetProcessHeap(), 0, This);
74 /* IDXGIObject methods */
76 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateData(IDXGISwapChain *iface,
77 REFGUID guid, UINT data_size, const void *data)
79 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
84 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateDataInterface(IDXGISwapChain *iface,
85 REFGUID guid, const IUnknown *object)
87 FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
92 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetPrivateData(IDXGISwapChain *iface,
93 REFGUID guid, UINT *data_size, void *data)
95 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
100 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetParent(IDXGISwapChain *iface, REFIID riid, void **parent)
102 FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent);
107 /* IDXGIDeviceSubObject methods */
109 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDevice(IDXGISwapChain *iface, REFIID riid, void **device)
111 FIXME("iface %p, riid %s, device %p stub!\n", iface, debugstr_guid(riid), device);
116 /* IDXGISwapChain methods */
118 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_Present(IDXGISwapChain *iface, UINT sync_interval, UINT flags)
120 FIXME("iface %p, sync_interval %u, flags %#x stub!\n", iface, sync_interval, flags);
125 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
126 UINT buffer_idx, REFIID riid, void **surface)
128 FIXME("iface %p, buffer_idx %u, riid %s, surface %p stub!\n",
129 iface, buffer_idx, debugstr_guid(riid), surface);
134 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetFullscreenState(IDXGISwapChain *iface,
135 BOOL fullscreen, IDXGIOutput *target)
137 FIXME("iface %p, fullscreen %u, target %p stub!\n", iface, fullscreen, target);
142 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFullscreenState(IDXGISwapChain *iface,
143 BOOL *fullscreen, IDXGIOutput **target)
145 FIXME("iface %p, fullscreen %p, target %p stub!\n", iface, fullscreen, target);
150 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, DXGI_SWAP_CHAIN_DESC *desc)
152 FIXME("iface %p, desc %p stub!\n", iface, desc);
157 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *iface,
158 UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags)
160 FIXME("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x stub!\n",
161 iface, buffer_count, width, height, debug_dxgi_format(format), flags);
166 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeTarget(IDXGISwapChain *iface,
167 const DXGI_MODE_DESC *target_mode_desc)
169 FIXME("iface %p, target_mode_desc %p stub!\n", iface, target_mode_desc);
174 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetContainingOutput(IDXGISwapChain *iface, IDXGIOutput **output)
176 FIXME("iface %p, output %p stub!\n", iface, output);
181 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFrameStatistics(IDXGISwapChain *iface, DXGI_FRAME_STATISTICS *stats)
183 FIXME("iface %p, stats %p stub!\n", iface, stats);
188 static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetLastPresentCount(IDXGISwapChain *iface, UINT *last_present_count)
190 FIXME("iface %p, last_present_count %p stub!\n", iface, last_present_count);
195 const struct IDXGISwapChainVtbl dxgi_swapchain_vtbl =
197 /* IUnknown methods */
198 dxgi_swapchain_QueryInterface,
199 dxgi_swapchain_AddRef,
200 dxgi_swapchain_Release,
201 /* IDXGIObject methods */
202 dxgi_swapchain_SetPrivateData,
203 dxgi_swapchain_SetPrivateDataInterface,
204 dxgi_swapchain_GetPrivateData,
205 dxgi_swapchain_GetParent,
206 /* IDXGIDeviceSubObject methods */
207 dxgi_swapchain_GetDevice,
208 /* IDXGISwapChain methods */
209 dxgi_swapchain_Present,
210 dxgi_swapchain_GetBuffer,
211 dxgi_swapchain_SetFullscreenState,
212 dxgi_swapchain_GetFullscreenState,
213 dxgi_swapchain_GetDesc,
214 dxgi_swapchain_ResizeBuffers,
215 dxgi_swapchain_ResizeTarget,
216 dxgi_swapchain_GetContainingOutput,
217 dxgi_swapchain_GetFrameStatistics,
218 dxgi_swapchain_GetLastPresentCount,