~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/dxgi/output.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Copyright 2009 Henri Verbeet for CodeWeavers
  3  *
  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.
  8  *
  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.
 13  *
 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
 17  */
 18 
 19 #include "config.h"
 20 #include "wine/port.h"
 21 
 22 #include "dxgi_private.h"
 23 
 24 WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
 25 
 26 /* IUnknown methods */
 27 
 28 static HRESULT STDMETHODCALLTYPE dxgi_output_QueryInterface(IDXGIOutput *iface, REFIID riid, void **object)
 29 {
 30     TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
 31 
 32     if (IsEqualGUID(riid, &IID_IDXGIOutput)
 33             || IsEqualGUID(riid, &IID_IDXGIObject)
 34             || IsEqualGUID(riid, &IID_IUnknown))
 35     {
 36         IUnknown_AddRef(iface);
 37         *object = iface;
 38         return S_OK;
 39     }
 40 
 41     WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
 42 
 43     *object = NULL;
 44     return E_NOINTERFACE;
 45 }
 46 
 47 static ULONG STDMETHODCALLTYPE dxgi_output_AddRef(IDXGIOutput *iface)
 48 {
 49     struct dxgi_output *This = (struct dxgi_output *)iface;
 50     ULONG refcount = InterlockedIncrement(&This->refcount);
 51 
 52     TRACE("%p increasing refcount to %u.\n", This, refcount);
 53 
 54     return refcount;
 55 }
 56 
 57 static ULONG STDMETHODCALLTYPE dxgi_output_Release(IDXGIOutput *iface)
 58 {
 59     struct dxgi_output *This = (struct dxgi_output *)iface;
 60     ULONG refcount = InterlockedDecrement(&This->refcount);
 61 
 62     TRACE("%p decreasing refcount to %u.\n", This, refcount);
 63 
 64     if (!refcount)
 65     {
 66         HeapFree(GetProcessHeap(), 0, This);
 67     }
 68 
 69     return refcount;
 70 }
 71 
 72 /* IDXGIObject methods */
 73 
 74 static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateData(IDXGIOutput *iface,
 75         REFGUID guid, UINT data_size, const void *data)
 76 {
 77     FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
 78 
 79     return E_NOTIMPL;
 80 }
 81 
 82 static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateDataInterface(IDXGIOutput *iface,
 83         REFGUID guid, const IUnknown *object)
 84 {
 85     FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
 86 
 87     return E_NOTIMPL;
 88 }
 89 
 90 static HRESULT STDMETHODCALLTYPE dxgi_output_GetPrivateData(IDXGIOutput *iface,
 91         REFGUID guid, UINT *data_size, void *data)
 92 {
 93     FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
 94 
 95     return E_NOTIMPL;
 96 }
 97 
 98 static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface,
 99         REFIID riid, void **parent)
