daily update on 20231016 by nitload youmu, vao,vbo,ebo struct added

This commit is contained in:
Nitload
2023-10-17 01:22:30 +08:00
parent 6c3349f5a2
commit 614fabe26c
135 changed files with 28619 additions and 5432 deletions
+3 -3
View File
@@ -6,9 +6,9 @@ namespace StgSharp
public static unsafe partial class Geometry
{
public static unsafe Triangle InitTriagnle<T>(
Vec3d vertex1,
Vec3d vertex2,
Vec3d vertex3
vec3d vertex1,
vec3d vertex2,
vec3d vertex3
) where T : Triangle
{
Triangle t = new Triangle();
+5
View File
@@ -328,6 +328,11 @@ namespace StgSharp
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWframebuffersizefun glfwSetFramebufferSizeCallback(IntPtr window, GLFWframebuffersizefun callback);
//window is the pointer to a glfwwindow instance
[DllImport(SSGC_libname, EntryPoint = "glfwSetFramebufferSizeCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWframebuffersizefun glfwSetFramebufferSizeCallback(IntPtr window, FrameBufferSizeHadler callback);
[DllImport(SSGC_libname, EntryPoint = "glfwSetErrorCallback",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
+60 -6
View File
@@ -1,20 +1,74 @@
using StgSharp.Geometries;
using StgSharp.Geometries;
using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace StgSharp
{
internal enum LogType
{
Error,
Warning,
Info,
InfoError,
InfoWarning,
}
internal static unsafe partial class internalIO
{
internal const string SSGC_libname =
"StgSharpGraphic";
internal const string SSG_errorlog =
"SSG_errorlog.log";
internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType)
{
if (!File.Exists(internalIO.SSG_errorlog))
{
FileStream stream = File.Create(internalIO.SSG_errorlog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
{
logStream.WriteLine(beforeTime);
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
logStream.WriteLine(logLine);
}
}
internal static void InternalWriteLog(string logLine, LogType logType)
{
if (!File.Exists(internalIO.SSG_errorlog))
{
FileStream stream = File.Create(internalIO.SSG_errorlog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
{
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
logStream.WriteLine(logLine);
}
}
internal static void InternalAppendLog(string log)
{
if (!File.Exists(internalIO.SSG_errorlog))
{
FileStream stream = File.Create(internalIO.SSG_errorlog);
stream.Close();
}
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
{
logStream.WriteLine(log);
}
}
}
}