summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Brad Hughes <bradhugh@outlook.com>2016-11-18 14:42:54 -0500
committer Brad Hughes <bradhugh@outlook.com>2016-11-20 13:41:46 -0500
commit3ca391bb3a99a88ceb4f30dc23fd2734798db668 (patch)
treef8964a1feea998879b87c190fbf7f550cb7edde6
parent78a30a25b076c43a0ed855d55e67eb806dcb64ed (diff)
Update dwrite debugging functions with DYNAMIC_API (nw)
-rw-r--r--src/osd/modules/font/font_dwrite.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/osd/modules/font/font_dwrite.cpp b/src/osd/modules/font/font_dwrite.cpp
index d028c345392..1efc48b79d7 100644
--- a/src/osd/modules/font/font_dwrite.cpp
+++ b/src/osd/modules/font/font_dwrite.cpp
@@ -94,17 +94,11 @@ HRESULT SaveBitmap(IWICBitmap* bitmap, GUID pixelFormat, const WCHAR *filename)
ComPtr<IDWriteFactory> dwriteFactory;
ComPtr<IWICImagingFactory> wicFactory;
- osd::dynamic_module::ptr d2d1_dll = osd::dynamic_module::open({ "d2d1.dll" });
- osd::dynamic_module::ptr dwrite_dll = osd::dynamic_module::open({ "dwrite.dll" });
-
- d2d_create_factory_fn pfn_D2D1CreateFactory = d2d1_dll->bind<d2d_create_factory_fn>("D2D1CreateFactory");
- dwrite_create_factory_fn pfn_DWriteCreateFactory = dwrite_dll->bind<dwrite_create_factory_fn>("DWriteCreateFactory");
-
- if (!pfn_D2D1CreateFactory || !pfn_DWriteCreateFactory)
+ if (!DYNAMIC_API_TEST(d2d1, D2D1CreateFactory) || !DYNAMIC_API_TEST(dwrite, DWriteCreateFactory))
return ERROR_DLL_NOT_FOUND;
// Create a Direct2D factory
- HR_RETHR((*pfn_D2D1CreateFactory)(
+ HR_RETHR(DYNAMIC_CALL(d2d1, D2D1CreateFactory,
D2D1_FACTORY_TYPE_SINGLE_THREADED,
__uuidof(ID2D1Factory1),
nullptr,
@@ -114,7 +108,7 @@ HRESULT SaveBitmap(IWICBitmap* bitmap, GUID pixelFormat, const WCHAR *filename)
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
// Create a DirectWrite factory.
- HR_RETHR((*pfn_DWriteCreateFactory)(
+ HR_RETHR(DYNAMIC_CALL(dwrite, DWriteCreateFactory,
DWRITE_FACTORY_TYPE_SHARED,
__uuidof(IDWriteFactory),
reinterpret_cast<IUnknown **>(dwriteFactory.GetAddressOf())));