From 2145e87ae072165ea7547866aeaa0f62e89ccec3 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Mon, 18 Jan 2021 17:53:07 -0800 Subject: [PATCH] add convenience method for presenting a whole texture --- src/CommandBuffer.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/CommandBuffer.cs b/src/CommandBuffer.cs index f827ffb..7a1421c 100644 --- a/src/CommandBuffer.cs +++ b/src/CommandBuffer.cs @@ -352,6 +352,34 @@ namespace Campari ); } + public void QueuePresent( + Texture texture, + Refresh.Filter filter + ) { + var refreshTextureSlice = new Refresh.TextureSlice + { + texture = texture.Handle, + rectangle = new Refresh.Rect + { + x = 0, + y = 0, + w = (int) texture.Width, + h = (int) texture.Height + }, + layer = 0, + level = 0, + depth = 0 + }; + + Refresh.Refresh_QueuePresent( + Device.Handle, + Handle, + ref refreshTextureSlice, + IntPtr.Zero, + filter + ); + } + public void CopyTextureToTexture( ref TextureSlice sourceTextureSlice, ref TextureSlice destinationTextureSlice,