daily update on 20230529 by nitload youmu

This commit is contained in:
Nitload
2023-05-29 04:36:01 +08:00
parent 9ca4a69a2a
commit 1874b32fb0
62 changed files with 1142 additions and 1250 deletions
+20 -24
View File
@@ -41,22 +41,17 @@ STGSHARPGRAPHICS_API int* versionInfo = &version;
// 这是导出函数的一个示例。
STGSHARPGRAPHICS_API int fnStgSharpGraphics(void)
{
return 0;
}
STGSHARPGRAPHICS_API IOpackage initPackage(void)
{
IOpackage pack;
pack.InitWindow = initWindow;
pack.InitWindow = InitWindow;
return pack;
}
STGSHARPGRAPHICS_API int initWindow(basicWindowInfo info)
STGSHARPGRAPHICS_API basicWindowInfo* InitWindow(basicWindowInfo info)
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
@@ -83,7 +78,11 @@ STGSHARPGRAPHICS_API int initWindow(basicWindowInfo info)
}
glfwSwapInterval(0);
return window;
}
STGSHARPGRAPHICS_API void ComppileShader(void)
{
//编译顶点着色器
unsigned int vertexShader;
@@ -133,7 +132,10 @@ STGSHARPGRAPHICS_API int initWindow(basicWindowInfo info)
glEnableVertexAttribArray(0);
/**/
}
STGSHARPGRAPHICS_API void RenderWindow(GLFWwindow* window, basicWindowInfo info)
{
while (!glfwWindowShouldClose(window))
{
if (1)
@@ -145,12 +147,12 @@ STGSHARPGRAPHICS_API int initWindow(basicWindowInfo info)
// render
// ------
/**/
glClearColor(
info.backgroundColor.x,
info.backgroundColor.y,
info.backgroundColor.Z,
info.backgroundColor.x,
info.backgroundColor.y,
info.backgroundColor.Z,
info.backgroundColor.w
);
/**/
@@ -158,9 +160,9 @@ STGSHARPGRAPHICS_API int initWindow(basicWindowInfo info)
glClear(GL_COLOR_BUFFER_BIT);
// draw our first triangle
/**/
/*
glUseProgram(shaderProgram);
glBindVertexArray(VAO);
glBindVertexArray(VAO);
// seeing as we only have a single VAO there's no need to bind it every time,
// but we'll do so to keep things a bit more organized
glDrawArrays(GL_TRIANGLES, 0, 3);
@@ -172,26 +174,20 @@ STGSHARPGRAPHICS_API int initWindow(basicWindowInfo info)
glfwSwapBuffers(window);
glfwPollEvents();
}
}
STGSHARPGRAPHICS_API void TerminateWindow(void)
{
// glfw: terminate, clearing all previously allocated GLFW resources.
// ------------------------------------------------------------------
glfwTerminate();
/**/
/*
//glDeleteVertexArrays(1, &VAO);
glDeleteBuffers(1, &VBO);
//glDeleteBuffers(1, &EBO);
glDeleteProgram(shaderProgram);
/**/
return 0;
}
void renderTriangle()
{
}