MoonWorks/src/Graphics/Resources/Sampler.cs

24 lines
500 B
C#
Raw Normal View History

2022-02-23 05:14:32 +00:00
using System;
2024-06-05 02:35:17 +00:00
using SDL2_gpuCS;
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>
public class Sampler : SDL_GpuResource
{
2024-06-05 02:35:17 +00:00
protected override Action<IntPtr, IntPtr> ReleaseFunction => SDL_Gpu.SDL_GpuReleaseSampler;
2024-06-05 02:35:17 +00:00
public Sampler(
GraphicsDevice device,
in SamplerCreateInfo samplerCreateInfo
) : base(device)
{
Handle = SDL_Gpu.SDL_GpuCreateSampler(
device.Handle,
samplerCreateInfo.ToSDL()
);
2022-02-23 05:14:32 +00:00
}
}