daily update on 20240226 by nitload youmu

This commit is contained in:
YoumuLiu
2024-02-27 00:43:29 +08:00
parent a2241a5a58
commit 06e39f7a31
543 changed files with 230273 additions and 21423 deletions
+7 -12
View File
@@ -15,6 +15,10 @@ namespace StgSharp
CallingConvention = CallingConvention.Cdecl)]
internal static extern void InternalInitGL(int majorVersion, int minorVersion);
[DllImport(SSC_libname, EntryPoint = "loadGlfuncDefault",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern IntPtr InternalLoadGlfuncDefault(string name);
[DllImport(SSC_libname, EntryPoint = "linkShaderProgram",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe uint InternalLinkShaderProgram(GLcontext* context, uint shaderProgram);
@@ -35,9 +39,8 @@ namespace StgSharp
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern unsafe void InternalUnloadImage(Image.ImageInfo* output);
#endregion
#endregion ssgc api define
}
}
namespace StgSharp.Graphics
@@ -48,8 +51,6 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)]
public struct GLcontext
{
internal IntPtr usrPtr;
#region glapi
internal unsafe delegate*<uint, GLfixed, void> glAccumxOES;
@@ -2585,12 +2586,6 @@ namespace StgSharp.Graphics
internal unsafe delegate*<uint, uint, int*, void> glWindowRectanglesEXT;
internal unsafe delegate*<uint, uint, uint, uint, uint, uint, void> glWriteMaskEXT;
#endregion
internal IntPtr glad_loader_handler;
#endregion glapi
}
}
}
+16 -22
View File
@@ -1,12 +1,15 @@
using StgSharp.Geometries;
using StgSharp.Graphics;
using System.Threading;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Windows.Win32;
using Windows.Win32.Foundation;
#if Windows
#endif
namespace StgSharp
{
@@ -19,21 +22,6 @@ 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
{
internal static Dictionary<TypeCode, uint> GLtype =
@@ -47,6 +35,9 @@ namespace StgSharp
internal const string SSC_libname =
"StgSharpC";
internal static readonly GCHandle ssc_logHandle =
GCHandle.Alloc(new byte[512], GCHandleType.Pinned);
static InternalIO()
{
GLtype.Add(TypeCode.Single, GLconst.FLOAT);
@@ -58,18 +49,18 @@ namespace StgSharp
GLtype.Add(TypeCode.Byte, GLconst.UNSIGNED_BYTE);
}
internal static T InternalLoadProc<T>(LibHandle lib, string name) where T : Delegate
[Obsolete("Not completed", true)]
internal static IntPtr InternalLoadProc<T>(IntPtr lib, string name) where T : Delegate
{
try
{
IntPtr procPtr =
#if Windows
PInvoke.GetProcAddress(lib, name);
IntPtr.Zero;
#elif Linux
#endif
T ret = Marshal.GetDelegateForFunctionPointer<T>(procPtr);
return ret;
return procPtr;
}
catch (Exception)
{
@@ -91,9 +82,11 @@ namespace StgSharp
}
}
internal static SemaphoreSlim logSyncSemaphore = new SemaphoreSlim(1, 1);
internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType)
{
logSyncSemaphore.Wait();
if (!File.Exists(InternalIO.SS_errorlog))
{
FileStream stream = File.Create(InternalIO.SS_errorlog);
@@ -106,6 +99,7 @@ namespace StgSharp
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
logStream.WriteLine(logLine);
}
logSyncSemaphore.Release(1);
}
internal static void InternalWriteLog(string logLine, LogType logType)
@@ -123,4 +117,4 @@ namespace StgSharp
}
}
}
}
}