Use ResourceRefs for RenderSystem, add IReloadableSystem, remove UI package.

This commit is contained in:
2024-10-15 21:51:26 +02:00
parent 4d5c6bbe9a
commit 7dff8076b9
14 changed files with 64 additions and 248 deletions

View File

@@ -37,13 +37,15 @@ namespace Voile.Rendering
/// <summary>
/// An abstract class representing the graphics renderer.
/// </summary>
public abstract class RenderSystem : IStartableSystem<RendererSettings>, IDisposable
public abstract class RenderSystem : IStartableSystem<RendererSettings>, IReloadableSystem, IDisposable
{
public void Start(RendererSettings settings)
{
CreateAndInitializeWithWindow(settings);
}
public void Reload() => ReloadResources();
/// <inheritdoc/>
public void Dispose()
{
@@ -89,6 +91,8 @@ namespace Voile.Rendering
/// </summary>
public abstract Vector2 MonitorSize { get; }
protected abstract void ReloadResources();
/// <summary>
/// Creates a window.
/// </summary>
@@ -178,15 +182,14 @@ namespace Voile.Rendering
/// <param name="color">Color of the text.</param>
public abstract void DrawSdfText(string text, int fontSize, Color color);
public abstract void DrawText(Font font, string text, Color color);
public abstract void DrawText(ResourceRef<Font> font, string text, Color color);
/// <summary>
/// Draws the texture.
/// </summary>
/// <param name="id">Texture to draw.</param>
/// <param name="tint">Texture tint.</param>
public abstract void DrawTexture(Texture2d texture, Color tint);
public abstract void DrawTexture(ResourceRef<Texture2d> textureResource, Color tint);
protected Vector2 transformPosition, transformPivot;
protected float transformRotation;