summaryrefslogtreecommitdiffstats
path: root/video/out/vo_direct3d.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-26 20:27:03 +0200
committerwm4 <wm4@nowhere>2014-07-26 20:27:03 +0200
commitb3169390f5b63fb61fb244f603e1ecc26f9e85f9 (patch)
treedbc0e03a52b2856c6519813ecaf012534e45c4c9 /video/out/vo_direct3d.c
parent7077526ffbb95368f1a7cf05e9b3230e9488eb7e (diff)
downloadmpv-b3169390f5b63fb61fb244f603e1ecc26f9e85f9.tar.bz2
mpv-b3169390f5b63fb61fb244f603e1ecc26f9e85f9.tar.xz
win32: make private struct private, refactor
Preparation for moving win32 windowing to a separate thread. The codesize is reduced a bit, because some small functions are inlined, which reduces noise. The main change is that now most functions use the private struct directly, instead of accessing it indirectly through vo->w32. Accesses to vo are minimalized. The final goal is adding some sort of new windowing backend API. It would be cleaner to use that as context pointer for all functions (like struct vo was previously used), but since this is work in progress, we just go with this commit.
Diffstat (limited to 'video/out/vo_direct3d.c')
-rw-r--r--video/out/vo_direct3d.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 902d437ce3..032454eb3f 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -674,7 +674,7 @@ static void fill_d3d_presentparams(d3d_priv *priv,
present_params->SwapEffect =
priv->opt_swap_discard ? D3DSWAPEFFECT_DISCARD : D3DSWAPEFFECT_COPY;
present_params->Flags = D3DPRESENTFLAG_VIDEO;
- present_params->hDeviceWindow = priv->vo->w32->window;
+ present_params->hDeviceWindow = vo_w32_hwnd(priv->vo);
present_params->BackBufferWidth = priv->cur_backbuf_width;
present_params->BackBufferHeight = priv->cur_backbuf_height;
present_params->MultiSampleType = D3DMULTISAMPLE_NONE;
@@ -713,7 +713,7 @@ static bool change_d3d_backbuffer(d3d_priv *priv)
if (!priv->d3d_device) {
if (FAILED(IDirect3D9_CreateDevice(priv->d3d_handle,
D3DADAPTER_DEFAULT,
- DEVTYPE, priv->vo->w32->window,
+ DEVTYPE, vo_w32_hwnd(priv->vo),
D3DCREATE_SOFTWARE_VERTEXPROCESSING
| D3DCREATE_FPU_PRESERVE,
&present_params, &priv->d3d_device)))
@@ -1479,9 +1479,9 @@ static mp_image_t *get_window_screenshot(d3d_priv *priv)
goto error_exit;
}
- GetClientRect(priv->vo->w32->window, &window_rc);
+ GetClientRect(vo_w32_hwnd(priv->vo), &window_rc);
pt = (POINT) { 0, 0 };
- ClientToScreen(priv->vo->w32->window, &pt);
+ ClientToScreen(vo_w32_hwnd(priv->vo), &pt);
window_rc.left = pt.x;
window_rc.top = pt.y;
window_rc.right += window_rc.left;