3b20c53088
- Refactored DirectRendering class to support new IDirectRendering interface and manage textures directly. - Enhanced ImmediateMode to utilize ImmediateVertex struct for immediate rendering calls. - Updated Image class to use IDirectRendering for texture creation. - Modified test application to demonstrate immediate mode rendering with new structures. - Removed obsolete code related to previous rendering abstractions.
51 lines
1.9 KiB
C#
51 lines
1.9 KiB
C#
using Dashboard.Pal;
|
|
|
|
namespace Dashboard.Drawing
|
|
{
|
|
/// <summary>
|
|
/// This extension provides direct access to the backend rendering pipeline without writing with a higher level
|
|
/// abstraction than the rendering backend.
|
|
/// </summary>
|
|
public interface IDirectRendering : IDeviceContextExtension
|
|
{
|
|
/// <summary>
|
|
/// Create a shader program.
|
|
/// </summary>
|
|
/// <typeparam name="T">Type of the shader create info object.</typeparam>
|
|
/// <param name="createInfo">An object which describes how the shader is created.</param>
|
|
/// <returns>A shader program object.</returns>
|
|
/// <seealso cref="SpirvShaderCreateInfo"/>
|
|
/// <seealso cref="GlslShaderCreateInfo"/>
|
|
/// <seealso cref="GlslComputeShaderCreateInfo"/>
|
|
IShader CreateShader<T>(T createInfo) where T : IShaderCreateInfo;
|
|
|
|
/// <summary>
|
|
/// Create a texture object.
|
|
/// </summary>
|
|
/// <param name="type">Type of texture to create.</param>
|
|
/// <returns>An empty texture object.</returns>
|
|
ITexture CreateTexture(TextureType type);
|
|
|
|
/// <summary>
|
|
/// Create a buffer object.
|
|
/// </summary>
|
|
/// <param name="pattern">Buffer access pattern hint.</param>
|
|
/// <param name="size">Initial capacity of the buffer in bytes.</param>
|
|
/// <returns>An empty buffer object.</returns>
|
|
IBuffer CreateBuffer(BufferAccessPattern pattern, long size);
|
|
|
|
/// <summary>
|
|
/// Enqueue a draw call.
|
|
/// </summary>
|
|
/// <param name="drawCall">The draw call to enqueue.</param>
|
|
void Draw(DrawCall drawCall);
|
|
}
|
|
|
|
[Obsolete("Use IDirectRendering instead.")]
|
|
public interface ITextureExtension : IDeviceContextExtension
|
|
{
|
|
/// <inheritdoc cref="IDirectRendering.CreateTexture(TextureType)"/>
|
|
ITexture CreateTexture(TextureType type);
|
|
}
|
|
}
|