MCPcopy Create free account
hub / github.com/Norbyte/bg3se / DWriteWrapper

Method DWriteWrapper

BG3Updater/DWriteWrapper.cpp:9–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

FailFunction · 0.85

Tested by

no test coverage detected