From 22db52dbebe6598fceac26775d0679d36b7b0f85 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 9 Sep 2014 23:50:10 -0700 Subject: [PATCH] d3d: Don't statically import Direct3DCreate9Ex(). --- Windows/D3D9Base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Windows/D3D9Base.cpp b/Windows/D3D9Base.cpp index 04c62eb5a..fdffcdb5a 100644 --- a/Windows/D3D9Base.cpp +++ b/Windows/D3D9Base.cpp @@ -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;