mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
DX9: Dynamically load d3d9.dll.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6452 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
5ef4167c55
commit
b8218726aa
@ -93,7 +93,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions=""..\..\core\common\win32\release\common.lib""
|
||||
AdditionalDependencies="comctl32.lib d3d9.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib"
|
||||
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib"
|
||||
OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX9.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
@ -203,7 +203,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib d3d9.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib"
|
||||
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib"
|
||||
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
@ -303,7 +303,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions=""..\..\core\common\win32\debug\common.lib""
|
||||
AdditionalDependencies="comctl32.lib d3d9.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28ud.lib wxmsw28ud_core.lib"
|
||||
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28ud.lib wxmsw28ud_core.lib"
|
||||
OutputFile="..\..\..\Binary\Win32/Plugins\Plugin_VideoDX9D.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
@ -401,7 +401,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib d3d9.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28ud.lib wxmsw28ud_core.lib"
|
||||
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28ud.lib wxmsw28ud_core.lib"
|
||||
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9D.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
@ -509,7 +509,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib d3d9.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib"
|
||||
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib"
|
||||
OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX9DF.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
@ -620,7 +620,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib d3d9.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib"
|
||||
AdditionalDependencies="comctl32.lib winmm.lib vfw32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib"
|
||||
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9DF.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
|
@ -27,6 +27,10 @@ D3DXSAVESURFACETOFILEATYPE PD3DXSaveSurfaceToFileA = NULL;
|
||||
D3DXSAVETEXTURETOFILEATYPE PD3DXSaveTextureToFileA = NULL;
|
||||
D3DXCOMPILESHADERTYPE PD3DXCompileShader = NULL;
|
||||
|
||||
typedef IDirect3D9* (WINAPI* DIRECT3DCREATE9)(UINT);
|
||||
DIRECT3DCREATE9 PDirect3DCreate9 = NULL;
|
||||
HINSTANCE hD3DDll = NULL;
|
||||
|
||||
namespace D3D
|
||||
{
|
||||
|
||||
@ -89,8 +93,17 @@ bool IsATIDevice()
|
||||
|
||||
HRESULT Init()
|
||||
{
|
||||
hD3DDll = LoadLibraryA("d3d9.dll");
|
||||
if (!hD3DDll)
|
||||
{
|
||||
MessageBoxA(NULL, "Failed to load d3d9.dll", "Critical error", MB_OK | MB_ICONERROR);
|
||||
return E_FAIL;
|
||||
}
|
||||
PDirect3DCreate9 = (DIRECT3DCREATE9)GetProcAddress(hD3DDll, "Direct3DCreate9");
|
||||
if (PDirect3DCreate9 == NULL) MessageBoxA(NULL, "GetProcAddress failed for Direct3DCreate9!", "Critical error", MB_OK | MB_ICONERROR);
|
||||
|
||||
// Create the D3D object, which is needed to create the D3DDevice.
|
||||
D3D = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
D3D = PDirect3DCreate9(D3D_SDK_VERSION);
|
||||
if (!D3D)
|
||||
return E_FAIL;
|
||||
Enumerate();
|
||||
@ -100,7 +113,10 @@ HRESULT Init()
|
||||
void Shutdown()
|
||||
{
|
||||
D3D->Release();
|
||||
D3D = 0;
|
||||
D3D = NULL;
|
||||
|
||||
if (hD3DDll) FreeLibrary(hD3DDll);
|
||||
PDirect3DCreate9 = NULL;
|
||||
}
|
||||
|
||||
void EnableAlphaToCoverage()
|
||||
|
Loading…
Reference in New Issue
Block a user