diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-03-31 23:43:02 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-03-31 23:43:02 +0000 |
| commit | a8a3940fa4491963048ade02dcb035eaca4b6eb5 (patch) | |
| tree | a504b665ab7792eb970b8aecc535edbb4d814de4 /Graphics | |
| parent | Some minor updates to d3d swap chain (diff) | |
| download | DiligentCore-a8a3940fa4491963048ade02dcb035eaca4b6eb5.tar.gz DiligentCore-a8a3940fa4491963048ade02dcb035eaca4b6eb5.zip | |
Added sync interval parameter to ISwapChain::Present()
Diffstat (limited to 'Graphics')
9 files changed, 11 insertions, 13 deletions
diff --git a/Graphics/GraphicsEngine/interface/SwapChain.h b/Graphics/GraphicsEngine/interface/SwapChain.h index 87830be0..578d4fdb 100644 --- a/Graphics/GraphicsEngine/interface/SwapChain.h +++ b/Graphics/GraphicsEngine/interface/SwapChain.h @@ -43,8 +43,8 @@ class ISwapChain : public IObject { public: - /// Presents a rendered image to the user. - virtual void Present() = 0; + /// Presents a rendered image to the user + virtual void Present(Uint32 SyncInterval = 1) = 0; /// Returns the swap chain desctription virtual const SwapChainDesc& GetDesc()const = 0; diff --git a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h index 5f5fe4fe..f1ea1a4d 100644 --- a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h @@ -48,7 +48,7 @@ public: virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; - virtual void Present()override final; + virtual void Present(Uint32 SyncInterval)override final; virtual void Resize( Uint32 NewWidth, Uint32 NewHeight )override final; virtual IDXGISwapChain *GetDXGISwapChain()override final{ return m_pSwapChain; } diff --git a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp index ca5faf08..5229b504 100644 --- a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp @@ -95,9 +95,8 @@ void SwapChainD3D11Impl::CreateRTVandDSV() IMPLEMENT_QUERY_INTERFACE( SwapChainD3D11Impl, IID_SwapChainD3D11, TSwapChainBase ) -void SwapChainD3D11Impl::Present() +void SwapChainD3D11Impl::Present(Uint32 SyncInterval) { - UINT SyncInterval = 0; #if PLATFORM_UNIVERSAL_WINDOWS SyncInterval = 1; // Interval 0 is not supported on Windows Phone #endif diff --git a/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h index 01d814b8..3b1f21a1 100644 --- a/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h @@ -50,8 +50,8 @@ public: virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface ); - virtual void Present(); - virtual void Resize( Uint32 NewWidth, Uint32 NewHeight ); + virtual void Present(Uint32 SyncInterval)override final; + virtual void Resize( Uint32 NewWidth, Uint32 NewHeight )override final; virtual IDXGISwapChain* GetDXGISwapChain()override final{ return m_pSwapChain; } virtual ITextureViewD3D12* GetCurrentBackBufferRTV()override final; diff --git a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp index 6078f6a2..8e5beb12 100644 --- a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp @@ -100,9 +100,8 @@ void SwapChainD3D12Impl::InitBuffersAndViews() IMPLEMENT_QUERY_INTERFACE( SwapChainD3D12Impl, IID_SwapChainD3D12, TSwapChainBase ) -void SwapChainD3D12Impl::Present() +void SwapChainD3D12Impl::Present(Uint32 SyncInterval) { - UINT SyncInterval = 0; #if PLATFORM_UNIVERSAL_WINDOWS SyncInterval = 1; // Interval 0 is not supported on Windows Phone #endif diff --git a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.h b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.h index 4f91e2f8..141d7c4f 100644 --- a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.h +++ b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.h @@ -47,7 +47,7 @@ public: virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; - virtual void Present()override final; + virtual void Present(Uint32 SyncInterval)override final; virtual void Resize( Uint32 NewWidth, Uint32 NewHeight )override final; diff --git a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLImpl.h index 7cfca2da..85137adc 100644 --- a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLImpl.h @@ -47,7 +47,7 @@ public: virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; - virtual void Present()override final; + virtual void Present(Uint32 SyncInterval)override final; virtual void Resize( Uint32 NewWidth, Uint32 NewHeight )override final; diff --git a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLIOS.mm b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLIOS.mm index b56ed277..679ea021 100644 --- a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLIOS.mm +++ b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLIOS.mm @@ -50,7 +50,7 @@ SwapChainGLIOS::SwapChainGLIOS(IReferenceCounters *pRefCounters, IMPLEMENT_QUERY_INTERFACE( SwapChainGLIOS, IID_SwapChainGL, TSwapChainBase ) -void SwapChainGLIOS::Present() +void SwapChainGLIOS::Present(Uint32 SyncInterval) { EAGLContext* context = [EAGLContext currentContext]; glBindRenderbuffer(GL_RENDERBUFFER, m_ColorRenderBuffer); diff --git a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp index e9349f7b..bebaacb3 100644 --- a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp @@ -69,7 +69,7 @@ SwapChainGLImpl::~SwapChainGLImpl() IMPLEMENT_QUERY_INTERFACE( SwapChainGLImpl, IID_SwapChainGL, TSwapChainBase ) -void SwapChainGLImpl::Present() +void SwapChainGLImpl::Present(Uint32 SyncInterval) { #if PLATFORM_WIN32 || PLATFORM_LINUX || PLATFORM_ANDROID auto *pDeviceGL = ValidatedCast<RenderDeviceGLImpl>(m_pRenderDevice.RawPtr()); |
