feat: modular HAL, Raylib backend, PBR shading, textures, 60 unit tests

- Replace hardcoded SDL3 windowing with IWindow/IInputState/Key abstractions
- Each render backend owns its window (Raylib GLFW, SDL3 for Vulkan)
- Raylib backend: DrawModelEx, custom GLSL shader with Fresnel, ACES
  tonemapping, gamma correction, hemisphere ambient
- Fix backface culling, mesh memory (NativeMemory.Alloc), texture loading
- Camera controllers use backend-agnostic Key enum (inverted yaw/strafe)
- Demo scene: 8 cubes, 7 spheres, torus knot OBJ with checker texture
- Extract ProceduralMesh + MeshMath from Program.cs to Engine.Graphics
- Vulkan backend deferred (compiles, untested, IWindow-compatible)
- 60 unit tests: ObjLoader, camera controllers, AiCommandProcessor,
  RenderBackendFactory, Timing, ProceduralMesh, MeshMath, Transform
- AGENTS.md for opencode integration
This commit is contained in:
emil28092005
2026-06-17 13:49:12 +03:00
parent 61f8c7065e
commit fb6e26a268
62 changed files with 22259 additions and 395 deletions
+31
View File
@@ -0,0 +1,31 @@
using Engine.Core;
using Flecs.NET.Core;
namespace Engine.Graphics;
/// <summary>
/// Renders the ECS world and exposes screenshot capture.
/// Implemented by concrete graphics backends.
/// </summary>
public interface IRenderer : IDisposable
{
/// <summary>
/// Render one frame of the ECS world and present it.
/// </summary>
void RenderWorld(World world);
/// <summary>
/// Request a screenshot of the next rendered frame to be saved to disk.
/// </summary>
void RequestScreenshot(string outputPath);
/// <summary>
/// True if a screenshot has been requested but not yet captured.
/// </summary>
bool IsScreenshotRequested { get; }
/// <summary>
/// Provider that can asynchronously capture the current frame to PNG bytes.
/// </summary>
IScreenshotProvider ScreenshotProvider { get; }
}