From da120d7d1c7f316d89e003d0f81cdbd21cd9028b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 19 Nov 2008 16:13:49 +0100 Subject: Support XINE_GUI_SEND_DRAWABLE_CHANGED in DirectX video driver On XINE_GUI_SEND_DRAWABLE_CHANGED, the clipping area is adjusted to the new HWND and the frame shown again. This allows to switch the window where the video is shown at runtime, simliar to the X11 drivers. --- src/video_out/video_out_directx.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c index dd560a8f6..dda8664ee 100644 --- a/src/video_out/video_out_directx.c +++ b/src/video_out/video_out_directx.c @@ -1157,10 +1157,37 @@ static int win32_gui_data_exchange( vo_driver_t * vo_driver, int data_type, void switch( data_type ) { + case GUI_WIN32_MOVED_OR_RESIZED: UpdateRect( win32_driver->win32_visual ); DisplayFrame( win32_driver ); break; + + case XINE_GUI_SEND_DRAWABLE_CHANGED: + { + HRESULT result; + HWND newWndHnd = (HWND) data; + + /* set cooperative level */ + result = IDirectDraw_SetCooperativeLevel( win32_driver->ddobj, newWndHnd, DDSCL_NORMAL ); + if( result != DD_OK ) + { + Error( 0, "SetCooperativeLevel : error 0x%lx", result ); + return 0; + } + /* associate our clipper with new window */ + result = IDirectDrawClipper_SetHWnd( win32_driver->ddclipper, 0, newWndHnd ); + if( result != DD_OK ) + { + Error( 0, "ddclipper->SetHWnd : error 0x%lx", result ); + return 0; + } + /* store our objects in our visual struct */ + win32_driver->win32_visual->WndHnd = newWndHnd; + /* update video area and redraw current frame */ + UdateRect( win32_driver->win32_visual ); + DisplayFrame( win32_driver ); + break; } return 0; -- cgit v1.2.3