MoonWorks/src/Graphics/Resources/Sampler.cs

24 lines
505 B
C#
Raw Normal View History

2022-02-23 05:14:32 +00:00
using System;
2024-06-05 19:34:24 +00:00
using RefreshCS;
2024-06-05 02:35:17 +00:00
namespace MoonWorks.Graphics;
/// <summary>
/// A sampler specifies how a texture will be sampled in a shader.
/// </summary>
2024-06-05 19:34:24 +00:00
public class Sampler : RefreshResource
{
2024-06-05 19:34:24 +00:00
protected override Action<IntPtr, IntPtr> ReleaseFunction => Refresh.Refresh_ReleaseSampler;
2024-06-05 02:35:17 +00:00
public Sampler(
GraphicsDevice device,
in SamplerCreateInfo samplerCreateInfo
) : base(device)
{
2024-06-05 19:34:24 +00:00
Handle = Refresh.Refresh_CreateSampler(
2024-06-05 02:35:17 +00:00
device.Handle,
2024-06-05 19:34:24 +00:00
samplerCreateInfo.ToRefresh()
2024-06-05 02:35:17 +00:00
);
2022-02-23 05:14:32 +00:00
}
}