Commit fca2d194 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

dxgi: Implement dxgi_swapchain_ResizeBuffers().

parent 2735947d
......@@ -218,10 +218,40 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, D
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *iface,
UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags)
{
FIXME("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x stub!\n",
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
struct wined3d_swapchain_desc wined3d_desc;
struct wined3d_surface *surface;
IUnknown *parent;
unsigned int i;
HRESULT hr;
TRACE("iface %p, buffer_count %u, width %u, height %u, format %s, flags %#x stub!\n",
iface, buffer_count, width, height, debug_dxgi_format(format), flags);
return E_NOTIMPL;
if (flags)
FIXME("Ignoring flags %#x.\n", flags);
EnterCriticalSection(&dxgi_cs);
wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc);
for (i = 0; i < wined3d_desc.backbuffer_count; ++i)
{
surface = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain,
i, WINED3D_BACKBUFFER_TYPE_MONO);
parent = wined3d_surface_get_parent(surface);
IUnknown_AddRef(parent);
if (IUnknown_Release(parent))
{
LeaveCriticalSection(&dxgi_cs);
return DXGI_ERROR_INVALID_CALL;
}
}
if (format != DXGI_FORMAT_UNKNOWN)
wined3d_desc.backbuffer_format = wined3dformat_from_dxgi_format(format);
hr = wined3d_swapchain_resize_buffers(swapchain->wined3d_swapchain, buffer_count, width, height,
wined3d_desc.backbuffer_format, wined3d_desc.multisample_type, wined3d_desc.multisample_quality);
LeaveCriticalSection(&dxgi_cs);
return hr;
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeTarget(IDXGISwapChain *iface,
......
......@@ -1225,7 +1225,7 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
device->filter_messages = filter_messages;
}
HRESULT wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapchain, unsigned int buffer_count,
HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapchain, unsigned int buffer_count,
unsigned int width, unsigned int height, enum wined3d_format_id format_id,
enum wined3d_multisample_type multisample_type, unsigned int multisample_quality)
{
......
......@@ -255,6 +255,7 @@
@ cdecl wined3d_swapchain_get_raster_status(ptr ptr)
@ cdecl wined3d_swapchain_incref(ptr)
@ cdecl wined3d_swapchain_present(ptr ptr ptr ptr ptr long)
@ cdecl wined3d_swapchain_resize_buffers(ptr long long long long long long)
@ cdecl wined3d_swapchain_set_gamma_ramp(ptr long ptr)
@ cdecl wined3d_swapchain_set_palette(ptr ptr)
@ cdecl wined3d_swapchain_set_window(ptr ptr)
......
......@@ -2812,9 +2812,6 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
HRESULT wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapchain, unsigned int buffer_count,
unsigned int width, unsigned int height, enum wined3d_format_id format_id,
enum wined3d_multisample_type multisample_type, unsigned int multisample_quality) DECLSPEC_HIDDEN;
void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
/*****************************************************************************
......
......@@ -2530,6 +2530,9 @@ ULONG __cdecl wined3d_swapchain_incref(struct wined3d_swapchain *swapchain);
HRESULT __cdecl wined3d_swapchain_present(struct wined3d_swapchain *swapchain,
const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override,
const RGNDATA *dirty_region, DWORD flags);
HRESULT __cdecl wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapchain, unsigned int buffer_count,
unsigned int width, unsigned int height, enum wined3d_format_id format_id,
enum wined3d_multisample_type multisample_type, unsigned int multisample_quality);
HRESULT __cdecl wined3d_swapchain_set_gamma_ramp(const struct wined3d_swapchain *swapchain,
DWORD flags, const struct wined3d_gamma_ramp *ramp);
void __cdecl wined3d_swapchain_set_palette(struct wined3d_swapchain *swapchain, struct wined3d_palette *palette);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment