2022-02-23 05:14:32 +00:00
|
|
|
|
using System;
|
2024-06-05 02:35:17 +00:00
|
|
|
|
using SDL2_gpuCS;
|
2021-01-20 03:33:27 +00:00
|
|
|
|
|
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
|
2021-01-20 03:33:27 +00:00
|
|
|
|
{
|
2024-06-05 02:35:17 +00:00
|
|
|
|
protected override Action<IntPtr, IntPtr> ReleaseFunction => SDL_Gpu.SDL_GpuReleaseSampler;
|
2021-01-20 03:33:27 +00:00
|
|
|
|
|
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
|
|
|
|
}
|
2021-01-20 03:33:27 +00:00
|
|
|
|
}
|