daily update on 20240506 by nitload youmu

This commit is contained in:
YoumuLiu
2024-05-07 05:12:28 +08:00
parent 66efce19fc
commit fc19ab3298
83 changed files with 1161 additions and 741 deletions
+6 -6
View File
@@ -42,27 +42,27 @@ namespace StgSharp
{
#region ssgc api define
[DllImport(SSC_libname, EntryPoint = "initGL",
[DllImport(SSC_libName, EntryPoint = "initGL",
CallingConvention = CallingConvention.Cdecl)]
internal static extern void InternalInitGL(int majorVersion, int minorVersion);
[DllImport(SSC_libname, EntryPoint = "loadGlfuncDefault",
[DllImport(SSC_libName, EntryPoint = "loadGlfuncDefault",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern IntPtr InternalLoadGlfuncDefault(string name);
[DllImport(SSC_libname, EntryPoint = "linkShaderProgram",
[DllImport(SSC_libName, EntryPoint = "linkShaderProgram",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe uint InternalLinkShaderProgram(GLcontext* context, uint shaderProgram);
[DllImport(SSC_libname, EntryPoint = "readLog",
[DllImport(SSC_libName, EntryPoint = "readLog",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe IntPtr InternalReadSSCLog();
[DllImport(SSC_libname, EntryPoint = "loadImageData",
[DllImport(SSC_libName, EntryPoint = "loadImageData",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern unsafe void InternalLoadImage(string fileName, ImageInfo* output, ImageLoader loader);
[DllImport(SSC_libname, EntryPoint = "unloadImageData",
[DllImport(SSC_libName, EntryPoint = "unloadImageData",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern unsafe void InternalUnloadImage(ImageInfo* output);
+12 -12
View File
@@ -56,11 +56,11 @@ namespace StgSharp
internal static unsafe partial class InternalIO
{
internal const string SS_errorlog =
internal const string SS_errorLog =
"SS_errorlog.log";
internal const string SSC_libname =
"StgSharpC";
internal const string SSC_libName =
"StgSharpC";
internal static Dictionary<TypeCode, uint> GLtype =
new Dictionary<TypeCode, uint>();
@@ -85,13 +85,13 @@ namespace StgSharp
internal static void InternalAppendLog(string log)
{
if (!File.Exists(SS_errorlog))
if (!File.Exists(SS_errorLog))
{
FileStream stream = File.Create(SS_errorlog);
FileStream stream = File.Create(SS_errorLog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SS_errorlog))
using (StreamWriter logStream = File.AppendText(SS_errorLog))
{
logStream.WriteLine(log);
}
@@ -119,13 +119,13 @@ namespace StgSharp
internal static void InternalWriteLog(string logLine, LogType logType)
{
logSyncSemaphore.Wait();
if (!File.Exists(SS_errorlog))
if (!File.Exists(SS_errorLog))
{
FileStream stream = File.Create(SS_errorlog);
FileStream stream = File.Create(SS_errorLog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SS_errorlog))
using (StreamWriter logStream = File.AppendText(SS_errorLog))
{
logStream.WriteLine($"{logType}\t{DateTime.Now.ToString("o")}");
logStream.WriteLine(logLine);
@@ -136,13 +136,13 @@ namespace StgSharp
internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType)
{
logSyncSemaphore.Wait();
if (!File.Exists(InternalIO.SS_errorlog))
if (!File.Exists(InternalIO.SS_errorLog))
{
FileStream stream = File.Create(InternalIO.SS_errorlog);
FileStream stream = File.Create(InternalIO.SS_errorLog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SS_errorlog))
using (StreamWriter logStream = File.AppendText(SS_errorLog))
{
logStream.WriteLine(beforeTime);
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
+4 -2
View File
@@ -1,4 +1,6 @@
using System;
using StgSharp.Data.FileIO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -10,7 +12,7 @@ namespace StgSharp.Data
{
private byte _id;
private List<SSD> discList;
private List<SSDrawHead> files;
public Area()
{
+1
View File
@@ -55,6 +55,7 @@ namespace StgSharp.Data
[FieldOffset(14)] public byte selfDefine_2;
[FieldOffset(15)] public byte selfDefine_3;
public int Size
{
get => ((int)size) + 1;
+4 -2
View File
@@ -1,4 +1,6 @@
using System;
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
@@ -59,7 +61,7 @@ namespace StgSharp.Data
}
for (int i = begin; i < 255; i++)
{
Data[i] = 0; //TODO: 使用STGSHARP内部随机数工具处理它
Data[i] = Scaler.Random<byte>(); //TODO: 使用STGSHARP内部随机数工具处理它
}
}
+39 -81
View File
@@ -52,17 +52,17 @@ namespace StgSharp.Data.FileIO
public const int SegmentCapacity = 16 * 16;
private Area home;
private SSDrawHead _head;
private string _name;
private SSDSegment currentSegment;
private int previousHash;
private List<SSDSegment> segments;
private SSDrawHead _head;
private SSDSegment currentSegment;
private string _name;
internal SSDraw()
{
segments = new List<SSDSegment>();
}
public SSDraw(string name)
@@ -73,14 +73,11 @@ namespace StgSharp.Data.FileIO
public int ID
{
get { return _head._head.globalID; }
set { _head._head.globalID = value; }
get => _head._head.globalID;
set => _head._head.globalID = value;
}
internal SSDrawHead Head
{
get{return _head; }
}
internal SSDrawHead Head => _head;
//TODO 分析头,加载文件头,进一步加载全部的数据块
@@ -96,7 +93,7 @@ namespace StgSharp.Data.FileIO
return null;
}
SSDraw ret = new SSDraw();
foreach (var item in head)
foreach ((int, int) item in head)
{
}
@@ -105,8 +102,8 @@ namespace StgSharp.Data.FileIO
public void CreateRawFile(string outputFolder, bool rewrite)
{
string route =
$"{((outputFolder == string.Empty) ? " " : ($"{outputFolder}\\"))}{$"{_name}.{FileType}"}";
string route = (outputFolder == string.Empty) ? ($"{_name}.{FileType}") :
($"{outputFolder} \\ {_name}.{FileType}");
if (File.Exists(route) && !rewrite)
{
throw new Exception("This SSDRAW has already existed.");
@@ -114,9 +111,7 @@ namespace StgSharp.Data.FileIO
using (File.Create(route)) { }
using (File.Open(route, FileMode.Truncate)) { }
FileStream f = File.Open(route, FileMode.Open);
int size = 0;
f.Write(_head.GetBytes(out size), 0, size);
foreach (var _head in segments)
foreach (SSDSegment _head in segments)
{
f.Write(_head.GetBytes(), 0, 18 * 16);
}
@@ -133,7 +128,7 @@ namespace StgSharp.Data.FileIO
}
FileStream stream = File.Open(route, FileMode.Open);
return new SSDraw(string.Empty);
}
public void WriteRaw(byte[] dataStream)
@@ -172,15 +167,12 @@ namespace StgSharp.Data.FileIO
}
public unsafe class SSDrawHead : IEnumerable<int>
public unsafe class SSDrawHead : IEnumerable<(int, int)>
{
private List<int> freeSegments;
private SSDSegment segmentRange;
private string name;
private List<(int, int)> segmentRange;
internal SSDSegmentHead _head;
internal SSDrawHead(string name)
{
int hash;
@@ -192,14 +184,16 @@ namespace StgSharp.Data.FileIO
hash = BitConverter.ToInt32(bytes, 0);
}
_head.previousHash = hash;
segmentRange = new List<(int, int)>();
freeSegments = new List<int>();
}
public SSDrawHead()
{
segmentRange = new List<(int, int)>();
freeSegments = new List<int>();
}
public (int begin, int end) this[byte index]
{
get => segmentRange.ReadData<(int, int)>(index);
set => segmentRange.WriteData<(int, int)>(index, value);
}
public byte DiscIndex
@@ -214,85 +208,49 @@ namespace StgSharp.Data.FileIO
internal set => _head.selfDefine_1 = value;
}
public void AddSingleSegment(int id)
internal ref SSDSegmentHead _head
{
freeSegments.Add(id);
get => ref segmentRange.Head;
}
public unsafe byte[] GetBytes(out int size)
internal byte pairCount
{
byte[] namecode = Encoding.UTF8.GetBytes(name);
size = 16 + 4 +
(segmentRange.Count * 8) +
(freeSegments.Count * 4) +
namecode.Length;
byte[] ret = new byte[size];
fixed (byte* bptr = ret)
get => (byte)(_head.size / 8);
set
{
*(SSDSegmentHead*)bptr = _head;
*(bptr + 16) = (byte)segmentRange.Count;
*(bptr + 17) = (byte)namecode.Length;
*(bptr + 18) = (byte)freeSegments.Count;
int t = 20;
for (int i = 0; i < segmentRange.Count; i++, t += 8)
if (value > 32)
{
*(int*)(bptr + t) = segmentRange[i].Item1;
*(int*)(bptr + t + 4) = segmentRange[i].Item2;
}
for (int i = 0; i < freeSegments.Count; i++, t += 4)
{
*(int*)(bptr + t) = freeSegments[i];
}
for (int i = 0; i < namecode.Length; i++, t++)
{
*(bptr + t) = namecode[i];
throw new ArgumentOutOfRangeException();
}
_head.size = (byte)(value * 8);
}
return ret;
}
public void WriteRange(int begin, int end)
public unsafe byte[] GetBytes()
{
segmentRange.Add((begin, end));
return segmentRange.GetBytes();
}
internal void MarkSegment(int id)
{
freeSegments.Add(id);
}
IEnumerator IEnumerable.GetEnumerator()
{
foreach (var tuple in segmentRange)
for (int i = 0; i < pairCount; i++)
{
for (int i = tuple.Item1; i <= tuple.Item2; i++)
{
yield return i;
}
}
foreach (var item in freeSegments)
{
yield return item;
yield return segmentRange.ReadData<(int, int)>(i);
}
}
IEnumerator<int> IEnumerable<int>.GetEnumerator()
IEnumerator<(int, int)> IEnumerable<(int, int)>.GetEnumerator()
{
foreach (var tuple in segmentRange)
for (int i = 0; i < pairCount; i++)
{
for (int i = tuple.Item1; i <= tuple.Item2; i++)
{
yield return i;
}
}
foreach (var item in freeSegments)
{
yield return item;
yield return segmentRange.ReadData<(int, int)>(i);
}
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp
{
public class UniformEmptyReferenceException : Exception
{
public UniformEmptyReferenceException(string program, string name):
base($"Location -1 returned when trying to find uniform {name} in shader program {program}")
{
}
}
}
@@ -83,6 +83,10 @@ namespace StgSharp
mainTimeProvider = new StgSharpTime();
MainTimeProvider.StartProvidingTime();
InternalIO.glfwInit();
InternalIO.InternalAppendLog("\n\n\n");
InternalIO.InternalWriteLog(
$"Program {Assembly.GetEntryAssembly()!.FullName} Started.",
LogType.Info);
}
public static void Mark(bool needConsole)
+2 -2
View File
@@ -77,8 +77,8 @@ namespace StgSharp.Graphics
{
Interlocked.Exchange(ref _frameSpeed, _frameCount);
Interlocked.Exchange(ref _frameCount, 0);
//Console.Clear();
//Console.WriteLine(_frameSpeed);
Console.Clear();
Console.WriteLine(_frameSpeed);
};
frameTimeProvider = new TimeSpanProvider(
1000L * 1000L / 60, TimeSpanProvider.DefaultProvider
+1 -1
View File
@@ -330,7 +330,7 @@ namespace StgSharp.Graphics
~glHandleSet()
{
//unsafe, 不确定这个句柄组的单一索引是不是完全卸载
}
}
}
+14 -1
View File
@@ -281,13 +281,26 @@ namespace StgSharp.Graphics
return h;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe glSHandle GetUniformLocation(glHandle program, string name)
{
byte[] code = Encoding.UTF8.GetBytes(name);
fixed (byte* ptr = code)
{
return glSHandle.Alloc(Context.glGetUniformLocation(program.Value, ptr));
int ret = Context.glGetUniformLocation(program.Value, ptr);
#if DEBUG
if (ret == (int)(GLconst.INVALID_OPERATION) ||
ret == (int)(GLconst.INVALID_VALUE))
{
throw new InvalidOperationException();
}
if (ret == -1 )
{
throw new UniformEmptyReferenceException(nameof(program), name);
}
#endif
return glSHandle.Alloc(ret);
}
}
@@ -41,9 +41,6 @@ namespace StgSharp.Graphics
{
public partial class glRenderStream
{
protected glRenderStream(RenderStreamConstructArgs args) : base(args)
{
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected sealed override Shader CreateShaderSegment(ShaderType type, int count)
@@ -203,7 +203,7 @@ namespace StgSharp.Graphics
public unsafe static void SetValue(Uniform<Matrix44> uniform, Matrix44 mat)
{
Matrix44 temp = mat;
Context.glUniformMatrix4fv(uniform.id.Value, 1, false, (float*)&mat);
Context.glUniformMatrix4fv(uniform.id.Value, 1, false, (float*)&temp);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -13,6 +13,9 @@ namespace StgSharp.Graphics
{
public abstract partial class glRenderStream: RenderStream
{
protected glRenderStream(RenderStreamConstructArgs args) : base(args)
{
}
public static T AsMainStreamOf<T>(Form f, (int x, int y, int z) unitCubeSize) where T : glRenderStream
{
@@ -77,7 +80,7 @@ namespace StgSharp.Graphics
if (GL.CurrentContextHandle != ContextHandle)
{
GL.CurrentContextHandle = ContextHandle;
Console.WriteLine($"context set as {(ulong)GL.CurrentContextHandle}");
//Console.WriteLine($"context set as {(ulong)GL.CurrentContextHandle}");
InternalIO.glfwMakeContextCurrent(CanvasHandle);
}
}
+116 -116
View File
@@ -47,237 +47,237 @@ namespace StgSharp
{
#region api call
[DllImport(SSC_libname, EntryPoint = "glfwInit")] internal static extern unsafe int glfwInit();
[DllImport(SSC_libName, EntryPoint = "glfwInit")] internal static extern unsafe int glfwInit();
[DllImport(SSC_libname, EntryPoint = "glfwTerminate")] internal static extern unsafe void glfwTerminate();
[DllImport(SSC_libName, EntryPoint = "glfwTerminate")] internal static extern unsafe void glfwTerminate();
[DllImport(SSC_libname, EntryPoint = "glfwInitHint")] internal static extern unsafe void glfwInitHint(int hint, int value);
[DllImport(SSC_libName, EntryPoint = "glfwInitHint")] internal static extern unsafe void glfwInitHint(int hint, int value);
[DllImport(SSC_libname, EntryPoint = "glfwGetVersion")] internal static extern unsafe void glfwGetVersion(int* major, int* minor, int* rev);
[DllImport(SSC_libName, EntryPoint = "glfwGetVersion")] internal static extern unsafe void glfwGetVersion(int* major, int* minor, int* rev);
[DllImport(SSC_libname, EntryPoint = "glfwGetVersionString")] internal static extern unsafe byte* glfwGetVersionString();
[DllImport(SSC_libName, EntryPoint = "glfwGetVersionString")] internal static extern unsafe byte* glfwGetVersionString();
[DllImport(SSC_libname, EntryPoint = "glfwGetError")] internal static extern unsafe int glfwGetError(byte** description);
[DllImport(SSC_libName, EntryPoint = "glfwGetError")] internal static extern unsafe int glfwGetError(byte** description);
[DllImport(SSC_libname, EntryPoint = "glfwSetErrorCallback")] internal static extern unsafe GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetErrorCallback")] internal static extern unsafe GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwGetMonitors")] internal static extern unsafe IntPtr* glfwGetMonitors(int* count);
[DllImport(SSC_libName, EntryPoint = "glfwGetMonitors")] internal static extern unsafe IntPtr* glfwGetMonitors(int* count);
[DllImport(SSC_libname, EntryPoint = "glfwGetPrimaryMonitor")] internal static extern unsafe IntPtr glfwGetPrimaryMonitor();
[DllImport(SSC_libName, EntryPoint = "glfwGetPrimaryMonitor")] internal static extern unsafe IntPtr glfwGetPrimaryMonitor();
[DllImport(SSC_libname, EntryPoint = "glfwGetMonitorPos")] internal static extern unsafe void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos);
[DllImport(SSC_libName, EntryPoint = "glfwGetMonitorPos")] internal static extern unsafe void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos);
[DllImport(SSC_libname, EntryPoint = "glfwGetMonitorWorkarea")] internal static extern unsafe void glfwGetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height);
[DllImport(SSC_libName, EntryPoint = "glfwGetMonitorWorkarea")] internal static extern unsafe void glfwGetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height);
[DllImport(SSC_libname, EntryPoint = "glfwGetMonitorPhysicalSize")] internal static extern unsafe void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM);
[DllImport(SSC_libName, EntryPoint = "glfwGetMonitorPhysicalSize")] internal static extern unsafe void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM);
[DllImport(SSC_libname, EntryPoint = "glfwGetMonitorContentScale")] internal static extern unsafe void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale);
[DllImport(SSC_libName, EntryPoint = "glfwGetMonitorContentScale")] internal static extern unsafe void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale);
[DllImport(SSC_libname, EntryPoint = "glfwGetMonitorName")] internal static extern unsafe byte* glfwGetMonitorName(IntPtr monitor);
[DllImport(SSC_libName, EntryPoint = "glfwGetMonitorName")] internal static extern unsafe byte* glfwGetMonitorName(IntPtr monitor);
[DllImport(SSC_libname, EntryPoint = "glfwSetMonitorUserPointer")] internal static extern unsafe void glfwSetMonitorUserPointer(IntPtr monitor, void* pointer);
[DllImport(SSC_libName, EntryPoint = "glfwSetMonitorUserPointer")] internal static extern unsafe void glfwSetMonitorUserPointer(IntPtr monitor, void* pointer);
[DllImport(SSC_libname, EntryPoint = "glfwGetMonitorUserPointer")] internal static extern unsafe void* glfwGetMonitorUserPointer(IntPtr monitor);
[DllImport(SSC_libName, EntryPoint = "glfwGetMonitorUserPointer")] internal static extern unsafe void* glfwGetMonitorUserPointer(IntPtr monitor);
[DllImport(SSC_libname, EntryPoint = "glfwSetMonitorCallback")] internal static extern unsafe GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetMonitorCallback")] internal static extern unsafe GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwGetVideoModes")] internal static extern unsafe glfwVideomode* glfwGetVideoModes(IntPtr monitor, int* count);
[DllImport(SSC_libName, EntryPoint = "glfwGetVideoModes")] internal static extern unsafe glfwVideomode* glfwGetVideoModes(IntPtr monitor, int* count);
[DllImport(SSC_libname, EntryPoint = "glfwGetVideoMode")] internal static extern unsafe glfwVideomode* glfwGetVideoMode(IntPtr monitor);
[DllImport(SSC_libName, EntryPoint = "glfwGetVideoMode")] internal static extern unsafe glfwVideomode* glfwGetVideoMode(IntPtr monitor);
[DllImport(SSC_libname, EntryPoint = "glfwSetGamma")] internal static extern unsafe void glfwSetGamma(IntPtr monitor, float gamma);
[DllImport(SSC_libName, EntryPoint = "glfwSetGamma")] internal static extern unsafe void glfwSetGamma(IntPtr monitor, float gamma);
[DllImport(SSC_libname, EntryPoint = "glfwGetGammaRamp")] internal static extern unsafe glfwGammaramp* glfwGetGammaRamp(IntPtr monitor);
[DllImport(SSC_libName, EntryPoint = "glfwGetGammaRamp")] internal static extern unsafe glfwGammaramp* glfwGetGammaRamp(IntPtr monitor);
[DllImport(SSC_libname, EntryPoint = "glfwSetGammaRamp")] internal static extern unsafe void glfwSetGammaRamp(IntPtr monitor, glfwGammaramp* ramp);
[DllImport(SSC_libName, EntryPoint = "glfwSetGammaRamp")] internal static extern unsafe void glfwSetGammaRamp(IntPtr monitor, glfwGammaramp* ramp);
[DllImport(SSC_libname, EntryPoint = "glfwDefaultWindowHints")] internal static extern unsafe void glfwDefaultWindowHints();
[DllImport(SSC_libName, EntryPoint = "glfwDefaultWindowHints")] internal static extern unsafe void glfwDefaultWindowHints();
[DllImport(SSC_libname, EntryPoint = "glfwWindowHint")] internal static extern unsafe void glfwWindowHint(int hint, int value);
[DllImport(SSC_libName, EntryPoint = "glfwWindowHint")] internal static extern unsafe void glfwWindowHint(int hint, int value);
[DllImport(SSC_libname, EntryPoint = "glfwWindowHintString")] internal static extern unsafe void glfwWindowHintString(int hint, byte* value);
[DllImport(SSC_libName, EntryPoint = "glfwWindowHintString")] internal static extern unsafe void glfwWindowHintString(int hint, byte* value);
[DllImport(SSC_libname, EntryPoint = "glfwCreateWindow")] internal static extern unsafe IntPtr glfwCreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share);
[DllImport(SSC_libName, EntryPoint = "glfwCreateWindow")] internal static extern unsafe IntPtr glfwCreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share);
[DllImport(SSC_libname, EntryPoint = "glfwDestroyWindow")] internal static extern unsafe void glfwDestroyWindow(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwDestroyWindow")] internal static extern unsafe void glfwDestroyWindow(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwWindowShouldClose")] internal static extern unsafe int glfwWindowShouldClose(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwWindowShouldClose")] internal static extern unsafe int glfwWindowShouldClose(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowShouldClose")] internal static extern unsafe void glfwSetWindowShouldClose(IntPtr window, int value);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowShouldClose")] internal static extern unsafe void glfwSetWindowShouldClose(IntPtr window, int value);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowTitle")] internal static extern unsafe void glfwSetWindowTitle(IntPtr window, byte* title);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowTitle")] internal static extern unsafe void glfwSetWindowTitle(IntPtr window, byte* title);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowIcon")] internal static extern unsafe void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowIcon")] internal static extern unsafe void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images);
[DllImport(SSC_libname, EntryPoint = "glfwGetWindowPos")] internal static extern unsafe void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos);
[DllImport(SSC_libName, EntryPoint = "glfwGetWindowPos")] internal static extern unsafe void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowPos")] internal static extern unsafe void glfwSetWindowPos(IntPtr window, int xpos, int ypos);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowPos")] internal static extern unsafe void glfwSetWindowPos(IntPtr window, int xpos, int ypos);
[DllImport(SSC_libname, EntryPoint = "glfwGetWindowSize")] internal static extern unsafe void glfwGetWindowSize(IntPtr window, int* width, int* height);
[DllImport(SSC_libName, EntryPoint = "glfwGetWindowSize")] internal static extern unsafe void glfwGetWindowSize(IntPtr window, int* width, int* height);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowSizeLimits")] internal static extern unsafe void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowSizeLimits")] internal static extern unsafe void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowAspectRatio")] internal static extern unsafe void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowAspectRatio")] internal static extern unsafe void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowSize")] internal static extern unsafe void glfwSetWindowSize(IntPtr window, int width, int height);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowSize")] internal static extern unsafe void glfwSetWindowSize(IntPtr window, int width, int height);
[DllImport(SSC_libname, EntryPoint = "glfwGetFramebufferSize")] internal static extern unsafe void glfwGetFramebufferSize(IntPtr window, int* width, int* height);
[DllImport(SSC_libName, EntryPoint = "glfwGetFramebufferSize")] internal static extern unsafe void glfwGetFramebufferSize(IntPtr window, int* width, int* height);
[DllImport(SSC_libname, EntryPoint = "glfwGetWindowFrameSize")] internal static extern unsafe void glfwGetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom);
[DllImport(SSC_libName, EntryPoint = "glfwGetWindowFrameSize")] internal static extern unsafe void glfwGetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom);
[DllImport(SSC_libname, EntryPoint = "glfwGetWindowContentScale")] internal static extern unsafe void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale);
[DllImport(SSC_libName, EntryPoint = "glfwGetWindowContentScale")] internal static extern unsafe void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale);
[DllImport(SSC_libname, EntryPoint = "glfwGetWindowOpacity")] internal static extern unsafe float glfwGetWindowOpacity(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwGetWindowOpacity")] internal static extern unsafe float glfwGetWindowOpacity(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowOpacity")] internal static extern unsafe void glfwSetWindowOpacity(IntPtr window, float opacity);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowOpacity")] internal static extern unsafe void glfwSetWindowOpacity(IntPtr window, float opacity);
[DllImport(SSC_libname, EntryPoint = "glfwIconifyWindow")] internal static extern unsafe void glfwIconifyWindow(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwIconifyWindow")] internal static extern unsafe void glfwIconifyWindow(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwRestoreWindow")] internal static extern unsafe void glfwRestoreWindow(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwRestoreWindow")] internal static extern unsafe void glfwRestoreWindow(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwMaximizeWindow")] internal static extern unsafe void glfwMaximizeWindow(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwMaximizeWindow")] internal static extern unsafe void glfwMaximizeWindow(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwShowWindow")] internal static extern unsafe void glfwShowWindow(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwShowWindow")] internal static extern unsafe void glfwShowWindow(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwHideWindow")] internal static extern unsafe void glfwHideWindow(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwHideWindow")] internal static extern unsafe void glfwHideWindow(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwFocusWindow")] internal static extern unsafe void glfwFocusWindow(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwFocusWindow")] internal static extern unsafe void glfwFocusWindow(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwRequestWindowAttention")] internal static extern unsafe void glfwRequestWindowAttention(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwRequestWindowAttention")] internal static extern unsafe void glfwRequestWindowAttention(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwGetWindowMonitor")] internal static extern unsafe IntPtr glfwGetWindowMonitor(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwGetWindowMonitor")] internal static extern unsafe IntPtr glfwGetWindowMonitor(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowMonitor")] internal static extern unsafe void glfwSetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowMonitor")] internal static extern unsafe void glfwSetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate);
[DllImport(SSC_libname, EntryPoint = "glfwGetWindowAttrib")] internal static extern unsafe int glfwGetWindowAttrib(IntPtr window, int attrib);
[DllImport(SSC_libName, EntryPoint = "glfwGetWindowAttrib")] internal static extern unsafe int glfwGetWindowAttrib(IntPtr window, int attrib);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowAttrib")] internal static extern unsafe void glfwSetWindowAttrib(IntPtr window, int attrib, int value);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowAttrib")] internal static extern unsafe void glfwSetWindowAttrib(IntPtr window, int attrib, int value);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowUserPointer")] internal static extern unsafe void glfwSetWindowUserPointer(IntPtr window, void* pointer);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowUserPointer")] internal static extern unsafe void glfwSetWindowUserPointer(IntPtr window, void* pointer);
[DllImport(SSC_libname, EntryPoint = "glfwGetWindowUserPointer")] internal static extern unsafe void* glfwGetWindowUserPointer(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwGetWindowUserPointer")] internal static extern unsafe void* glfwGetWindowUserPointer(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowPosCallback")] internal static extern unsafe GLFWwindowposfun glfwSetWindowPosCallback(IntPtr window, GLFWwindowposfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowPosCallback")] internal static extern unsafe GLFWwindowposfun glfwSetWindowPosCallback(IntPtr window, GLFWwindowposfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowSizeCallback")] internal static extern unsafe GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowSizeCallback")] internal static extern unsafe GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowCloseCallback")] internal static extern unsafe GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowCloseCallback")] internal static extern unsafe GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowRefreshCallback")] internal static extern unsafe GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowRefreshCallback")] internal static extern unsafe GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowFocusCallback")] internal static extern unsafe GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowFocusCallback")] internal static extern unsafe GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowIconifyCallback")] internal static extern unsafe GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowIconifyCallback")] internal static extern unsafe GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowMaximizeCallback")] internal static extern unsafe GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowMaximizeCallback")] internal static extern unsafe GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetFramebufferSizeCallback")] internal static extern unsafe FramebuffersizeHandler glfwSetFramebufferSizeCallback(IntPtr window, IntPtr callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetFramebufferSizeCallback")] internal static extern unsafe FramebuffersizeHandler glfwSetFramebufferSizeCallback(IntPtr window, IntPtr callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetWindowContentScaleCallback")] internal static extern unsafe GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetWindowContentScaleCallback")] internal static extern unsafe GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback);
[DllImport(SSC_libname, EntryPoint = "glfwPollEvents")] internal static extern unsafe void glfwPollEvents();
[DllImport(SSC_libName, EntryPoint = "glfwPollEvents")] internal static extern unsafe void glfwPollEvents();
[DllImport(SSC_libname, EntryPoint = "glfwWaitEvents")] internal static extern unsafe void glfwWaitEvents();
[DllImport(SSC_libName, EntryPoint = "glfwWaitEvents")] internal static extern unsafe void glfwWaitEvents();
[DllImport(SSC_libname, EntryPoint = "glfwWaitEventsTimeout")] internal static extern unsafe void glfwWaitEventsTimeout(double timeout);
[DllImport(SSC_libName, EntryPoint = "glfwWaitEventsTimeout")] internal static extern unsafe void glfwWaitEventsTimeout(double timeout);
[DllImport(SSC_libname, EntryPoint = "glfwPostEmptyEvent")] internal static extern unsafe void glfwPostEmptyEvent();
[DllImport(SSC_libName, EntryPoint = "glfwPostEmptyEvent")] internal static extern unsafe void glfwPostEmptyEvent();
[DllImport(SSC_libname, EntryPoint = "glfwGetInputMode")] internal static extern unsafe int glfwGetInputMode(IntPtr window, int mode);
[DllImport(SSC_libName, EntryPoint = "glfwGetInputMode")] internal static extern unsafe int glfwGetInputMode(IntPtr window, int mode);
[DllImport(SSC_libname, EntryPoint = "glfwSetInputMode")] internal static extern unsafe void glfwSetInputMode(IntPtr window, int mode, int value);
[DllImport(SSC_libName, EntryPoint = "glfwSetInputMode")] internal static extern unsafe void glfwSetInputMode(IntPtr window, int mode, int value);
[DllImport(SSC_libname, EntryPoint = "glfwRawMouseMotionSupported")] internal static extern unsafe int glfwRawMouseMotionSupported();
[DllImport(SSC_libName, EntryPoint = "glfwRawMouseMotionSupported")] internal static extern unsafe int glfwRawMouseMotionSupported();
[DllImport(SSC_libname, EntryPoint = "glfwGetKeyName")] internal static extern unsafe byte* glfwGetKeyName(int key, int scancode);
[DllImport(SSC_libName, EntryPoint = "glfwGetKeyName")] internal static extern unsafe byte* glfwGetKeyName(int key, int scancode);
[DllImport(SSC_libname, EntryPoint = "glfwGetKeyScancode")] internal static extern unsafe int glfwGetKeyScancode(int key);
[DllImport(SSC_libName, EntryPoint = "glfwGetKeyScancode")] internal static extern unsafe int glfwGetKeyScancode(int key);
[DllImport(SSC_libname, EntryPoint = "glfwGetKey")] internal static extern unsafe KeyStatus glfwGetKey(IntPtr window, int key);
[DllImport(SSC_libName, EntryPoint = "glfwGetKey")] internal static extern unsafe KeyStatus glfwGetKey(IntPtr window, int key);
[DllImport(SSC_libname, EntryPoint = "glfwGetMouseButton")] internal static extern unsafe int glfwGetMouseButton(IntPtr window, int button);
[DllImport(SSC_libName, EntryPoint = "glfwGetMouseButton")] internal static extern unsafe int glfwGetMouseButton(IntPtr window, int button);
[DllImport(SSC_libname, EntryPoint = "glfwGetCursorPos")] internal static extern unsafe void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos);
[DllImport(SSC_libName, EntryPoint = "glfwGetCursorPos")] internal static extern unsafe void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos);
[DllImport(SSC_libname, EntryPoint = "glfwSetCursorPos")] internal static extern unsafe void glfwSetCursorPos(IntPtr window, double xpos, double ypos);
[DllImport(SSC_libName, EntryPoint = "glfwSetCursorPos")] internal static extern unsafe void glfwSetCursorPos(IntPtr window, double xpos, double ypos);
[DllImport(SSC_libname, EntryPoint = "glfwCreateCursor")] internal static extern unsafe GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot);
[DllImport(SSC_libName, EntryPoint = "glfwCreateCursor")] internal static extern unsafe GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot);
[DllImport(SSC_libname, EntryPoint = "glfwCreateStandardCursor")] internal static extern unsafe GLFWcursor* glfwCreateStandardCursor(int shape);
[DllImport(SSC_libName, EntryPoint = "glfwCreateStandardCursor")] internal static extern unsafe GLFWcursor* glfwCreateStandardCursor(int shape);
[DllImport(SSC_libname, EntryPoint = "glfwDestroyCursor")] internal static extern unsafe void glfwDestroyCursor(GLFWcursor* cursor);
[DllImport(SSC_libName, EntryPoint = "glfwDestroyCursor")] internal static extern unsafe void glfwDestroyCursor(GLFWcursor* cursor);
[DllImport(SSC_libname, EntryPoint = "glfwSetCursor")] internal static extern unsafe void glfwSetCursor(IntPtr window, GLFWcursor* cursor);
[DllImport(SSC_libName, EntryPoint = "glfwSetCursor")] internal static extern unsafe void glfwSetCursor(IntPtr window, GLFWcursor* cursor);
[DllImport(SSC_libname, EntryPoint = "glfwSetKeyCallback")] internal static extern unsafe GLFWkeyfun glfwSetKeyCallback(IntPtr window, GLFWkeyfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetKeyCallback")] internal static extern unsafe GLFWkeyfun glfwSetKeyCallback(IntPtr window, GLFWkeyfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetCharCallback")] internal static extern unsafe GLFWcharfun glfwSetCharCallback(IntPtr window, GLFWcharfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetCharCallback")] internal static extern unsafe GLFWcharfun glfwSetCharCallback(IntPtr window, GLFWcharfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetCharModsCallback")] internal static extern unsafe GLFWcharmodsfun glfwSetCharModsCallback(IntPtr window, GLFWcharmodsfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetCharModsCallback")] internal static extern unsafe GLFWcharmodsfun glfwSetCharModsCallback(IntPtr window, GLFWcharmodsfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetMouseButtonCallback")] internal static extern unsafe GLFWmousebuttonfun glfwSetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetMouseButtonCallback")] internal static extern unsafe GLFWmousebuttonfun glfwSetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetCursorPosCallback")] internal static extern unsafe GLFWcursorposfun glfwSetCursorPosCallback(IntPtr window, GLFWcursorposfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetCursorPosCallback")] internal static extern unsafe GLFWcursorposfun glfwSetCursorPosCallback(IntPtr window, GLFWcursorposfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetCursorEnterCallback")] internal static extern unsafe GLFWcursorenterfun glfwSetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetCursorEnterCallback")] internal static extern unsafe GLFWcursorenterfun glfwSetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetScrollCallback")] internal static extern unsafe GLFWscrollfun glfwSetScrollCallback(IntPtr window, GLFWscrollfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetScrollCallback")] internal static extern unsafe GLFWscrollfun glfwSetScrollCallback(IntPtr window, GLFWscrollfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwSetDropCallback")] internal static extern unsafe GLFWdropfun glfwSetDropCallback(IntPtr window, GLFWdropfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetDropCallback")] internal static extern unsafe GLFWdropfun glfwSetDropCallback(IntPtr window, GLFWdropfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwJoystickPresent")] internal static extern unsafe int glfwJoystickPresent(int jid);
[DllImport(SSC_libName, EntryPoint = "glfwJoystickPresent")] internal static extern unsafe int glfwJoystickPresent(int jid);
[DllImport(SSC_libname, EntryPoint = "glfwGetJoystickAxes")] internal static extern unsafe float* glfwGetJoystickAxes(int jid, int* count);
[DllImport(SSC_libName, EntryPoint = "glfwGetJoystickAxes")] internal static extern unsafe float* glfwGetJoystickAxes(int jid, int* count);
[DllImport(SSC_libname, EntryPoint = "glfwGetJoystickButtons")] internal static extern unsafe byte* glfwGetJoystickButtons(int jid, int* count);
[DllImport(SSC_libName, EntryPoint = "glfwGetJoystickButtons")] internal static extern unsafe byte* glfwGetJoystickButtons(int jid, int* count);
[DllImport(SSC_libname, EntryPoint = "glfwGetJoystickHats")] internal static extern unsafe byte* glfwGetJoystickHats(int jid, int* count);
[DllImport(SSC_libName, EntryPoint = "glfwGetJoystickHats")] internal static extern unsafe byte* glfwGetJoystickHats(int jid, int* count);
[DllImport(SSC_libname, EntryPoint = "glfwGetJoystickName")] internal static extern unsafe byte* glfwGetJoystickName(int jid);
[DllImport(SSC_libName, EntryPoint = "glfwGetJoystickName")] internal static extern unsafe byte* glfwGetJoystickName(int jid);
[DllImport(SSC_libname, EntryPoint = "glfwGetJoystickGUID")] internal static extern unsafe byte* glfwGetJoystickGUID(int jid);
[DllImport(SSC_libName, EntryPoint = "glfwGetJoystickGUID")] internal static extern unsafe byte* glfwGetJoystickGUID(int jid);
[DllImport(SSC_libname, EntryPoint = "glfwSetJoystickUserPointer")] internal static extern unsafe void glfwSetJoystickUserPointer(int jid, void* pointer);
[DllImport(SSC_libName, EntryPoint = "glfwSetJoystickUserPointer")] internal static extern unsafe void glfwSetJoystickUserPointer(int jid, void* pointer);
[DllImport(SSC_libname, EntryPoint = "glfwGetJoystickUserPointer")] internal static extern unsafe void* glfwGetJoystickUserPointer(int jid);
[DllImport(SSC_libName, EntryPoint = "glfwGetJoystickUserPointer")] internal static extern unsafe void* glfwGetJoystickUserPointer(int jid);
[DllImport(SSC_libname, EntryPoint = "glfwJoystickIsGamepad")] internal static extern unsafe int glfwJoystickIsGamepad(int jid);
[DllImport(SSC_libName, EntryPoint = "glfwJoystickIsGamepad")] internal static extern unsafe int glfwJoystickIsGamepad(int jid);
[DllImport(SSC_libname, EntryPoint = "glfwSetJoystickCallback")] internal static extern unsafe GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback);
[DllImport(SSC_libName, EntryPoint = "glfwSetJoystickCallback")] internal static extern unsafe GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback);
[DllImport(SSC_libname, EntryPoint = "glfwUpdateGamepadMappings")] internal static extern unsafe int glfwUpdateGamepadMappings(byte* str);
[DllImport(SSC_libName, EntryPoint = "glfwUpdateGamepadMappings")] internal static extern unsafe int glfwUpdateGamepadMappings(byte* str);
[DllImport(SSC_libname, EntryPoint = "glfwGetGamepadName")] internal static extern unsafe byte* glfwGetGamepadName(int jid);
[DllImport(SSC_libName, EntryPoint = "glfwGetGamepadName")] internal static extern unsafe byte* glfwGetGamepadName(int jid);
[DllImport(SSC_libname, EntryPoint = "glfwGetGamepadState")] internal static extern unsafe int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
[DllImport(SSC_libName, EntryPoint = "glfwGetGamepadState")] internal static extern unsafe int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
[DllImport(SSC_libname, EntryPoint = "glfwSetClipboardString")] internal static extern unsafe void glfwSetClipboardString(IntPtr window, byte* str);
[DllImport(SSC_libName, EntryPoint = "glfwSetClipboardString")] internal static extern unsafe void glfwSetClipboardString(IntPtr window, byte* str);
[DllImport(SSC_libname, EntryPoint = "glfwGetClipboardString")] internal static extern unsafe byte* glfwGetClipboardString(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwGetClipboardString")] internal static extern unsafe byte* glfwGetClipboardString(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwGetTime")] internal static extern unsafe double glfwGetTime();
[DllImport(SSC_libName, EntryPoint = "glfwGetTime")] internal static extern unsafe double glfwGetTime();
[DllImport(SSC_libname, EntryPoint = "glfwSetTime")] internal static extern unsafe void glfwSetTime(double time);
[DllImport(SSC_libName, EntryPoint = "glfwSetTime")] internal static extern unsafe void glfwSetTime(double time);
[DllImport(SSC_libname, EntryPoint = "glfwGetTimerValue")] internal static extern unsafe ulong* glfwGetTimerValue();
[DllImport(SSC_libName, EntryPoint = "glfwGetTimerValue")] internal static extern unsafe ulong* glfwGetTimerValue();
[DllImport(SSC_libname, EntryPoint = "glfwGetTimerFrequency")] internal static extern unsafe ulong* glfwGetTimerFrequency();
[DllImport(SSC_libName, EntryPoint = "glfwGetTimerFrequency")] internal static extern unsafe ulong* glfwGetTimerFrequency();
[DllImport(SSC_libname, EntryPoint = "glfwMakeContextCurrent")] internal static extern unsafe void glfwMakeContextCurrent(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwMakeContextCurrent")] internal static extern unsafe void glfwMakeContextCurrent(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwGetCurrentContext")] internal static extern unsafe IntPtr glfwGetCurrentContext();
[DllImport(SSC_libName, EntryPoint = "glfwGetCurrentContext")] internal static extern unsafe IntPtr glfwGetCurrentContext();
[DllImport(SSC_libname, EntryPoint = "glfwSwapBuffers")] internal static extern unsafe void glfwSwapBuffers(IntPtr window);
[DllImport(SSC_libName, EntryPoint = "glfwSwapBuffers")] internal static extern unsafe void glfwSwapBuffers(IntPtr window);
[DllImport(SSC_libname, EntryPoint = "glfwSwapInterval")] internal static extern unsafe void glfwSwapInterval(int interval);
[DllImport(SSC_libName, EntryPoint = "glfwSwapInterval")] internal static extern unsafe void glfwSwapInterval(int interval);
[DllImport(SSC_libname, EntryPoint = "glfwExtensionSupported")] internal static extern unsafe int glfwExtensionSupported(byte* extension);
[DllImport(SSC_libName, EntryPoint = "glfwExtensionSupported")] internal static extern unsafe int glfwExtensionSupported(byte* extension);
[DllImport(SSC_libname, EntryPoint = "glfwGetProcAddress", CharSet = CharSet.Ansi)] internal static extern unsafe IntPtr glfwGetProcAddress(string procname);
[DllImport(SSC_libName, EntryPoint = "glfwGetProcAddress", CharSet = CharSet.Ansi)] internal static extern unsafe IntPtr glfwGetProcAddress(string procname);
[DllImport(SSC_libname, EntryPoint = "glfwVulkanSupported")] internal static extern unsafe int glfwVulkanSupported();
[DllImport(SSC_libName, EntryPoint = "glfwVulkanSupported")] internal static extern unsafe int glfwVulkanSupported();
[DllImport(SSC_libname, EntryPoint = "glfwGetRequiredInstanceExtensions")] internal static extern unsafe byte** glfwGetRequiredInstanceExtensions(uint* count);
[DllImport(SSC_libName, EntryPoint = "glfwGetRequiredInstanceExtensions")] internal static extern unsafe byte** glfwGetRequiredInstanceExtensions(uint* count);
//[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetInstanceProcAddress")] internal extern unsafe static GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, byte* procname);
//[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetPhysicalDevicePresentationSupport")] internal extern unsafe static int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily);
@@ -81,6 +81,12 @@ namespace StgSharp.Logic
public void Init(int threadCount)
{
if (threadCount > nodeList.Count)
{
InternalIO.InternalWriteLog(
"Thread setting error: amount of threads of this blueprint is larger than amount of nodes.", LogType.Warning);
threadCount = nodeList.Count;
}
if (threadCount!=0)
{
foreach (var item in allNode)
@@ -105,12 +111,6 @@ namespace StgSharp.Logic
}
}
nodeList.Sort();
if (threadCount > nodeList.Count)
{
InternalIO.InternalWriteLog(
"Thread setting error: amount of threads of this blueprint is larger than amount of nodes.", LogType.Warning);
threadCount = nodeList.Count;
}
}
public void PrepareTasks(int count)
+206 -156
View File
@@ -35,6 +35,7 @@ using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
@@ -43,29 +44,43 @@ namespace StgSharp.Graphics
public sealed class Camera : IglConvertable
{
internal Uniform<Matrix44> convertedUniform;
internal bool _isLookAtAvailable;
internal Matrix44 cameraAtt;
internal vec3d _target, up, cameraCoord;
private bool _isLookAtAvailable;
internal Matrix44 _lookAt;
internal Matrix44 _projection;
internal Matrix44 cameraAtt;
internal Matrix44 rotation;
internal Matrix44 rotationAtt;
internal Radius _pitch;
internal Radius _row;
internal Radius _yaw;
internal Uniform<Matrix44> convertedUniform;
internal vec3d _target, up;
public Camera()
{
cameraAtt = Matrix44.Unit;
_target = Vec3d.Zero;
up = Vec3d.Zero;
cameraCoord = new vec3d(0,0,1);
_isLookAtAvailable = false;
_lookAt = Matrix44.Unit;
rotationAtt = Matrix44.Unit;
_projection = new Matrix44();
}
public Camera(vec3d position, vec3d target, vec3d up) : this()
{
rotationAtt = Matrix44.Unit;
cameraAtt = new Matrix44();
SetViewDirection(position, target, up);
_pitch = Radius.Zero;
_row = Radius.Zero;
_yaw = Radius.Zero;
}
public Matrix44 Projection
=> _projection;
public Matrix44 View
{
get
@@ -75,159 +90,13 @@ namespace StgSharp.Graphics
return _lookAt;
}
Matrix44 move = Matrix44.Unit;
move.colum3.vec -= cameraCoord.vec;
_lookAt = cameraAtt.Transpose * move;
move.colum3.vec -= cameraAtt.colum3.vec;
_lookAt = rotationAtt.Transpose * move;
_isLookAtAvailable = true;
return _lookAt;
}
}
public Matrix44 Projection
=> _projection;
public void MoveNear(float distance)
{
cameraCoord.Z -= distance;
}
public void MoveRight(float distance)
{
cameraCoord.X -= distance;
}
public void MoveUp(float distance)
{
cameraCoord.Y -= distance;
}
public void SetViewRange(Radius fovRadius, vec2d size, vec2d offset, (float front, float back) dephRange)
{
float
distance = _target.GetLength(),
near = distance - dephRange.front,
far = distance + dephRange.back,
offsetX = offset.X,
offsetY = offset.Y,
width = Scaler.Abs(GeometryScaler.Tan(fovRadius / 2) * near *2),
height = width * size.Y / size.X;
_projection.colum0.X = 2 * near / width;
_projection.colum1.Y = 2 * near / height;
_projection.colum2.X = 2 * offsetX / width;
_projection.colum2.Y = 2 * offsetY / height;
_projection.colum2.Z = (far + near) / (near - far);
_projection.colum2.W = -1;
_projection.colum3.Z = 2 * near * far / (near - far);
}
public void Test(params vec4d[] vec)
{
Console.WriteLine(View);
Console.WriteLine(Projection);
Console.WriteLine(Projection * View);
foreach (var item in vec)
{
Console.Write($"{Projection * View * item};");
}
}
public void Pitch(Radius r)
{
_isLookAtAvailable = false;
Matrix32 partialCoord = new Matrix32(
cameraAtt.colum1.vec,
cameraAtt.colum2.vec
);
float angle = -r._radius;
//Console.WriteLine(angle);
Matrix22 rotation = new Matrix22(
Scaler.Cos(angle), -Scaler.Sin(angle),
Scaler.Sin(angle), Scaler.Cos( angle)
);
partialCoord *= rotation;
cameraAtt.colum1.vec = partialCoord.colum0.vec;
cameraAtt.colum2.vec = partialCoord.colum1.vec;
cameraAtt.isTransposed = false;
}
public void Row(Radius r)
{
_isLookAtAvailable = false;
Matrix32 partialCoord = new Matrix32(
cameraAtt.colum0.vec,
cameraAtt.colum1.vec
);
float angle = -r._radius;
//Console.WriteLine(angle);
Matrix22 rotation = new Matrix22(
Scaler.Cos(angle), -Scaler.Sin(angle),
Scaler.Sin(angle), Scaler.Cos(angle)
);
partialCoord *= rotation;
cameraAtt.colum0.vec = partialCoord.colum0.vec;
cameraAtt.colum1.vec = partialCoord.colum1.vec;
cameraAtt.isTransposed = false;
}
public void Yaw(Radius r)
{
_isLookAtAvailable = false;
Matrix32 partialCoord = new Matrix32(
cameraAtt.colum0.vec,
cameraAtt.colum2.vec
);
float angle = -r._radius;
//Console.WriteLine(angle);
Matrix22 rotation = new Matrix22(
Scaler.Cos(angle), -Scaler.Sin(angle),
Scaler.Sin(angle), Scaler.Cos(angle)
);
partialCoord *= rotation;
cameraAtt.colum0.vec = partialCoord.colum0.vec;
cameraAtt.colum2.vec = partialCoord.colum1.vec;
cameraAtt.isTransposed = false;
}
public void SetViewDirection(vec3d position, vec3d target, vec3d up)
{
vec3d direction = position - target;
if (position == cameraCoord && this.up == up && cameraAtt.colum2.vec == direction.vec)
{
//no difference with precious value
return;
}
if (direction.GetLength() == 0)
{
//deadlock
throw new ArgumentException();
}
if (Vec3d.IsParallel(direction, up))
{
throw new ArgumentException();
}
_target = direction;
cameraCoord = position;
this.up = up;
_isLookAtAvailable = false;
Linear.Normalize(ref direction, ref up);
vec3d right = Linear.Normalize(Linear.Cross(up,direction));
cameraAtt.colum0.vec = right.vec;
cameraAtt.colum1.vec = up.vec;
cameraAtt.colum2.vec = direction.vec;
cameraAtt.isTransposed = false;
}
public void DisplayGLtypeDefinition()
{
Console.WriteLine("uniform matrix4x4 cameraName;");
@@ -244,23 +113,204 @@ namespace StgSharp.Graphics
/// <exception cref="ArgumentException"></exception>
public unsafe void GainAllUniforms(ShaderProgram source, params string[] uniformName)
{
if (uniformName.Length!=1)
if (uniformName.Length != 1)
{
throw new ArgumentException();
}
convertedUniform = source.GetUniform<Matrix44>(uniformName[0]);
}
ShaderStruct IglConvertable.GetConvertedGLtype()
public void MoveNear(float distance)
{
throw new NotImplementedException();
cameraAtt.colum3.Z -= distance;
_isLookAtAvailable = false;
}
public void MoveRight(float distance)
{
cameraAtt.colum3.X -= distance;
_isLookAtAvailable = false;
}
public void MoveUp(float distance)
{
cameraAtt.colum3.Y -= distance;
_isLookAtAvailable = false;
}
public unsafe void SetAllUniforms()
{
//Console.WriteLine(Projection * View);
GL.SetValue(convertedUniform, Projection * View);
}
public void SetViewDirection(vec3d position, vec3d target, vec3d up)
{
vec3d direction = position - target;
if ((position.vec == cameraAtt.colum3.vec) && (this.up == up) && (cameraAtt.colum2.vec == direction.vec))
{
//no difference with precious value
return;
}
if (direction.GetLength() == 0)
{
//deadlock
throw new ArgumentException();
}
if (Vec3d.IsParallel(direction, up))
{
throw new ArgumentException();
}
_target = direction;
this.up = up;
_isLookAtAvailable = false;
Linear.Normalize(ref direction, ref up);
vec3d right = Linear.Normalize(Linear.Cross(up, direction));
cameraAtt.colum0.vec = right.vec;
cameraAtt.colum1.vec = up.vec;
cameraAtt.colum2.vec = direction.vec;
cameraAtt.colum3.vec = position.vec;
InternalPitch();
InternalRow();
InternalYaw();
}
public void SetViewRange(Radius fovRadius, vec2d size, vec2d offset, (float front, float back) dephRange)
{
float
distance = _target.GetLength(),
near = distance - dephRange.front,
far = distance + dephRange.back,
offsetX = offset.X,
offsetY = offset.Y,
width = Scaler.Abs(GeometryScaler.Tan(fovRadius / 2) * near * 2),
height = (width * size.Y) / size.X;
_projection.colum0.X = (2 * near) / width;
_projection.colum1.Y = (2 * near) / height;
_projection.colum2.X = (2 * offsetX) / width;
_projection.colum2.Y = (2 * offsetY) / height;
_projection.colum2.Z = (far + near) / (near - far);
_projection.colum2.W = -1;
_projection.colum3.Z = (2 * near * far) / (near - far);
}
public void Test(params vec4d[] vec)
{
Console.WriteLine(View);
Console.WriteLine(Projection);
Console.WriteLine(Projection * View);
Console.WriteLine(View);
foreach (var item in vec)
{
Console.Write($"{Projection * View * item};");
}
}
#region ratation
public void Yaw(Radius r)
{
_yaw -= r;
//Console.WriteLine(_yaw._radius);
//Console.WriteLine(rotationAtt);
InternalYaw();
}
public void Pitch(Radius r)
{
_pitch -= r;
//Console.WriteLine(_pitch._radius);
//Console.WriteLine(rotationAtt);
InternalPitch();
}
public void Row(Radius r)
{
_row -= r;
//Console.WriteLine(_row._radius);
//Console.WriteLine(rotationAtt);
InternalRow();
}
internal void InternalPitch()
{
_isLookAtAvailable = false;
Matrix32 partialCoord = new Matrix32(
cameraAtt.colum1.vec,
cameraAtt.colum2.vec
);
float angle = _pitch._radius;
Matrix22 rotation = new Matrix22(
Scaler.Cos(angle), -Scaler.Sin(angle),
Scaler.Sin(angle), Scaler.Cos(angle)
);
partialCoord *= rotation;
rotationAtt.colum1.vec = partialCoord.colum0.vec;
rotationAtt.colum2.vec = partialCoord.colum1.vec;
rotationAtt.isTransposed = false;
}
internal void InternalRow()
{
_isLookAtAvailable = false;
Matrix32 partialCoord = new Matrix32(
cameraAtt.colum0.vec,
cameraAtt.colum1.vec
);
float angle = _row._radius;
Matrix22 rotation = new Matrix22(
Scaler.Cos(angle), -Scaler.Sin(angle),
Scaler.Sin(angle), Scaler.Cos(angle)
);
partialCoord *= rotation;
rotationAtt.colum0.vec = partialCoord.colum0.vec;
rotationAtt.colum1.vec = partialCoord.colum1.vec;
rotationAtt.isTransposed = false;
}
internal void InternalYaw()
{
_isLookAtAvailable = false;
Matrix32 partialCoord = new Matrix32(
cameraAtt.colum0.vec,
cameraAtt.colum2.vec
);
float angle = _yaw._radius;
Matrix22 rotation = new Matrix22(
Scaler.Cos(angle), -Scaler.Sin(angle),
Scaler.Sin(angle), Scaler.Cos(angle)
);
partialCoord *= rotation;
rotationAtt.colum0.vec = partialCoord.colum0.vec;
rotationAtt.colum2.vec = partialCoord.colum1.vec;
rotationAtt.isTransposed = false;
}
#endregion
ShaderStruct IglConvertable.GetConvertedGLtype()
{
throw new NotImplementedException();
}
~Camera()
{
}
@@ -14,7 +14,7 @@ namespace StgSharp
internal static partial class InternalIO
{
[DllImport(SSC_libname, EntryPoint = "normalize",
[DllImport(SSC_libName, EntryPoint = "normalize",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Normalize(M128* source, M128* target);
+5 -5
View File
@@ -42,7 +42,7 @@ namespace StgSharp
#region add
[DllImport(InternalIO.SSC_libname, EntryPoint = "add_Mat2",
[DllImport(InternalIO.SSC_libName, EntryPoint = "add_Mat2",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern Mat2* add_mat2(Mat2* left, Mat2* right);
@@ -52,7 +52,7 @@ namespace StgSharp
#region deinit mat2
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_mat2",
[DllImport(InternalIO.SSC_libName, EntryPoint = "deinit_mat2",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void deinit_mat2(Mat2* mat);
@@ -61,7 +61,7 @@ namespace StgSharp
#region sub
[DllImport(InternalIO.SSC_libname, EntryPoint = "sub_mat2",
[DllImport(InternalIO.SSC_libName, EntryPoint = "sub_mat2",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe Mat2* sub_mat2(Mat2* left, Mat2* right);
@@ -71,12 +71,12 @@ namespace StgSharp
#region transpose
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose2to4",
[DllImport(InternalIO.SSC_libName, EntryPoint = "transpose2to4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void Transpose2to4_internal(Mat2* source, Mat4* target);
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose2to3",
[DllImport(InternalIO.SSC_libName, EntryPoint = "transpose2to3",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void Transpose2to3_internal(Mat2* source, Mat3* target);
+4 -4
View File
@@ -42,7 +42,7 @@ namespace StgSharp
#region det
[DllImport(InternalIO.SSC_libname, EntryPoint = "det_mat3",
[DllImport(InternalIO.SSC_libName, EntryPoint = "det_mat3",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe float det_mat3(Mat3* mat);
@@ -51,15 +51,15 @@ namespace StgSharp
#region transpose
[DllImport(SSC_libname, EntryPoint = "transpose3to4",
[DllImport(SSC_libName, EntryPoint = "transpose3to4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to4_internal(Mat3* source, Mat4* target);
[DllImport(SSC_libname, EntryPoint = "transpose3to3",
[DllImport(SSC_libName, EntryPoint = "transpose3to3",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to3_internal(Mat3* source, Mat3* target);
[DllImport(SSC_libname, EntryPoint = "transpose3to2",
[DllImport(SSC_libName, EntryPoint = "transpose3to2",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to2_internal(Mat3* source, Mat2* target);
+5 -5
View File
@@ -44,7 +44,7 @@ namespace StgSharp
#region deinit_mat4
[DllImport(SSC_libname, EntryPoint = "deinit_mat4",
[DllImport(SSC_libName, EntryPoint = "deinit_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern void deinit_mat4(Mat4* mat);
@@ -53,7 +53,7 @@ namespace StgSharp
#region det
[DllImport(SSC_libname, EntryPoint = "det_mat4",
[DllImport(SSC_libName, EntryPoint = "det_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe float det_mat4(Mat4* matPtr, Mat4* transpose);
@@ -63,15 +63,15 @@ namespace StgSharp
#region transpose
[DllImport(SSC_libname, EntryPoint = "transpose4to4",
[DllImport(SSC_libName, EntryPoint = "transpose4to4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to4_internal(Mat4* source, Mat4* target);
[DllImport(SSC_libname, EntryPoint = "transpose4to3",
[DllImport(SSC_libName, EntryPoint = "transpose4to3",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to3_internal(Mat4* source, Mat3* target);
[DllImport(SSC_libname, EntryPoint = "transpose4to2",
[DllImport(SSC_libName, EntryPoint = "transpose4to2",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to2_internal(Mat4* source, Mat2* target);
+32 -2
View File
@@ -29,10 +29,15 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Controlling;
using StgSharp.Math.HighPrecession;
using System;
using System.Collections.Generic;
using System.Data;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics.Arm;
using System.Security.Cryptography;
using System.Text;
namespace StgSharp.Math
@@ -77,14 +82,39 @@ namespace StgSharp.Math
return result;
}
private static byte[] randomSeed;
/// <summary>
///
/// </summary>
/// <returns></returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Random()
public static T Random<T>() where T : struct, IConvertible
#if NET8_0_OR_GREATER
,INumber
#endif
{
throw new NotImplementedException();
if (randomSeed==null)
{
randomSeed = new byte[64];
var originSeed =
$"{(Assembly.GetEntryAssembly()==null? Assembly.GetAssembly(typeof(StgSharp))!:
Assembly.GetEntryAssembly())}" +
$"{DateTime.UtcNow.ToString("o")}";
using (SHA256 sha = SHA256.Create())
{
randomSeed = sha.ComputeHash(Encoding.UTF8.GetBytes(originSeed));
}
}
using (SHA256 sha = SHA256.Create())
{
randomSeed = sha.ComputeHash(randomSeed);
}
fixed (byte* bptr = randomSeed)
{
return *(T*)bptr;
}
}
/// <summary>
@@ -9,21 +9,13 @@
".NETStandard,Version=v2.1/": {
"StgSharp/1.0.0": {
"dependencies": {
"Microsoft.Bcl.HashCode": "1.1.1",
"Microsoft.CSharp": "4.7.0"
"Microsoft.CSharp": "4.7.0",
"Microsoft.Windows.CsWin32": "0.3.49-beta"
},
"runtime": {
"StgSharp.dll": {}
}
},
"Microsoft.Bcl.HashCode/1.1.1": {
"runtime": {
"lib/netstandard2.1/Microsoft.Bcl.HashCode.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "4.700.20.56604"
}
}
},
"Microsoft.CSharp/4.7.0": {
"runtime": {
"lib/netstandard2.0/Microsoft.CSharp.dll": {
@@ -31,6 +23,59 @@
"fileVersion": "4.700.19.56404"
}
}
},
"Microsoft.Windows.CsWin32/0.3.49-beta": {
"dependencies": {
"Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha",
"Microsoft.Windows.SDK.Win32Metadata": "55.0.45-preview",
"Microsoft.Windows.WDK.Win32Metadata": "0.9.9-experimental",
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"Microsoft.Windows.SDK.Win32Docs/0.1.42-alpha": {},
"Microsoft.Windows.SDK.Win32Metadata/55.0.45-preview": {},
"Microsoft.Windows.WDK.Win32Metadata/0.9.9-experimental": {
"dependencies": {
"Microsoft.Windows.SDK.Win32Metadata": "55.0.45-preview"
}
},
"System.Buffers/4.5.1": {
"runtime": {
"lib/netstandard2.0/System.Buffers.dll": {
"assemblyVersion": "4.0.3.0",
"fileVersion": "4.6.28619.1"
}
}
},
"System.Memory/4.5.5": {
"dependencies": {
"System.Buffers": "4.5.1",
"System.Numerics.Vectors": "4.4.0",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
},
"runtime": {
"lib/netstandard2.0/System.Memory.dll": {
"assemblyVersion": "4.0.1.2",
"fileVersion": "4.6.31308.1"
}
}
},
"System.Numerics.Vectors/4.4.0": {
"runtime": {
"lib/netstandard2.0/System.Numerics.Vectors.dll": {
"assemblyVersion": "4.1.3.0",
"fileVersion": "4.6.25519.3"
}
}
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
"runtime": {
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {
"assemblyVersion": "6.0.0.0",
"fileVersion": "6.0.21.52210"
}
}
}
}
},
@@ -40,19 +85,68 @@
"serviceable": false,
"sha512": ""
},
"Microsoft.Bcl.HashCode/1.1.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-MalY0Y/uM/LjXtHfX/26l2VtN4LDNZ2OE3aumNOHDLsT4fNYy2hiHXI4CXCqKpNUNm7iJ2brrc4J89UdaL56FA==",
"path": "microsoft.bcl.hashcode/1.1.1",
"hashPath": "microsoft.bcl.hashcode.1.1.1.nupkg.sha512"
},
"Microsoft.CSharp/4.7.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==",
"path": "microsoft.csharp/4.7.0",
"hashPath": "microsoft.csharp.4.7.0.nupkg.sha512"
},
"Microsoft.Windows.CsWin32/0.3.49-beta": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/iAXplVDKESFyLz/MShuVYVx62YFvFePpq3qrzREl8KScQqG6Z2kV7r9UJTjQS1g+hfy3V+e4m1x9lsu24YNSg==",
"path": "microsoft.windows.cswin32/0.3.49-beta",
"hashPath": "microsoft.windows.cswin32.0.3.49-beta.nupkg.sha512"
},
"Microsoft.Windows.SDK.Win32Docs/0.1.42-alpha": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Z/9po23gUA9aoukirh2ItMU2ZS9++Js9Gdds9fu5yuMojDrmArvY2y+tq9985tR3cxFxpZO1O35Wjfo0khj5HA==",
"path": "microsoft.windows.sdk.win32docs/0.1.42-alpha",
"hashPath": "microsoft.windows.sdk.win32docs.0.1.42-alpha.nupkg.sha512"
},
"Microsoft.Windows.SDK.Win32Metadata/55.0.45-preview": {
"type": "package",
"serviceable": true,
"sha512": "sha512-2i1kVIk8rMuMCYtoeYeWbmCRLqNgb63Berac3Gv+J/pjp0oucopasKgLQNslryhsgBl4xex9ENhJX2MXEW5vdA==",
"path": "microsoft.windows.sdk.win32metadata/55.0.45-preview",
"hashPath": "microsoft.windows.sdk.win32metadata.55.0.45-preview.nupkg.sha512"
},
"Microsoft.Windows.WDK.Win32Metadata/0.9.9-experimental": {
"type": "package",
"serviceable": true,
"sha512": "sha512-cncPlxLqR25mFOuvpxZPgXgJqRmXyV5eTULj/9w8AQvO/c1xJDEapohRsWkYaia7hCR/EwEzBHr7RU9u93T03w==",
"path": "microsoft.windows.wdk.win32metadata/0.9.9-experimental",
"hashPath": "microsoft.windows.wdk.win32metadata.0.9.9-experimental.nupkg.sha512"
},
"System.Buffers/4.5.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==",
"path": "system.buffers/4.5.1",
"hashPath": "system.buffers.4.5.1.nupkg.sha512"
},
"System.Memory/4.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==",
"path": "system.memory/4.5.5",
"hashPath": "system.memory.4.5.5.nupkg.sha512"
},
"System.Numerics.Vectors/4.4.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==",
"path": "system.numerics.vectors/4.4.0",
"hashPath": "system.numerics.vectors.4.4.0.nupkg.sha512"
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==",
"path": "system.runtime.compilerservices.unsafe/6.0.0",
"hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512"
}
}
}
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8149dfacb01d49f8173ee2799eb2bc20f34ee231")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66efce19fcb461782c49255dc5500144f8c267e6")]
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/8149dfacb01d49f8173ee2799eb2bc20f34ee231/*"}}
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/66efce19fcb461782c49255dc5500144f8c267e6/*"}}
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66efce19fcb461782c49255dc5500144f8c267e6")]
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+98aa111a299366695c7ec9bbfdce90445050afa2")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66efce19fcb461782c49255dc5500144f8c267e6")]
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9a10ec201c1e78c441727446c2649fae962d9b7a")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66efce19fcb461782c49255dc5500144f8c267e6")]
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]