Move shared logic between UWP/WinUI 3 samples to shared project

このコミットが含まれているのは:
Sergio Pedri committed 2021-11-21 13:24:02 +01:00
1 親 d9fa15a880
コミット a7e3213fd8
20ファイル変更
+86 -283

検索条件に一致するファイルはありません

-31
ファイルの表示
@@ -1,31 +0,0 @@
using System;
using System.IO;
using ComputeSharp.SwapChain.Shaders;
using ComputeSharp.WinUI;
using Windows.ApplicationModel;
namespace ComputeSharp.SwapChain.WinUI.Shaders.Runners;
/// <summary>
/// A specialized <see cref="IShaderRunner"/> for <see cref="ContouredLayers"/>.
/// </summary>
public sealed class ContouredLayersRunner : IShaderRunner
{
/// <summary>
/// A texture for <c>\Textures\RustyMetal.png</c>.
/// </summary>
private ReadOnlyTexture2D<Rgba32, Float4>? texture;
/// <inheritdoc/>
public void Execute(IReadWriteTexture2D<Float4> texture, TimeSpan timespan)
{
if (this.texture is null)
{
string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png");
this.texture = Gpu.Default.LoadReadOnlyTexture2D<Rgba32, Float4>(filename);
}
Gpu.Default.ForEach(texture, new ContouredLayers((float)timespan.TotalSeconds, this.texture));
}
}