ReactOS 0.4.17-dev-966-gf06eace
swapchain.c
Go to the documentation of this file.
1/*
2 * IDirect3DSwapChain9 implementation
3 *
4 * Copyright 2002-2003 Jason Edmeades
5 * Raphael Junqueira
6 * Copyright 2005 Oliver Stieber
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include "d3d9_private.h"
24
26
28{
29 switch (interval)
30 {
41 default:
42 ERR("Invalid swap interval %#x.\n", interval);
45 }
46}
47
48static inline struct d3d9_swapchain *impl_from_IDirect3DSwapChain9Ex(IDirect3DSwapChain9Ex *iface)
49{
51}
52
53static HRESULT WINAPI d3d9_swapchain_QueryInterface(IDirect3DSwapChain9Ex *iface, REFIID riid, void **out)
54{
55 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
56
57 if (IsEqualGUID(riid, &IID_IDirect3DSwapChain9)
59 {
61 *out = iface;
62 return S_OK;
63 }
64
65 if (IsEqualGUID(riid, &IID_IDirect3DSwapChain9Ex))
66 {
67 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
69
70 /* Find out if the creating d3d9 interface was created with Direct3DCreate9Ex.
71 * It doesn't matter with which function the device was created. */
72 if (!device->d3d_parent->extended)
73 {
74 WARN("IDirect3D9 instance wasn't created with CreateDirect3D9Ex, returning E_NOINTERFACE.\n");
75 *out = NULL;
76 return E_NOINTERFACE;
77 }
78
80 *out = iface;
81 return S_OK;
82 }
83
84 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
85
86 *out = NULL;
87 return E_NOINTERFACE;
88}
89
90static ULONG WINAPI d3d9_swapchain_AddRef(IDirect3DSwapChain9Ex *iface)
91{
92 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
94
95 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
96
97 if (refcount == 1)
98 {
99 if (swapchain->parent_device)
101
103 }
104
105 return refcount;
106}
107
108static ULONG WINAPI d3d9_swapchain_Release(IDirect3DSwapChain9Ex *iface)
109{
110 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
112
113 if (!swapchain->refcount)
114 {
115 WARN("Swapchain does not have any references.\n");
116 return 0;
117 }
118
120 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
121
122 if (!refcount)
123 {
125
127
128 /* Release the device last, as it may cause the device to be destroyed. */
129 if (parent_device)
131 }
132
133 return refcount;
134}
135
136static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_swapchain_Present(IDirect3DSwapChain9Ex *iface,
137 const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override,
138 const RGNDATA *dirty_region, DWORD flags)
139{
140 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
142
143 TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p, flags %#lx.\n",
144 iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect),
145 dst_window_override, dirty_region, flags);
146
147 if (device->device_state != D3D9_DEVICE_STATE_OK)
148 return device->d3d_parent->extended ? S_PRESENT_OCCLUDED : D3DERR_DEVICELOST;
149
150 if (dirty_region)
151 FIXME("Ignoring dirty_region %p.\n", dirty_region);
152
154 src_rect, dst_rect, dst_window_override, swapchain->swap_interval, flags);
155}
156
157static HRESULT WINAPI d3d9_swapchain_GetFrontBufferData(IDirect3DSwapChain9Ex *iface, IDirect3DSurface9 *surface)
158{
159 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
161 HRESULT hr;
162
163 TRACE("iface %p, surface %p.\n", iface, surface);
164
166 hr = wined3d_swapchain_get_front_buffer_data(swapchain->wined3d_swapchain, dst->wined3d_texture, dst->sub_resource_idx);
168
169 return hr;
170}
171
172static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface,
173 UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer)
174{
175 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
177 struct d3d9_surface *surface_impl;
178 HRESULT hr = D3D_OK;
179
180 TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
181 iface, backbuffer_idx, backbuffer_type, backbuffer);
182
183 /* backbuffer_type is ignored by native. */
184
185 if (!backbuffer)
186 {
187 WARN("The output pointer is NULL, returning D3DERR_INVALIDCALL.\n");
188 return D3DERR_INVALIDCALL;
189 }
190
192 if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx)))
193 {
195 *backbuffer = &surface_impl->IDirect3DSurface9_iface;
196 IDirect3DSurface9_AddRef(*backbuffer);
197 }
198 else
199 {
200 /* Do not set *backbuffer = NULL, see tests/device.c, test_swapchain(). */
202 }
204
205 return hr;
206}
207
208static HRESULT WINAPI d3d9_swapchain_GetRasterStatus(IDirect3DSwapChain9Ex *iface, D3DRASTER_STATUS *raster_status)
209{
210 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
211 HRESULT hr;
212
213 TRACE("iface %p, raster_status %p.\n", iface, raster_status);
214
217 (struct wined3d_raster_status *)raster_status);
219
220 return hr;
221}
222
223static HRESULT WINAPI d3d9_swapchain_GetDisplayMode(IDirect3DSwapChain9Ex *iface, D3DDISPLAYMODE *mode)
224{
225 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
226 struct wined3d_display_mode wined3d_mode;
227 HRESULT hr;
228
229 TRACE("iface %p, mode %p.\n", iface, mode);
230
232 hr = wined3d_swapchain_get_display_mode(swapchain->wined3d_swapchain, &wined3d_mode, NULL);
234
235 if (SUCCEEDED(hr))
236 {
237 mode->Width = wined3d_mode.width;
238 mode->Height = wined3d_mode.height;
239 mode->RefreshRate = wined3d_mode.refresh_rate;
240 mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
241 }
242
243 return hr;
244}
245
246static HRESULT WINAPI d3d9_swapchain_GetDevice(IDirect3DSwapChain9Ex *iface, IDirect3DDevice9 **device)
247{
248 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
249
250 TRACE("iface %p, device %p.\n", iface, device);
251
252 *device = (IDirect3DDevice9 *)swapchain->parent_device;
254
255 TRACE("Returning device %p.\n", *device);
256
257 return D3D_OK;
258}
259
260static HRESULT WINAPI d3d9_swapchain_GetPresentParameters(IDirect3DSwapChain9Ex *iface,
262{
263 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
265 DWORD presentation_interval;
266
267 TRACE("iface %p, parameters %p.\n", iface, parameters);
268
271 presentation_interval = d3dpresentationinterval_from_wined3dswapinterval(swapchain->swap_interval);
274
275 return D3D_OK;
276}
277
278static HRESULT WINAPI d3d9_swapchain_GetLastPresentCount(IDirect3DSwapChain9Ex *iface,
279 UINT *last_present_count)
280{
281 FIXME("iface %p, last_present_count %p, stub!\n", iface, last_present_count);
282
283 if (last_present_count)
284 *last_present_count = 0;
285
286 return D3D_OK;
287}
288
289static HRESULT WINAPI d3d9_swapchain_GetPresentStatistics(IDirect3DSwapChain9Ex *iface,
290 D3DPRESENTSTATS *present_stats)
291{
292 FIXME("iface %p, present_stats %p, stub!\n", iface, present_stats);
293
294 if (present_stats)
295 memset(present_stats, 0, sizeof(*present_stats));
296
297 return D3D_OK;
298}
299
300static HRESULT WINAPI d3d9_swapchain_GetDisplayModeEx(IDirect3DSwapChain9Ex *iface,
302{
303 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
304 struct wined3d_display_mode wined3d_mode;
305 HRESULT hr;
306
307 TRACE("iface %p, mode %p, rotation %p.\n", iface, mode, rotation);
308
309 if (mode->Size != sizeof(*mode))
310 return D3DERR_INVALIDCALL;
311
313 hr = wined3d_swapchain_get_display_mode(swapchain->wined3d_swapchain, &wined3d_mode,
314 (enum wined3d_display_rotation *)rotation);
316
317 if (SUCCEEDED(hr))
318 {
319 mode->Width = wined3d_mode.width;
320 mode->Height = wined3d_mode.height;
321 mode->RefreshRate = wined3d_mode.refresh_rate;
322 mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
323 mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering);
324 }
325
326 return hr;
327}
328
329static const struct IDirect3DSwapChain9ExVtbl d3d9_swapchain_vtbl =
330{
331 /* IUnknown */
335 /* IDirect3DSwapChain9 */
343 /* IDirect3DSwapChain9Ex */
347};
348
350{
351 free(parent);
352}
353
355{
357};
358
360 BOOL windowed)
361{
362 TRACE("parent %p, windowed %d.\n", parent, windowed);
363}
364
366{
368};
369
370static HRESULT swapchain_init(struct d3d9_swapchain *swapchain, struct d3d9_device *device,
371 struct wined3d_swapchain_desc *desc, unsigned int swap_interval)
372{
373 struct wined3d_swapchain_desc swapchain_desc;
374 HRESULT hr;
375
376 swapchain->refcount = 1;
379 swapchain->swap_interval = swap_interval;
380
381 if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, &swapchain->state_parent,
382 swapchain, &d3d9_swapchain_wined3d_parent_ops, &swapchain->wined3d_swapchain)))
383 {
384 WARN("Failed to create wined3d swapchain, hr %#lx.\n", hr);
385 return hr;
386 }
387
388 wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &swapchain_desc);
389 desc->backbuffer_width = swapchain_desc.backbuffer_width;
390 desc->backbuffer_height = swapchain_desc.backbuffer_height;
391 desc->backbuffer_format = swapchain_desc.backbuffer_format;
392
393 swapchain->parent_device = &device->IDirect3DDevice9Ex_iface;
395
396 return D3D_OK;
397}
398
400 unsigned int swap_interval, struct d3d9_swapchain **swapchain)
401{
402 struct wined3d_rendertarget_view *wined3d_dsv;
403 struct d3d9_swapchain *object;
404 struct d3d9_surface *surface;
405 unsigned int i;
406 HRESULT hr;
407
408 if (!(object = calloc(1, sizeof(*object))))
409 return E_OUTOFMEMORY;
410
411 if (FAILED(hr = swapchain_init(object, device, desc, swap_interval)))
412 {
413 WARN("Failed to initialize swapchain, hr %#lx.\n", hr);
414 free(object);
415 return hr;
416 }
417
418 for (i = 0; i < desc->backbuffer_count; ++i)
419 {
420 if (!(surface = d3d9_surface_create(wined3d_swapchain_get_back_buffer(object->wined3d_swapchain, i), 0,
421 (IUnknown *)&object->IDirect3DSwapChain9Ex_iface)))
422 {
423 IDirect3DSwapChain9Ex_Release(&object->IDirect3DSwapChain9Ex_iface);
424 return E_OUTOFMEMORY;
425 }
426 surface->parent_device = &device->IDirect3DDevice9Ex_iface;
427 }
428
429 if ((desc->flags & WINED3D_SWAPCHAIN_IMPLICIT)
430 && (wined3d_dsv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
431 {
433
435 (IUnknown *)&device->IDirect3DDevice9Ex_iface)))
436 {
437 IDirect3DSwapChain9Ex_Release(&object->IDirect3DSwapChain9Ex_iface);
438 return E_OUTOFMEMORY;
439 }
440 surface->parent_device = &device->IDirect3DDevice9Ex_iface;
441 }
442
443 TRACE("Created swapchain %p.\n", object);
444 *swapchain = object;
445
446 return D3D_OK;
447}
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:240
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define D3DERR_INVALIDCALL
Definition: d3d10_private.h:42
static HRESULT swapchain_init(struct d3d8_swapchain *swapchain, struct d3d8_device *device, struct wined3d_swapchain_desc *desc, unsigned int swap_interval)
Definition: swapchain.c:170
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format)
Definition: device.c:33
enum _D3DBACKBUFFER_TYPE D3DBACKBUFFER_TYPE
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_swapchain_Present(IDirect3DSwapChain9Ex *iface, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region, DWORD flags)
Definition: swapchain.c:136
static HRESULT WINAPI d3d9_swapchain_GetLastPresentCount(IDirect3DSwapChain9Ex *iface, UINT *last_present_count)
Definition: swapchain.c:278
static const struct wined3d_swapchain_state_parent_ops d3d9_swapchain_state_parent_ops
Definition: swapchain.c:365
HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapchain_desc *desc, unsigned int swap_interval, struct d3d9_swapchain **swapchain)
Definition: swapchain.c:399
static HRESULT WINAPI d3d9_swapchain_GetDevice(IDirect3DSwapChain9Ex *iface, IDirect3DDevice9 **device)
Definition: swapchain.c:246
static void STDMETHODCALLTYPE d3d9_swapchain_wined3d_object_released(void *parent)
Definition: swapchain.c:349
static const struct IDirect3DSwapChain9ExVtbl d3d9_swapchain_vtbl
Definition: swapchain.c:329
static ULONG WINAPI d3d9_swapchain_Release(IDirect3DSwapChain9Ex *iface)
Definition: swapchain.c:108
static HRESULT WINAPI d3d9_swapchain_GetPresentParameters(IDirect3DSwapChain9Ex *iface, D3DPRESENT_PARAMETERS *parameters)
Definition: swapchain.c:260
static struct d3d9_swapchain * impl_from_IDirect3DSwapChain9Ex(IDirect3DSwapChain9Ex *iface)
Definition: swapchain.c:48
static void CDECL d3d9_swapchain_windowed_state_changed(struct wined3d_swapchain_state_parent *parent, BOOL windowed)
Definition: swapchain.c:359
static HRESULT WINAPI d3d9_swapchain_GetRasterStatus(IDirect3DSwapChain9Ex *iface, D3DRASTER_STATUS *raster_status)
Definition: swapchain.c:208
static HRESULT WINAPI d3d9_swapchain_GetFrontBufferData(IDirect3DSwapChain9Ex *iface, IDirect3DSurface9 *surface)
Definition: swapchain.c:157
static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface, UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer)
Definition: swapchain.c:172
static HRESULT WINAPI d3d9_swapchain_GetPresentStatistics(IDirect3DSwapChain9Ex *iface, D3DPRESENTSTATS *present_stats)
Definition: swapchain.c:289
static HRESULT WINAPI d3d9_swapchain_GetDisplayModeEx(IDirect3DSwapChain9Ex *iface, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation)
Definition: swapchain.c:300
static ULONG WINAPI d3d9_swapchain_AddRef(IDirect3DSwapChain9Ex *iface)
Definition: swapchain.c:90
static const struct wined3d_parent_ops d3d9_swapchain_wined3d_parent_ops
Definition: swapchain.c:354
static HRESULT WINAPI d3d9_swapchain_GetDisplayMode(IDirect3DSwapChain9Ex *iface, D3DDISPLAYMODE *mode)
Definition: swapchain.c:223
static HRESULT WINAPI d3d9_swapchain_QueryInterface(IDirect3DSwapChain9Ex *iface, REFIID riid, void **out)
Definition: swapchain.c:53
static DWORD d3dpresentationinterval_from_wined3dswapinterval(enum wined3d_swap_interval interval)
Definition: swapchain.c:27
#define IDirect3DSwapChain9Ex_Release(p)
Definition: d3d9.h:1717
#define IDirect3DSwapChain9Ex_AddRef(p)
Definition: d3d9.h:1716
#define IDirect3DDevice9Ex_Release(p)
Definition: d3d9.h:1930
#define S_PRESENT_OCCLUDED
Definition: d3d9.h:110
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:449
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1929
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1335
D3DDISPLAYROTATION
Definition: d3d9types.h:1589
#define D3D_OK
Definition: d3d.h:106
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc, DWORD presentation_interval)
Definition: device.c:202
struct wined3d_rendertarget_view *CDECL wined3d_device_context_get_depth_stencil_view(const struct wined3d_device_context *context)
Definition: device.c:4676
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
Definition: texture.c:3343
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:4033
struct wined3d_resource *CDECL wined3d_rendertarget_view_get_resource(const struct wined3d_rendertarget_view *view)
Definition: view.c:430
#define CDECL
Definition: compat.h:29
r parent
Definition: btrfs.c:3010
#define D3DPRESENT_INTERVAL_THREE
Definition: d3d8caps.h:31
#define D3DPRESENT_INTERVAL_TWO
Definition: d3d8caps.h:30
#define D3DPRESENT_INTERVAL_FOUR
Definition: d3d8caps.h:32
#define D3DPRESENT_INTERVAL_IMMEDIATE
Definition: d3d8caps.h:33
#define D3DPRESENT_INTERVAL_ONE
Definition: d3d8caps.h:29
#define D3DPRESENT_INTERVAL_DEFAULT
Definition: d3d8caps.h:28
DWORD IDirect3DSurface9
Definition: dxva2api.idl:23
DWORD IDirect3DDevice9
Definition: dxva2api.idl:22
DWORD IDirect3DDevice9Ex
Definition: dxvahd.idl:22
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum mode
Definition: glext.h:6217
GLenum GLenum dst
Definition: glext.h:6340
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
static BYTE parameters[]
Definition: asn.c:558
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define calloc
Definition: rosglue.h:14
#define D3DERR_DEVICELOST
Definition: d3d8.h:78
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: dcommon.idl:28
IDirect3DDevice9Ex * parent_device
Definition: d3d9_private.h:176
struct wined3d_swapchain * swapchain
Definition: d3d9_private.h:179
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:170
IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex_iface
Definition: d3d9_private.h:157
IDirect3DDevice9Ex * parent_device
Definition: d3d9_private.h:161
struct wined3d_swapchain * wined3d_swapchain
Definition: d3d9_private.h:159
unsigned int swap_interval
Definition: d3d9_private.h:162
struct wined3d_swapchain_state_parent state_parent
Definition: d3d9_private.h:160
Definition: devices.h:37
enum wined3d_format_id format_id
Definition: wined3d.h:1614
enum wined3d_scanline_ordering scanline_ordering
Definition: wined3d.h:1615
unsigned int backbuffer_height
Definition: wined3d.h:1773
unsigned int backbuffer_width
Definition: wined3d.h:1772
enum wined3d_format_id backbuffer_format
Definition: wined3d.h:1774
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define WINAPI
Definition: msvc.h:6
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:310
struct d3d9_surface * d3d9_surface_create(struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, IUnknown *container)
Definition: surface.c:356
struct d3d9_surface * unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface)
Definition: surface.c:450
@ D3D9_DEVICE_STATE_OK
Definition: d3d9_private.h:84
static D3DSCANLINEORDERING d3dscanlineordering_from_wined3d(enum wined3d_scanline_ordering ordering)
Definition: d3d9_private.h:349
struct wined3d_texture *CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, UINT back_buffer_idx)
Definition: swapchain.c:256
void CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, struct wined3d_swapchain_desc *desc)
Definition: swapchain.c:345
HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain *swapchain, struct wined3d_raster_status *raster_status)
Definition: swapchain.c:294
ULONG CDECL wined3d_swapchain_decref(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:144
HRESULT CDECL wined3d_swapchain_create(struct wined3d_device *device, const struct wined3d_swapchain_desc *desc, struct wined3d_swapchain_state_parent *state_parent, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain)
Definition: swapchain.c:1732
ULONG CDECL wined3d_swapchain_incref(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:135
HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, struct wined3d_texture *dst_texture, unsigned int sub_resource_idx)
Definition: swapchain.c:235
HRESULT CDECL wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: swapchain.c:316
HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, uint32_t flags)
Definition: swapchain.c:192
wined3d_swap_interval
Definition: wined3d.h:544
@ WINED3D_SWAP_INTERVAL_TWO
Definition: wined3d.h:547
@ WINED3D_SWAP_INTERVAL_FOUR
Definition: wined3d.h:549
@ WINED3D_SWAP_INTERVAL_ONE
Definition: wined3d.h:546
@ WINED3D_SWAP_INTERVAL_DEFAULT
Definition: wined3d.h:550
@ WINED3D_SWAP_INTERVAL_THREE
Definition: wined3d.h:548
@ WINED3D_SWAP_INTERVAL_IMMEDIATE
Definition: wined3d.h:545
#define WINED3D_SWAPCHAIN_IMPLICIT
Definition: wined3d.h:901
wined3d_display_rotation
Definition: wined3d.h:831
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:544
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:539
#define E_NOINTERFACE
Definition: winerror.h:3479