daily update on 20240213 by nitload youmu. 逐步弃用GLFW,正在使用wgl重写glfw底层,相关实现转移到C#实现,SSC彻底变成线性代数计算器。
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.Envitronment;
|
||||
using StgSharp.Envitronment.Win32;
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
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;
|
||||
#endif
|
||||
namespace StgSharp
|
||||
{
|
||||
internal enum GraphicAPI : byte
|
||||
@@ -17,10 +30,21 @@ namespace StgSharp
|
||||
VK
|
||||
}
|
||||
|
||||
public static class Platform
|
||||
public static partial class Platform
|
||||
{
|
||||
|
||||
internal static GraphicAPI API;
|
||||
internal static GraphicAPI API = default;
|
||||
|
||||
private static uint markCount = 0;
|
||||
|
||||
public static void Mark(bool needConsole)
|
||||
{
|
||||
markCount++;
|
||||
if (needConsole)
|
||||
{
|
||||
Console.WriteLine(markCount);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Version of current StgSharp platform.
|
||||
@@ -37,6 +61,11 @@ namespace StgSharp
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void InitGL(int majorVersion, int minorVersion)
|
||||
{
|
||||
if (API != default)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
InternalIO.InternalInitGL(majorVersion, minorVersion);
|
||||
}
|
||||
|
||||
@@ -86,5 +115,26 @@ namespace StgSharp
|
||||
}
|
||||
}
|
||||
|
||||
public static void Track(
|
||||
object target,
|
||||
string message,
|
||||
[CallerFilePath] string filePath = "",
|
||||
[CallerMemberName] string callerName = "",
|
||||
[CallerLineNumber] int lineNumber = 0
|
||||
)
|
||||
{
|
||||
string log = $"Tracked object: {nameof(target)}\n";
|
||||
Type t = target.GetType();
|
||||
FieldInfo[] fieldInfo = t.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
log += "|\tFieldName\t|\tFieldType\t|\tFieldValue\t|\n";
|
||||
foreach (FieldInfo field in fieldInfo)
|
||||
{
|
||||
log += $"|{field.Name}\t\t|{field.FieldType}\t\t|{field.GetValue(target)}\t\t|\n";
|
||||
}
|
||||
log += $"Tracking at:\n{filePath}\t{callerName}\tline {lineNumber}\n";
|
||||
log += $"Additional information:\n{message}\n";
|
||||
InternalIO.InternalWriteLog(log, LogType.Info);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user