diff options
author | Matthias Ringwald <mringwa@inf.ethz.ch> | 2008-11-19 16:13:49 +0100 |
---|---|---|
committer | Matthias Ringwald <mringwa@inf.ethz.ch> | 2008-11-19 16:13:49 +0100 |
commit | da120d7d1c7f316d89e003d0f81cdbd21cd9028b (patch) | |
tree | 6bf153ca3cab9e5afd920e8cfff565dc190659d7 | |
parent | e35d7b728efb0bc890ad175f7c2ae41b2431cea3 (diff) | |
download | xine-lib-da120d7d1c7f316d89e003d0f81cdbd21cd9028b.tar.gz xine-lib-da120d7d1c7f316d89e003d0f81cdbd21cd9028b.tar.bz2 |
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.
-rw-r--r-- | src/video_out/video_out_directx.c | 27 |
1 files changed, 27 insertions, 0 deletions
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; |