MCPcopy Create free account
hub / github.com/Norbyte/ositools / DxgiWrapper

Method DxgiWrapper

OsiLoader/DxgiWrapper.cpp:6–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4std::unique_ptr<DxgiWrapper> gDxgiWrapper;
5
6DxgiWrapper::DxgiWrapper()
7{
8 TCHAR dxgiPath[1024 + 64];
9 DWORD dxgiPathSize = GetSystemDirectory(dxgiPath, 1024);
10 if (dxgiPathSize == 0)
11 {
12 Fail("Could not get system directory path");
13 }
14
15 wcscpy_s(dxgiPath + dxgiPathSize, 1024 + 64 - dxgiPathSize, L"\\dxgi.dll");
16
17 dxgiHandle = LoadLibrary(dxgiPath);
18 if (dxgiHandle == NULL)
19 {
20 Fail("Could not load dxgi.dll");
21 }
22
23 createDXGIFactory = (CreateDXGIFactoryProc)GetProcAddress(dxgiHandle, "CreateDXGIFactory");
24 createDXGIFactory1 = (CreateDXGIFactoryProc)GetProcAddress(dxgiHandle, "CreateDXGIFactory1");
25 createDXGIFactory2 = (CreateDXGIFactory2Proc)GetProcAddress(dxgiHandle, "CreateDXGIFactory2");
26
27 if (createDXGIFactory == NULL)
28 {
29 Fail("Could not locate CreateDXGIFactory in dxgi.dll");
30 }
31}
32
33DxgiWrapper::~DxgiWrapper()
34{

Callers

nothing calls this directly

Calls 1

FailFunction · 0.70

Tested by

no test coverage detected