feat: switch default backend to Silk.NET OpenGL

- OpenGLRenderContext: Initialize() + CreateOpenGL() for non-blocking
- OpenGLWindow: Initialize() instead of Run(), CreateGL() method
- Program.cs: default backend is now 'opengl', SwapBuffers per frame
- ImGui guarded: only initialized for RaylibRenderer, ObjectManipulator
  checks _imGuiAvailable before calling ImGui.GetIO()
- 66/66 tests, 145 FPS with OpenGL backend
This commit is contained in:
emil28092005
2026-06-17 20:14:15 +03:00
parent cc9a1a4602
commit 417915e861
6 changed files with 40 additions and 23 deletions
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using Engine.Core;
using Silk.NET.Input;
using Silk.NET.OpenGL;
using Silk.NET.Windowing;
using SilkWindow = Silk.NET.Windowing.IWindow;
@@ -31,6 +32,8 @@ public sealed class OpenGLWindow : Engine.Core.IWindow, IDisposable
_silkWindow = Window.Create(options);
_silkWindow.Closing += () => _shouldClose = true;
// Initialize without Run() — enables non-blocking event loop
_silkWindow.Initialize();
}
public void OnLoad()
@@ -39,6 +42,8 @@ public sealed class OpenGLWindow : Engine.Core.IWindow, IDisposable
_input.Initialize(inputContext);
}
public GL CreateGL() => _silkWindow.CreateOpenGL();
public void PumpEvents() => _silkWindow.DoEvents();
public void Close() => _shouldClose = true;
public string[] GetRequiredVulkanExtensions() => Array.Empty<string>();