Skip to content

Commit

Permalink
Add presentFlags to Present function
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-Taehui committed Feb 1, 2023
1 parent 1848f90 commit 24fc57e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions winrt/lib/drawing/CanvasSwapChain.abi.idl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ namespace Microsoft.Graphics.Canvas
[overload("Present")]
HRESULT PresentWithSyncInterval([in] INT32 syncInterval);

[overload("Present")]
HRESULT PresentWithSyncIntervalAndPresentFlags([in] INT32 syncInterval, [in] INT32 presentFlags);

[overload("ResizeBuffers")]
HRESULT ResizeBuffersWithSize(
[in] Windows.Foundation.Size newSize);
Expand Down
9 changes: 7 additions & 2 deletions winrt/lib/drawing/CanvasSwapChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,15 @@ namespace ABI { namespace Microsoft { namespace Graphics { namespace Canvas

IFACEMETHODIMP CanvasSwapChain::Present()
{
return PresentWithSyncInterval(1);
return PresentWithSyncIntervalAndPresentFlags(1, 0);
}

IFACEMETHODIMP CanvasSwapChain::PresentWithSyncInterval(int32_t syncInterval)
{
return PresentWithSyncIntervalAndPresentFlags(syncInterval, 0);
}

IFACEMETHODIMP CanvasSwapChain::PresentWithSyncIntervalAndPresentFlags(int32_t syncInterval, int32_t presentFlags)
{
return ExceptionBoundary(
[&]
Expand All @@ -450,7 +455,7 @@ namespace ABI { namespace Microsoft { namespace Graphics { namespace Canvas
auto& resource = GetResource();

DXGI_PRESENT_PARAMETERS presentParameters = { 0 };
ThrowIfFailed(resource->Present1(syncInterval, 0, &presentParameters));
ThrowIfFailed(resource->Present1(syncInterval, presentFlags, &presentParameters));
});
}

Expand Down
1 change: 1 addition & 0 deletions winrt/lib/drawing/CanvasSwapChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ namespace ABI { namespace Microsoft { namespace Graphics { namespace Canvas

IFACEMETHOD(Present)() override;
IFACEMETHOD(PresentWithSyncInterval)(int32_t syncInterval) override;
IFACEMETHOD(PresentWithSyncIntervalAndPresentFlags)(int32_t syncInterval, int32_t presentFlags) override;

IFACEMETHOD(ResizeBuffersWithSize)(
Size newSize) override;
Expand Down

0 comments on commit 24fc57e

Please sign in to comment.