1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00
dxvk/src/dxgi/dxgi_main.cpp

37 lines
1008 B
C++

#include "dxgi_factory.h"
#include "dxgi_include.h"
namespace dxvk {
Logger Logger::s_instance("dxgi.log");
HRESULT createDxgiFactory(UINT Flags, REFIID riid, void **ppFactory) {
try {
Com<DxgiFactory> factory = new DxgiFactory(Flags);
HRESULT hr = factory->QueryInterface(riid, ppFactory);
if (FAILED(hr))
return hr;
return S_OK;
} catch (const DxvkError& e) {
Logger::err(e.message());
return E_FAIL;
}
}
}
extern "C" {
DLLEXPORT HRESULT __stdcall CreateDXGIFactory2(UINT Flags, REFIID riid, void **ppFactory) {
dxvk::Logger::warn("CreateDXGIFactory2: Ignoring flags");
return dxvk::createDxgiFactory(Flags, riid, ppFactory);
}
DLLEXPORT HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **ppFactory) {
return dxvk::createDxgiFactory(0, riid, ppFactory);
}
DLLEXPORT HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **ppFactory) {
return dxvk::createDxgiFactory(0, riid, ppFactory);
}
}