Refactor rendering projects
This commit is contained in:
37
src/Runtime/Ghost.Graphics.RHI/IRenderer.cs
Normal file
37
src/Runtime/Ghost.Graphics.RHI/IRenderer.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Ghost.Core;
|
||||
|
||||
namespace Ghost.Graphics.RHI;
|
||||
|
||||
public readonly struct RenderContext
|
||||
{
|
||||
public ICommandBuffer CommandBuffer { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// High-level renderer interface that uses RHI abstractions
|
||||
/// </summary>
|
||||
public interface IRenderer : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the render output target for this renderer.
|
||||
/// </summary>
|
||||
IRenderOutput? RenderOutput
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The function that performs the actual rendering operations. Skip rendering if this is null.
|
||||
/// </summary>
|
||||
Func<RenderContext, Error>? RenderFunc
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders a frame
|
||||
/// </summary>
|
||||
/// <param name="commandAllocator">Command allocator to use for rendering</param>
|
||||
/// <returns>Result of the rendering operation</returns>
|
||||
Result Render(ICommandAllocator commandAllocator);
|
||||
}
|
||||
Reference in New Issue
Block a user