Daily update on 20231211 by nitload youmu

This commit is contained in:
Nitload
2023-12-12 03:17:16 +08:00
parent ab85c1a9fe
commit f97fb137ba
100 changed files with 2699 additions and 3191 deletions
+19 -12
View File
@@ -22,6 +22,7 @@ namespace StgSharp
Texture texture;
VertexArray vao;
VertexBuffer vbo;
public static unsafe void ProcessInput(IntPtr windowPtr)
{
if (InternalIO.glfw.GetKey(windowPtr, (int)Operation.Key.ESCAPE)
@@ -31,7 +32,7 @@ namespace StgSharp
}
}
public override void Deinit(object[] args)
public override void Deinit(object[] args, IglFunc GL)
{
/**/
vao.Dispose();
@@ -47,7 +48,7 @@ namespace StgSharp
GL.Viewport(0, 0, width, height);
}
public override void Init(object[] args)
public override void Init(object[] args, IglFunc GL)
{
InternalIO.InternalWriteLog("\n\n\n", "Program start", LogType.Info);
@@ -92,9 +93,9 @@ namespace StgSharp
);
vao = CreateVertexArray(1);
vbo = CreateVertexBuffer(2);
ebo = CreateElementBuffer(1);
vao = new VertexArray(1);
vbo = new VertexBuffer(2);
ebo = new ElementBuffer(1);
texture = CreateTexture(2);
@@ -142,11 +143,11 @@ namespace StgSharp
}
public override void OnRenderFrame(object[] args)
public override void OnRenderFrame(object[] args, IglFunc GL)
{
}
public override void OnUpdateFrame(object[] args)
public override void OnUpdateFrame(object[] args, IglFunc GL)
{
ProcessInput(windowID);
@@ -173,12 +174,18 @@ namespace StgSharp
);
vao.Bind(0);
GL.DrawElements(GepmetryType.TRIANGLES, 6, typeof(uint), IntPtr.Zero);
vao.BindNull();
InternalIO.glfw.SwapBuffers(windowID);
InternalIO.glfw.PollEvents();
AlignFrame(this, () =>
{
GL.DrawElements(GepmetryType.TRIANGLES, 6, typeof(uint), IntPtr.Zero);
vao.BindNull();
InternalIO.glfw.SwapBuffers(windowID);
InternalIO.glfw.PollEvents();
});
}
}
@@ -190,7 +197,7 @@ namespace StgSharp
try
{
StgSharpDemoForm demoForm = new StgSharpDemoForm();
demoForm.ShowForm();
demoForm.Show(null);
}
catch (Exception ex)
{