daily update on 20231031 by nitload youmu, problem in loading api and converting function pointers

This commit is contained in:
Nitload
2023-11-01 02:41:08 +08:00
parent cb87cad98c
commit 588a61d514
61 changed files with 1624 additions and 3164 deletions
+16 -16
View File
@@ -67,7 +67,7 @@ namespace StgSharp
VertexBuffer vbo = new VertexBuffer(1);
ElementBuffer ebo = new ElementBuffer(1);
GL.context->BindVertexArray(vao[0]);
GL.glBindVertexArray(vao[0]);
@@ -76,35 +76,35 @@ namespace StgSharp
GL.context->VertexAttribPointer(0, 3, GLconst.FLOAT, false, 4 * sizeof(float), (void*)0);
GL.context->EnableVertexAttribArray(0);
GL.glVertexAttribPointer(0, 3, GLconst.FLOAT, false, 4 * sizeof(float), (void*)0);
GL.glEnableVertexAttribArray(0);
/**/
GL.context->BindBuffer(GLconst.ARRAY_BUFFER, 0);
GL.context->BindVertexArray(0);
GL.glBindBuffer(GLconst.ARRAY_BUFFER, 0);
GL.glBindVertexArray(0);
/**/
while (GL.glfw.WindowShouldClose(f.windowID) == 0)
while (InternalIO.glfw_WindowShouldClose(f.windowID) == 0)
{
ProcessInput(f.windowID);
GL.ClearColor(0.2f, 0.3f, 0.3f, 1.0f);
GL.context->Clear(GLconst.COLOR_BUFFER_BIT);
GL.glClear(GLconst.COLOR_BUFFER_BIT);
shader.Use();
GL.context->BindVertexArray(vao._bufferID[0]);
GL.glBindVertexArray(vao._bufferID[0]);
GL.DrawElements(GepmetryType.TRIANGLES, 9, typeof(uint), IntPtr.Zero);
GL.context->BindVertexArray(0);
GL.glBindVertexArray(0);
GL.glfw.SwapBuffers(f.windowID);
GL.glfw.PollEvents();
GL.glfw.PollEvents();
InternalIO.glfw_SwapBuffers(f.windowID);
InternalIO.glfw_PollEvents();
InternalIO.glfw_PollEvents();
}
/**/
@@ -119,7 +119,7 @@ namespace StgSharp
Graphic.glDeleteBuffers(1, &vao);
/**/
GL.glfw.Terminate();
InternalIO.glfw_Terminate();
}
internal unsafe static void Main(string[] args)
@@ -138,15 +138,15 @@ namespace StgSharp
public static unsafe void FormSizeCallback(IntPtr window, int width, int height)
{
GL.context->Viewport(0, 0, width, height);
GL.glViewport(0, 0, width, height);
}
public static unsafe void ProcessInput(IntPtr windowPtr)
{
if (GL.glfw.GetKey(windowPtr, (int)Control.Key.ESCAPE)
if (InternalIO.glfw_GetKey(windowPtr, (int)Control.Key.ESCAPE)
== KeyStatus.PRESS)
{
GL.glfw.SetWindowShouldClose(windowPtr, 1);
InternalIO.glfw_SetWindowShouldClose(windowPtr, 1);
}
}