net9 + basic splash

This commit is contained in:
zznty
2024-12-30 03:10:47 +07:00
parent 5af1c51be8
commit 7e9813d2a7
22 changed files with 257 additions and 1985 deletions

View File

@@ -3,6 +3,7 @@ using System.Runtime.CompilerServices;
using CringeBootstrap.Abstractions;
using CringeLauncher.Utils;
using CringePlugins.Loader;
using CringePlugins.Render;
using CringePlugins.Splash;
using HarmonyLib;
using NLog;
@@ -108,7 +109,7 @@ public class Launcher : ICorePlugin
InitRender();
_renderComponent = new();
_renderComponent.Start(new(), InitEarlyWindow, MyVideoSettingsManager.Initialize(), MyPerGameSettings.MaxFrameRate);
_renderComponent.Start(new(), () => InitEarlyWindow(splash), MyVideoSettingsManager.Initialize(), MyPerGameSettings.MaxFrameRate);
_renderComponent.RenderThread.BeforeDraw += MyFpsManager.Update;
// this technically should wait for render thread init, but who cares
@@ -132,10 +133,12 @@ public class Launcher : ICorePlugin
public void Run() => _game?.Run();
private IVRageWindow InitEarlyWindow()
private IVRageWindow InitEarlyWindow(Splash splash)
{
ImGuiHandler.Instance = new();
RenderHandler.Current.RegisterComponent(splash);
MyVRage.Platform.Windows.CreateWindow("Cringe Launcher", MyPerGameSettings.GameIcon, null);
MyVRage.Platform.Windows.Window.OnExit += MySandboxGame.ExitThreadSafe;