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
+8 -2
View File
@@ -21,6 +21,11 @@ namespace StgSharp.Graphics
api = context;
}
GLcontext* IglFunc.Context
{
get => api;
}
void IglFunc.SwitchContext()
{
@@ -104,11 +109,11 @@ namespace StgSharp.Graphics
byte[] data = Encoding.UTF8.GetBytes(shaderCodeArray[i] + '\0');
fixed (byte* codePtr = data)
{
shaderID = InternalIO.InternalLoadShaderCode(codePtr, (int)shaderType);
shaderID = InternalIO.InternalLoadShaderCode(api, codePtr, (int)shaderType);
}
if (shaderID == 0) //compile error handler
{
IntPtr logPtr = InternalIO.InternalReadLog();
IntPtr logPtr = InternalIO.InternalReadSSCLog();
string log;
try
{
@@ -326,6 +331,7 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, T[] pixels)
{
Console.WriteLine(pixels);
IntPtr source = GCHandle.Alloc(pixels, GCHandleType.Pinned).AddrOfPinnedObject();
api->glTexImage2D(
(uint)target, level, internalformat, width, height, 0, format, type, (void*)source