Refactor GDK platform to be base for Xbox consoles

This commit is contained in:
Wojtek Figat
2021-08-26 17:28:16 +02:00
parent d9410f9cdd
commit 05fc1b8dd1
14 changed files with 1649 additions and 85 deletions

View File

@@ -198,20 +198,6 @@ GPUDeviceDX12::GPUDeviceDX12(IDXGIFactory4* dxgiFactory, GPUAdapterDX* adapter)
{
}
#if PLATFORM_XBOX_SCARLETT
namespace XboxScarlett
{
extern Action OnSuspend;
extern Action OnResume;
}
#elif PLATFORM_XBOX_ONE
namespace XboxOne
{
extern Action OnSuspend;
extern Action OnResume;
}
#endif
bool GPUDeviceDX12::Init()
{
#if PLATFORM_XBOX_SCARLETT || PLATFORM_XBOX_ONE
@@ -264,12 +250,9 @@ bool GPUDeviceDX12::Init()
LOG(Info, "Hardware Version: {0}", hwVer);
updateFrameEvents();
#if PLATFORM_XBOX_SCARLETT
XboxScarlett::OnSuspend.Bind<GPUDeviceDX12, &GPUDeviceDX12::OnSuspend>(this);
XboxScarlett::OnResume.Bind<GPUDeviceDX12, &GPUDeviceDX12::OnResume>(this);
#elif PLATFORM_XBOX_ONE
XboxOne::OnSuspend.Bind<GPUDeviceDX12, &GPUDeviceDX12::OnSuspend>(this);
XboxOne::OnResume.Bind<GPUDeviceDX12, &GPUDeviceDX12::OnResume>(this);
#if PLATFORM_GDK
GDKPlatform::OnSuspend.Bind<GPUDeviceDX12, &GPUDeviceDX12::OnSuspend>(this);
GDKPlatform::OnResume.Bind<GPUDeviceDX12, &GPUDeviceDX12::OnResume>(this);
#endif
#else
// Get DXGI adapter