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

Method DWriteWrapper

BG3Extender/Extender/Shared/DWriteWrapper.cpp:8–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6std::unique_ptr<DWriteWrapper> gDWriteWrapper;
7
8DWriteWrapper::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
34DWriteWrapper::~DWriteWrapper()
35{

Callers

nothing calls this directly

Calls 1

FailFunction · 0.85

Tested by

no test coverage detected