MoonWorks/src/Graphics/Resources/Sampler.cs

25 lines
551 B
C#
Raw Normal View History

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