Campari/src/ColorTarget.cs

23 lines
740 B
C#
Raw Normal View History

2021-01-14 10:50:02 +00:00
using System;
using RefreshCS;
namespace Campari
{
public class ColorTarget : GraphicsResource
{
public uint Width { get; }
public uint Height { get; }
public Texture Texture { get; }
public Refresh.ColorFormat Format => Texture.Format;
protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyColorTarget;
public ColorTarget(RefreshDevice device, Refresh.SampleCount sampleCount, ref TextureSlice textureSlice) : base(device)
{
var refreshTextureSlice = textureSlice.ToRefreshTextureSlice();
Handle = Refresh.Refresh_CreateColorTarget(device.Handle, sampleCount, ref refreshTextureSlice);
}
}
}