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
+26 -20
View File
@@ -1,7 +1,8 @@
using StgSharp.Envitronment;
using StgSharp.Envitronment.Win32;
using StgSharp.Graphics;
using StgSharp.Math;
// using StgSharp.Envitronment;
// using StgSharp.Envitronment.Win32;
// using StgSharp.Graphics;
// using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -11,16 +12,18 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Windows.Win32.UI.WindowsAndMessaging;
#if Windows
using Windows.Win32;
using Windows.Win32.Foundation;
using Windows.Win32.Graphics.OpenGL;
using Windows.Win32.Graphics.Gdi;
using Windows.Win32.UI;
// using Windows.Win32.UI.WindowsAndMessaging;
// using Windows.Win32;
// using Windows.Win32.Foundation;
// using Windows.Win32.Graphics.OpenGL;
// using Windows.Win32.Graphics.Gdi;
// using Windows.Win32.UI;
#endif
namespace StgSharp
{
internal enum GraphicAPI : byte
@@ -32,7 +35,6 @@ namespace StgSharp
public static partial class Platform
{
internal static GraphicAPI API = default;
private static uint markCount = 0;
@@ -55,7 +57,7 @@ namespace StgSharp
/// <summary>
/// Init an instance of OpenGL program,
/// This method should be called before other
/// This method should be called before other
/// graphic methods, after LoadGL method.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -89,7 +91,6 @@ namespace StgSharp
try
{
return Marshal.GetDelegateForFunctionPointer<TDele>(funcPtr);
}
catch (Exception)
{
@@ -99,7 +100,6 @@ namespace StgSharp
internal static Delegate ConvertAPI(IntPtr funcPtr, Type T)
{
if (funcPtr == IntPtr.Zero)
{
throw new Exception("Failed to convert api, the function pointer is zero.");
@@ -107,7 +107,6 @@ namespace StgSharp
try
{
return Marshal.GetDelegateForFunctionPointer(funcPtr, T);
}
catch (Exception)
{
@@ -118,13 +117,14 @@ namespace StgSharp
public static void Track(
object target,
string message,
bool isConsole,
[CallerFilePath] string filePath = "",
[CallerMemberName] string callerName = "",
[CallerLineNumber] int lineNumber = 0
)
{
string log = $"Tracked object: {nameof(target)}\n";
Type t = target.GetType();
string log = $"Tracked object: {nameof(target)}\t\tType:{t.Name}\n";
FieldInfo[] fieldInfo = t.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
log += "|\tFieldName\t|\tFieldType\t|\tFieldValue\t|\n";
foreach (FieldInfo field in fieldInfo)
@@ -133,8 +133,14 @@ namespace StgSharp
}
log += $"Tracking at:\n{filePath}\t{callerName}\tline {lineNumber}\n";
log += $"Additional information:\n{message}\n";
InternalIO.InternalWriteLog(log, LogType.Info);
if (isConsole)
{
Console.WriteLine(log);
}
else
{
InternalIO.InternalWriteLog(log, LogType.Info);
}
}
}
}
}