100 {
101     struct dxgi_output *This = (struct dxgi_output *)iface;
102 
103     TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent);
104 
105     return IDXGIAdapter_QueryInterface((IDXGIAdapter *)This->adapter, riid, parent);
106 }
107 
108 /* IDXGIOutput methods */
109 
110 static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput *iface, DXGI_OUTPUT_DESC *desc)
111 {
112     FIXME("iface %p, desc %p stub!\n", iface, desc);
113 
114     return E_NOTIMPL;
115 }
116 
117 static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *iface,
118         DXGI_FORMAT format, UINT flags, UINT *mode_count, DXGI_MODE_DESC *desc)
119 {
120     struct dxgi_output *This = (struct dxgi_output *)iface;
121     enum wined3d_format_id wined3d_format;
122     IWineD3D *wined3d;
123     UINT i;
124 
125     TRACE("iface %p, format %s, flags %#x, mode_count %p, desc %p.\n",
126             iface, debug_dxgi_format(format), flags, mode_count, desc);
127 
128     wined3d = IWineDXGIFactory_get_wined3d(This->adapter->parent);
129     wined3d_format = wined3dformat_from_dxgi_format(format);
130 
131     if (!desc)
132     {
133         EnterCriticalSection(&dxgi_cs);
134         *mode_count = IWineD3D_GetAdapterModeCount(wined3d, This->adapter->ordinal, wined3d_format);
135         IWineD3D_Release(wined3d);
136         LeaveCriticalSection(&dxgi_cs);
137 
138         return S_OK;
139     }
140 
141     EnterCriticalSection(&dxgi_cs);
142     for (i = 0; i < *mode_count; ++i)
143     {
144         WINED3DDISPLAYMODE mode;
145         HRESULT hr;
146 
147         hr = IWineD3D_EnumAdapterModes(wined3d, This->adapter->ordinal, wined3d_format, i, &mode);
148         if (FAILED(hr))
149         {
150             WARN("EnumAdapterModes failed, hr %#x.\n", hr);
151             IWineD3D_Release(wined3d);
152             LeaveCriticalSection(&dxgi_cs);
153             return hr;
154         }
155 
156         desc[i].Width = mode.Width;
157         desc[i].Height = mode.Height;
158         desc[i].RefreshRate.Numerator = mode.RefreshRate;
159         desc[i].RefreshRate.Denominator = 1;
160         desc[i].Format = format;
161         desc[i].ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; /* FIXME */
162         desc[i].Scaling = DXGI_MODE_SCALING_UNSPECIFIED; /* FIXME */
163     }
164     IWineD3D_Release(wined3d);
165     LeaveCriticalSection(&dxgi_cs);
166 
167     return S_OK;
168 }
169 
170 static HRESULT STDMETHODCALLTYPE dxgi_output_FindClosestMatchingMode(IDXGIOutput *iface,
171         const DXGI_MODE_DESC *mode, DXGI_MODE_DESC *closest_match, IUnknown *device)
172 {
173     FIXME("iface %p, mode %p, closest_match %p, device %p stub!\n", iface, mode, closest_match, device);
174 
175     return E_NOTIMPL;
176 }
177 
178 static HRESULT STDMETHODCALLTYPE dxgi_output_WaitForVBlank(IDXGIOutput *iface)
179 {
180     FIXME("iface %p stub!\n", iface);
181 
182     return E_NOTIMPL;
183 }
184 
185 static HRESULT STDMETHODCALLTYPE dxgi_output_TakeOwnership(IDXGIOutput *iface, IUnknown *device, BOOL exclusive)
186 {
187     FIXME("iface %p, device %p, exclusive %d stub!\n", iface, device, exclusive);
188 
189     return E_NOTIMPL;
190 }
191 
192 static void STDMETHODCALLTYPE dxgi_output_ReleaseOwnership(IDXGIOutput *iface)
193 {
194     FIXME("iface %p stub!\n", iface);
195 }
196 
197 static HRESULT STDMETHODCALLTYPE dxgi_output_GetGammaControlCapabilities(IDXGIOutput *iface,
198         DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps)
199 {
200     FIXME("iface %p, gamma_caps %p stub!\n", iface, gamma_caps);
201 
202     return E_NOTIMPL;
203 }
204 
205 static HRESULT STDMETHODCALLTYPE dxgi_output_SetGammaControl(IDXGIOutput *iface,
206         const DXGI_GAMMA_CONTROL *gamma_control)
207 {
208     FIXME("iface %p, gamma_control %p stub!\n", iface, gamma_control);
209 
210     return E_NOTIMPL;
211 }
212 
213 static HRESULT STDMETHODCALLTYPE dxgi_output_GetGammaControl(IDXGIOutput *iface, DXGI_GAMMA_CONTROL *gamma_control)
214 {
215     FIXME("iface %p, gamma_control %p stub!\n", iface, gamma_control);
216 
217     return E_NOTIMPL;
218 }
219 
220 static HRESULT STDMETHODCALLTYPE dxgi_output_SetDisplaySurface(IDXGIOutput *iface, IDXGISurface *surface)
221 {
222     FIXME("iface %p, surface %p stub!\n", iface, surface);
223 
224     return E_NOTIMPL;
225 }
226 
227 static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplaySurfaceData(IDXGIOutput *iface, IDXGISurface *surface)
228 {
229     FIXME("iface %p, surface %p stub!\n", iface, surface);
230 
231     return E_NOTIMPL;
232 }
233 
234 static HRESULT STDMETHODCALLTYPE dxgi_output_GetFrameStatistics(IDXGIOutput *iface, DXGI_FRAME_STATISTICS *stats)
235 {
236     FIXME("iface %p, stats %p stub!\n", iface, stats);
237 
238     return E_NOTIMPL;
239 }
240 
241 static const struct IDXGIOutputVtbl dxgi_output_vtbl =
242 {
243     dxgi_output_QueryInterface,
244     dxgi_output_AddRef,
245     dxgi_output_Release,
246     /* IDXGIObject methods */
247     dxgi_output_SetPrivateData,
248     dxgi_output_SetPrivateDataInterface,
249     dxgi_output_GetPrivateData,
250     dxgi_output_GetParent,
251     /* IDXGIOutput methods */
252     dxgi_output_GetDesc,
253     dxgi_output_GetDisplayModeList,
254     dxgi_output_FindClosestMatchingMode,
255     dxgi_output_WaitForVBlank,
256     dxgi_output_TakeOwnership,
257     dxgi_output_ReleaseOwnership,
258     dxgi_output_GetGammaControlCapabilities,
259     dxgi_output_SetGammaControl,
260     dxgi_output_GetGammaControl,
261     dxgi_output_SetDisplaySurface,
262     dxgi_output_GetDisplaySurfaceData,
263     dxgi_output_GetFrameStatistics,
264 };
265 
266 void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
267 {
268     output->vtbl = &dxgi_output_vtbl;
269     output->refcount = 1;
270     output->adapter = adapter;
271 }
272 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.