Commit 65004d0c authored by gbazin's avatar gbazin

* modules/gui/skins2/win32/*: dynamically load AlphaBlend() as it isn't available on Win9x,NT4.

   Parent window created outside the screen so it isn't visible.

Could somebody (AsMaX, ipkiss) have a look at the AlphaBlend() function call in win32_graphics.cpp ? I'd like to use the AlphaBlend() we got from win32_factory.cpp.
parent 02d6bac4
......@@ -2,7 +2,7 @@
* win32_factory.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_factory.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
* $Id: win32_factory.cpp,v 1.2 2004/01/27 17:01:51 gbazin Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -79,7 +79,7 @@ LRESULT CALLBACK Win32Proc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
Win32Factory::Win32Factory( intf_thread_t *pIntf ):
OSFactory( pIntf ), TransparentBlt( NULL ),
OSFactory( pIntf ), TransparentBlt( NULL ), AlphaBlend( NULL ),
SetLayeredWindowAttributes( NULL )
{
// see init()
......@@ -124,8 +124,7 @@ bool Win32Factory::init()
// Create Window
m_hParentWindow = CreateWindowEx( WS_EX_APPWINDOW, "SkinWindowClass",
"VLC Media Player", WS_SYSMENU, 0, 0, 0, 0, 0, 0,
m_hInst, NULL );
"VLC media player", WS_SYSMENU, -200, -200, 0, 0, 0, 0, m_hInst, 0 );
if( m_hParentWindow == NULL )
{
msg_Err( getIntf(), "Cannot create parent window" );
......@@ -157,6 +156,15 @@ bool Win32Factory::init()
msg_Dbg( getIntf(), "Couldn't find TransparentBlt(), "
"falling back to BitBlt()" );
}
if( !m_hMsimg32 ||
!( AlphaBlend =
(BOOL (WINAPI*)( HDC, int, int, int, int, HDC, int, int,
int, int, BLENDFUNCTION ))
GetProcAddress( m_hMsimg32, "AlphaBlend" ) ) )
{
AlphaBlend = NULL;
msg_Dbg( getIntf(), "Couldn't find AlphaBlend()" );
}
// Idem for user32.dll and SetLayeredWindowAttributes()
m_hUser32 = LoadLibrary( "user32.dll" );
......
......@@ -2,7 +2,7 @@
* win32_factory.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_factory.hpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
* $Id: win32_factory.hpp,v 1.2 2004/01/27 17:01:51 gbazin Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -80,10 +80,13 @@ class Win32Factory: public OSFactory
/// Functions dynamically loaded from the dll, because they don't exist
/// on win9x
/// on Win9x/NT4
// We dynamically load msimg32.dll to get a pointer to TransparentBlt()
BOOL (WINAPI *TransparentBlt)( HDC, int, int, int, int,
HDC, int, int, int, int, UINT );
BOOL (WINAPI *AlphaBlend)( HDC, int, int, int, int, HDC, int, int,
int, int, BLENDFUNCTION );
// Idem for user32.dll and SetLayeredWindowAttributes()
BOOL (WINAPI *SetLayeredWindowAttributes)( HWND, COLORREF,
BYTE, DWORD );
......
......@@ -2,7 +2,7 @@
* win32_graphics.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_graphics.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
* $Id: win32_graphics.cpp,v 1.2 2004/01/27 17:01:51 gbazin Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -179,14 +179,17 @@ void Win32Graphics::drawBitmap( const GenericBitmap &rBitmap,
bf.AlphaFormat = AC_SRC_ALPHA;
// Blend the image onto the internal DC
if( !AlphaBlend( m_hDC, xDest, yDest, width, height, hDC, 0, 0,
if( 1/*AlphaBlend*/ &&
!AlphaBlend( m_hDC, xDest, yDest, width, height, hDC, 0, 0,
width, height, bf ) )
{
msg_Err( getIntf(), "AlphaBlend() failed" );
}
// Copy the image onto the internal DC
// BitBlt( m_hDC, xDest, yDest, width, height, hDC, 0, 0, SRCCOPY );
else if( 1/*!AlphaBlend*/ )
{
// Copy the image onto the internal DC
BitBlt( m_hDC, xDest, yDest, width, height, hDC, 0, 0, SRCCOPY );
}
// Add the bitmap mask to the global graphics mask
CombineRgn( m_mask, m_mask, mask, RGN_OR );
......
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