Simplify Direct2D DLLs loading code a little.

Bail out earlier: if d2d1.dll is not there, it doesn't make sense to try to
load dwrite.dll.

Also use Load() return value directly instead of ignoring it and then checking
for IsLoaded().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-11 20:33:27 +00:00
parent 7dec99c0a8
commit c8e27bcaf7

View File

@@ -128,12 +128,10 @@ public:
private:
static bool LoadLibraries()
{
m_dllDirect2d.Load(wxT("d2d1.dll"), wxDL_VERBATIM | wxDL_QUIET);
m_dllDirectWrite.Load(wxT("dwrite.dll"), wxDL_VERBATIM | wxDL_QUIET);
if ( !m_dllDirect2d.Load(wxT("d2d1.dll"), wxDL_VERBATIM | wxDL_QUIET) )
return false;
bool hasDirect2dSupport = m_dllDirect2d.IsLoaded() && m_dllDirectWrite.IsLoaded();
if (!hasDirect2dSupport)
if ( !m_dllDirectWrite.Load(wxT("dwrite.dll"), wxDL_VERBATIM | wxDL_QUIET) )
return false;
#define wxLOAD_FUNC(dll, name) \