daily update on 20240213 by nitload youmu. 逐步弃用GLFW,正在使用wgl重写glfw底层,相关实现转移到C#实现,SSC彻底变成线性代数计算器。

This commit is contained in:
Nitload
2024-02-13 23:42:22 +08:00
parent 8391569482
commit a2241a5a58
307 changed files with 16701 additions and 10296 deletions
+23 -13
View File
@@ -1,9 +1,12 @@
using StgSharp.Geometries;
using StgSharp.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Windows.Win32;
using Windows.Win32.Foundation;
namespace StgSharp
{
@@ -16,7 +19,20 @@ namespace StgSharp
InfoWarning,
}
internal class LibHandle : SafeHandle
{
public LibHandle(IntPtr invalidHandleValue, bool ownsHandle) : base(invalidHandleValue, ownsHandle)
{
}
public override bool IsInvalid => throw new NotImplementedException();
protected override bool ReleaseHandle()
{
return PInvoke.FreeLibrary(new HMODULE(handle));
}
}
internal static unsafe partial class InternalIO
{
@@ -42,11 +58,16 @@ namespace StgSharp
GLtype.Add(TypeCode.Byte, GLconst.UNSIGNED_BYTE);
}
internal static T InternalLoadProc<T>(IntPtr libPtr, string name) where T : Delegate
internal static T InternalLoadProc<T>(LibHandle lib, string name) where T : Delegate
{
try
{
IntPtr procPtr = InternalGetWINproc(libPtr, name);
IntPtr procPtr =
#if Windows
PInvoke.GetProcAddress(lib, name);
#elif Linux
#endif
T ret = Marshal.GetDelegateForFunctionPointer<T>(procPtr);
return ret;
}
@@ -70,17 +91,6 @@ namespace StgSharp
}
}
[DllImport("kernal32.dll", EntryPoint = "FreeLibrary",
CharSet = CharSet.Ansi)]
internal extern static IntPtr InternalFreeWINlib(IntPtr libPtr);
[DllImport("kernel32.dll", EntryPoint = "GetPeocAddress",
CharSet = CharSet.Ansi)]
internal extern static IntPtr InternalGetWINproc(IntPtr libPtr, string procName);
[DllImport("kernel32.dll", EntryPoint = "LoadLibrary",
CharSet = CharSet.Ansi)]
internal extern static IntPtr InternalLoadWINlib(string name);
internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType)
{