| 6 | std::unique_ptr<DWriteWrapper> gDWriteWrapper; |
| 7 | |
| 8 | DWriteWrapper::DWriteWrapper() |
| 9 | { |
| 10 | TCHAR dllPath[1024 + 64]; |
| 11 | DWORD dllPathSize = GetSystemDirectory(dllPath, 1024); |
| 12 | if (dllPathSize == 0) |
| 13 | { |
| 14 | Fail("Could not get system directory path"); |
| 15 | } |
| 16 | |
| 17 | wcscpy_s(dllPath + dllPathSize, std::size(dllPath) - dllPathSize, L"\\DWrite.dll"); |
| 18 | |
| 19 | dllHandle = LoadLibrary(dllPath); |
| 20 | if (dllHandle == NULL) { |
| 21 | Fail("Could not load DWrite.dll"); |
| 22 | } |
| 23 | |
| 24 | CreateFactory = (DWriteCreateFactoryProc)GetProcAddress(dllHandle, "DWriteCreateFactory"); |
| 25 | |
| 26 | if (CreateFactory == NULL) |
| 27 | { |
| 28 | Fail("Could not locate DWriteCreateFactory in DWrite.dll"); |
| 29 | } |
| 30 | |
| 31 | DEBUG("DWrite exports successfully mapped"); |
| 32 | } |
| 33 | |
| 34 | DWriteWrapper::~DWriteWrapper() |
| 35 | { |