d3d: Don't statically import Direct3DCreate9Ex().

This commit is contained in:
Unknown W. Brackets 2014-09-09 23:50:10 -07:00
parent e9b87104ef
commit 22db52dbeb

View File

@ -60,13 +60,12 @@ bool D3D9_Init(HWND hWnd, bool windowed, std::string *error_message) {
HMODULE hD3D9 = LoadLibrary(TEXT("d3d9.dll"));
g_pfnCreate9ex = (DIRECT3DCREATE9EX)GetProcAddress(hD3D9, "Direct3DCreate9Ex");
has9Ex = (g_pfnCreate9ex != NULL);
FreeLibrary(hD3D9);
// For some reason, can't quite get Ex to work right..
// has9Ex = false;
if (has9Ex) {
HRESULT result = Direct3DCreate9Ex(D3D_SDK_VERSION, &d3dEx);
HRESULT result = g_pfnCreate9ex(D3D_SDK_VERSION, &d3dEx);
d3d = d3dEx;
if (FAILED(result)) {
ELOG("Failed to create D3D9Ex context");
@ -79,6 +78,7 @@ bool D3D9_Init(HWND hWnd, bool windowed, std::string *error_message) {
return false;
}
}
FreeLibrary(hD3D9);
D3DCAPS9 d3dCaps;