From cde30b290a09bf760de0382d0788957a50b7103e Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Sat, 16 Jan 2021 13:55:42 -0800 Subject: [PATCH] add pointer overload for Buffer.SetData --- src/Buffer.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Buffer.cs b/src/Buffer.cs index c1f610e..782e2a2 100644 --- a/src/Buffer.cs +++ b/src/Buffer.cs @@ -38,6 +38,21 @@ namespace Campari } } + public unsafe void SetData( + uint offsetInBytes, + T* data, + uint dataLengthInBytes + ) where T : unmanaged + { + Refresh.Refresh_SetBufferData( + Device.Handle, + Handle, + offsetInBytes, + (IntPtr) data, + dataLengthInBytes + ); + } + // NOTE: You want to wait on the device before calling this public unsafe void GetData( T[] data,