wined3d: Introduce wined3d_swapchain_get_output().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
878211c36f
commit
ead3d068f9
|
@ -5038,6 +5038,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
|
|||
struct wined3d_swapchain *swapchain;
|
||||
struct wined3d_view_desc view_desc;
|
||||
BOOL backbuffer_resized, windowed;
|
||||
struct wined3d_output *output;
|
||||
HRESULT hr = WINED3D_OK;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -5146,8 +5147,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
|
|||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(output = wined3d_swapchain_get_output(swapchain)))
|
||||
{
|
||||
ERR("Failed to get output from swapchain %p.\n", swapchain);
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(hr = wined3d_swapchain_state_set_fullscreen(&swapchain->state,
|
||||
swapchain_desc, device->wined3d, &device->adapter->outputs[0], mode)))
|
||||
swapchain_desc, device->wined3d, output, mode)))
|
||||
return hr;
|
||||
|
||||
/* Switch from fullscreen to windowed. */
|
||||
|
|
|
@ -289,6 +289,19 @@ static struct wined3d_output * get_output_from_window(const struct wined3d *wine
|
|||
return &wined3d->adapters[0]->outputs[0];
|
||||
}
|
||||
|
||||
struct wined3d_output * wined3d_swapchain_get_output(const struct wined3d_swapchain *swapchain)
|
||||
{
|
||||
HWND hwnd;
|
||||
|
||||
TRACE("swapchain %p.\n", swapchain);
|
||||
|
||||
hwnd = swapchain->state.device_window;
|
||||
if (!hwnd)
|
||||
hwnd = swapchain->win_handle;
|
||||
|
||||
return get_output_from_window(swapchain->device->wined3d, hwnd);
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain *swapchain,
|
||||
struct wined3d_raster_status *raster_status)
|
||||
{
|
||||
|
|
|
@ -541,6 +541,7 @@ static LRESULT CALLBACK wined3d_hook_proc(int code, WPARAM wparam, LPARAM lparam
|
|||
struct wined3d_swapchain_desc swapchain_desc;
|
||||
struct wined3d_swapchain *swapchain;
|
||||
struct wined3d_wndproc *entry;
|
||||
struct wined3d_output *output;
|
||||
MSG *msg = (MSG *)lparam;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -564,8 +565,13 @@ static LRESULT CALLBACK wined3d_hook_proc(int code, WPARAM wparam, LPARAM lparam
|
|||
|
||||
wined3d_swapchain_get_desc(swapchain, &swapchain_desc);
|
||||
swapchain_desc.windowed = !swapchain_desc.windowed;
|
||||
if (!(output = wined3d_swapchain_get_output(swapchain)))
|
||||
{
|
||||
ERR("Failed to get output from swapchain %p.\n", swapchain);
|
||||
break;
|
||||
}
|
||||
wined3d_swapchain_state_set_fullscreen(&swapchain->state, &swapchain_desc,
|
||||
swapchain->device->wined3d, &swapchain->device->adapter->outputs[0], NULL);
|
||||
swapchain->device->wined3d, output, NULL);
|
||||
|
||||
wined3d_wndproc_mutex_unlock();
|
||||
|
||||
|
|
|
@ -4485,6 +4485,7 @@ struct wined3d_swapchain
|
|||
|
||||
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN;
|
||||
void wined3d_swapchain_cleanup(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
struct wined3d_output * wined3d_swapchain_get_output(const struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
void swapchain_set_max_frame_latency(struct wined3d_swapchain *swapchain,
|
||||
const struct wined3d_device *device) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue