* Disable GSdx's internal AspectRatio setting when using GSOpen2 (pcsx2 0.9.7 controls aspect ratios internally now)
 * DX10 should be able to startup in fullscreen mode now, without needing to hit alt-enter (legacy 0.9.6 versions only)
 * Added some comments for a failed attempt to disable DX10's default Alt-Enter behavior.  If someone knows how to do that properly, please feel free to submit a patch because DX10/Com breaks my mind. (see GSDevice10.cpp)
 * Remove DX11 for now since it's entirely unfinished anyway.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2279 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-12-01 05:59:43 +00:00
parent 3dfdf5029c
commit a34c09fe01
6 changed files with 43 additions and 16 deletions

View File

@ -159,8 +159,8 @@ static INT32 _GSopen(void* dsp, char* title, int renderer)
default:
case 0: case 1: case 2: dev = new GSDevice9(); break;
case 3: case 4: case 5: dev = new GSDevice10(); break;
case 6: case 7: case 8: dev = new GSDevice11(); break;
#if 0
case 6: case 7: case 8: dev = new GSDevice11(); break;
case 9: case 10: case 11: dev = new GSDeviceOGL(); break;
#endif
case 12: case 13: new GSDeviceNull(); break;
@ -175,8 +175,8 @@ static INT32 _GSopen(void* dsp, char* title, int renderer)
default:
case 0: s_gs = new GSRendererDX9(); break;
case 3: s_gs = new GSRendererDX10(); break;
case 6: s_gs = new GSRendererDX11(); break;
#if 0
case 6: s_gs = new GSRendererDX11(); break;
case 9: s_gs = new GSRendererOGL(); break;
#endif
case 2: case 5: case 8: case 11: case 13:
@ -238,7 +238,8 @@ static INT32 _GSopen(void* dsp, char* title, int renderer)
EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
{
theApp.SetConfig("windowed", flags & 1);
theApp.SetConfig("vsync", flags & 2);
//theApp.SetConfig("vsync", flags & 2);
//theApp.SetConfig("aspectratio", 0);
int renderer = theApp.GetConfig("renderer", 0);
if( flags & 4 )
@ -246,7 +247,11 @@ EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
renderer = 1;
}
return _GSopen( dsp, NULL, renderer );
INT32 retval = _GSopen( dsp, NULL, renderer );
s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios
s_gs->SetVsync(flags & 2);
return retval;
}
EXPORT_C_(INT32) GSopen(void* dsp, char* title, int mt)
@ -321,16 +326,18 @@ EXPORT_C GSvsync(int field)
{
#ifdef _WINDOWS
MSG msg;
memset(&msg, 0, sizeof(msg));
while(msg.message != WM_QUIT && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
if( s_gs->m_wnd.IsManaged() )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
MSG msg;
memset(&msg, 0, sizeof(msg));
while(msg.message != WM_QUIT && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
#endif
s_gs->VSync(field);

View File

@ -56,6 +56,16 @@ bool GSDevice10::Create(GSWnd* wnd)
memset(&scd, 0, sizeof(scd));
// FIXME : Someone with a brain for DX10 and COM figure out how to make this IDXGIFactory
// call mess work. I fail at this stuff. Thanks! --air
// Also... should this be GS plugin territory, or should we incorporate it into PCSX2?
// (I'm thinking a dynamic loading of the DXGI dll, and general invocation that way).
//CComPtr<IDXGIFactory> pFactory;
//hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)(&pFactory) );
//pFactory->MakeWindowAssociation( (HWND)m_wnd->GetHandle(), DXGI_MWA_NO_WINDOW_CHANGES );
scd.BufferCount = 2;
scd.BufferDesc.Width = 1;
scd.BufferDesc.Height = 1;
@ -66,7 +76,7 @@ bool GSDevice10::Create(GSWnd* wnd)
scd.OutputWindow = (HWND)m_wnd->GetHandle();
scd.SampleDesc.Count = 1;
scd.SampleDesc.Quality = 0;
scd.Windowed = TRUE;
scd.Windowed = !!theApp.GetConfig("windowed", 1);
// Crashes when 2 threads work on the swapchain, as in pcsx2/wx when it provides us
// an external window handle (which could be attached to any thread other than the GS one).

View File

@ -281,6 +281,13 @@ void GSRenderer::SetFrameLimit(bool limit)
if( m_dev ) m_dev->SetVsync(m_vsync && m_framelimit);
}
void GSRenderer::SetVsync(bool enabled)
{
m_vsync = enabled;
if( m_dev ) m_dev->SetVsync(m_vsync && m_framelimit);
}
void GSRenderer::VSync(int field)
{
GSPerfMonAutoTimer pmat(m_perfmon);
@ -341,6 +348,7 @@ void GSRenderer::VSync(int field)
if( !m_wnd.SetWindowText(s.c_str()) )
{
// [TODO]
// We don't have window title rights, or the window has no title,
// so let's use actual OSD!
}

View File

@ -95,6 +95,8 @@ public:
return m_upscale_multiplier;
}
void SetAspectRatio(int aspect) { m_aspectratio = aspect; }
void SetVsync(bool enabled);
void SetFrameLimit(bool limit);
// TODO : Implement proper locking here *if needed* (not sure yet if it is) --air

View File

@ -33,10 +33,10 @@ GSSetting GSSettingsDlg::g_renderers[] =
{3, "Direct3D10 (Hardware)", NULL},
{4, "Direct3D10 (Software)", NULL},
{5, "Direct3D10 (Null)", NULL},
#if 0
{6, "Direct3D11 (Hardware)", NULL},
{7, "Direct3D11 (Software)", NULL},
{8, "Direct3D11 (Null)", NULL},
#if 0
{9, "OpenGL (Hardware)", NULL},
{10, "OpenGL (Software)", NULL},
{11, "OpenGL (Null)", NULL},
@ -112,7 +112,7 @@ void GSSettingsDlg::OnInit()
}
bool isdx10avail = GSUtil::IsDirect3D10Available();
bool isdx11avail = GSUtil::IsDirect3D11Available();
bool isdx11avail = false; //GSUtil::IsDirect3D11Available();
vector<GSSetting> renderers;

View File

@ -16,7 +16,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="JITProfiling.lib d3d11.lib d3dx11.lib d3d10_1.lib d3dx10.lib d3d9.lib d3dx9.lib ddraw.lib dxguid.lib winmm.lib strmiids.lib xinput.lib cg.lib cgGL.lib glut32.lib glew_static.lib"
AdditionalDependencies="JITProfiling.lib d3d11.lib d3dx11.lib d3d10_1.lib d3dx10.lib d3d9.lib d3dx9.lib dxgi.lib ddraw.lib dxguid.lib winmm.lib strmiids.lib xinput.lib cg.lib cgGL.lib glut32.lib glew_static.lib"
OutputFile="$(OutDir)\$(ProjectName)-$(SSEtype).dll"
AdditionalLibraryDirectories="./vtune"
DelayLoadDLLs="d3d9.dll;d3dx9_42.dll;d3d10.dll;d3d10_1.dll;d3dx10_42.dll;d3d11.dll;d3dx11_42.dll;cg.dll;cgGL.dll;glut32.dll"