2026-04-27 16:11:54 +08:00
|
|
|
using XCEngine;
|
|
|
|
|
|
2026-04-25 15:34:19 +08:00
|
|
|
namespace XCEngine.Rendering
|
|
|
|
|
{
|
|
|
|
|
public sealed class CommandBuffer
|
|
|
|
|
{
|
|
|
|
|
public CommandBuffer()
|
|
|
|
|
: this(string.Empty)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CommandBuffer(
|
|
|
|
|
string name)
|
2026-04-27 16:11:54 +08:00
|
|
|
: this(
|
|
|
|
|
name,
|
|
|
|
|
0ul)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal CommandBuffer(
|
|
|
|
|
string name,
|
|
|
|
|
ulong nativeHandle)
|
2026-04-25 15:34:19 +08:00
|
|
|
{
|
|
|
|
|
this.name = name ?? string.Empty;
|
2026-04-27 16:11:54 +08:00
|
|
|
m_nativeHandle = nativeHandle;
|
2026-04-25 15:34:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string name { get; set; }
|
2026-04-27 16:11:54 +08:00
|
|
|
|
|
|
|
|
public bool isValid => m_nativeHandle != 0ul;
|
|
|
|
|
|
|
|
|
|
public bool ClearRenderTarget(
|
|
|
|
|
Color color)
|
|
|
|
|
{
|
|
|
|
|
return m_nativeHandle != 0ul &&
|
|
|
|
|
InternalCalls.Rendering_CommandBuffer_ClearRenderTarget(
|
|
|
|
|
m_nativeHandle,
|
|
|
|
|
ref color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private readonly ulong m_nativeHandle;
|
2026-04-25 15:34:19 +08:00
|
|
|
}
|
|
|
|
|
}
|