API renames, change ref renderer to in renderer in IDrawable, make Layer implement IDrawable.

This commit is contained in:
2023-06-15 22:39:34 +02:00
parent bf4fb6e1e3
commit 964b903500
18 changed files with 122 additions and 67 deletions

View File

@@ -6,15 +6,24 @@ namespace DaggerFramework.Rendering
public abstract class Renderer
{
// INIT
public abstract void CreateAndInitialize(WindowSettings windowSettings, RendererSettings renderSettings);
public abstract void Initialize(RendererSettings settings);
// UTIL
public abstract bool ShouldRun { get; }
// WINDOW
public abstract Vector2 WindowSize { get; }
public abstract void CreateWindow(string title, Vector2 size);
public void CreateWindow(WindowSettings windowSettings)
{
CreateWindow(windowSettings.Title, windowSettings.Size);
}
public abstract void SetWindowTitle(string title);
public abstract void SetWindowVSync(bool value);
public abstract void SetTargetFps(int fps);
public abstract bool WindowShouldClose();
public abstract void CloseWindow();
public abstract void Shutdown();
// DRAWING
public abstract void BeginFrame();
@@ -43,5 +52,22 @@ namespace DaggerFramework.Rendering
public Msaa Msaa;
public bool UseVSync;
public bool Fullscreen;
public static RendererSettings Default => new RendererSettings()
{
UseVSync = true,
};
}
public struct WindowSettings
{
public string Title;
public Vector2 Size = new Vector2(640, 480);
public WindowSettings(string title, Vector2 size)
{
Title = title;
Size = size;
}
}
}