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
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions=""..\..\core\common\win32\release\common.lib""
|
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"
|
OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX9.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
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"
|
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
|
@ -303,7 +303,7 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions=""..\..\core\common\win32\debug\common.lib""
|
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"
|
OutputFile="..\..\..\Binary\Win32/Plugins\Plugin_VideoDX9D.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
|
@ -401,7 +401,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
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"
|
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9D.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
|
@ -509,7 +509,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
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"
|
OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX9DF.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
|
@ -620,7 +620,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
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"
|
OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX9DF.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
|
|
|
@ -27,6 +27,10 @@ D3DXSAVESURFACETOFILEATYPE PD3DXSaveSurfaceToFileA = NULL;
|
||||||
D3DXSAVETEXTURETOFILEATYPE PD3DXSaveTextureToFileA = NULL;
|
D3DXSAVETEXTURETOFILEATYPE PD3DXSaveTextureToFileA = NULL;
|
||||||
D3DXCOMPILESHADERTYPE PD3DXCompileShader = NULL;
|
D3DXCOMPILESHADERTYPE PD3DXCompileShader = NULL;
|
||||||
|
|
||||||
|
typedef IDirect3D9* (WINAPI* DIRECT3DCREATE9)(UINT);
|
||||||
|
DIRECT3DCREATE9 PDirect3DCreate9 = NULL;
|
||||||
|
HINSTANCE hD3DDll = NULL;
|
||||||
|
|
||||||
namespace D3D
|
namespace D3D
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -89,8 +93,17 @@ bool IsATIDevice()
|
||||||
|
|
||||||
HRESULT Init()
|
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.
|
// Create the D3D object, which is needed to create the D3DDevice.
|
||||||
D3D = Direct3DCreate9(D3D_SDK_VERSION);
|
D3D = PDirect3DCreate9(D3D_SDK_VERSION);
|
||||||
if (!D3D)
|
if (!D3D)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
Enumerate();
|
Enumerate();
|
||||||
|
@ -100,7 +113,10 @@ HRESULT Init()
|
||||||
void Shutdown()
|
void Shutdown()
|
||||||
{
|
{
|
||||||
D3D->Release();
|
D3D->Release();
|
||||||
D3D = 0;
|
D3D = NULL;
|
||||||
|
|
||||||
|
if (hD3DDll) FreeLibrary(hD3DDll);
|
||||||
|
PDirect3DCreate9 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnableAlphaToCoverage()
|
void EnableAlphaToCoverage()
|
||||||
|
|
Loading…
Reference in New Issue