Better module loading.

This commit is contained in:
Nitload
2026-03-04 00:51:29 +08:00
parent 7533e15fc7
commit 7e970352ab
21 changed files with 757 additions and 529 deletions
+2 -28
View File
@@ -58,29 +58,6 @@ namespace StgSharp
private static uint markCount = 0;
internal static GraphicAPI API = default;
public static unsafe int DefaultSIMDAlignment
{
get
{
SIMDID id = NativeIntrinsic.IntrinsicMask;
switch (id.MaskByte[0] & 0b_00001111)
{
case 1:
return id.MaskByte[1] switch
{
1 => 16,
2 => 32,
3 => 64,
4 => 64,
5 => 64,
_ => 8,
};
default:
return 8;
}
}
}
public static ModuleToInitializeCollection Initialize()
{
return new ModuleToInitializeCollection(new Initializer());
@@ -122,7 +99,8 @@ namespace StgSharp
public static void Terminate(int exitCode)
{
MainTimeProvider.StopProvidingTime();
GraphicFramework.glfwTerminate();
// GraphicFramework.glfwTerminate();
Environment.Exit(exitCode);
}
@@ -204,10 +182,6 @@ namespace StgSharp
{
// Initialize time provider and start providing time
MainTimeProvider.StartProvidingTime();
GraphicFramework.LoadGlfw();
if (GraphicFramework.glfwInit() == 0) {
throw new Exception("Failed to init system graphic environment.");
}
DefaultLog.InternalAppendLog("\n\n\n");
DefaultLog.InternalWriteLog(
$"Program {Assembly.GetEntryAssembly()!.FullName} on {Environment.MachineName} Started.", LogType.Info);