daily update on 20230529 by nitload youmu
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,10 +18,15 @@
|
||||
#endif
|
||||
/**/
|
||||
|
||||
/**/
|
||||
extern STGSHARPGRAPHICS_API int* versionInfo;
|
||||
/**/
|
||||
|
||||
STGSHARPGRAPHICS_API basicWindowInfo* InitWindow(basicWindowInfo info);
|
||||
STGSHARPGRAPHICS_API void ComppileShader(void);
|
||||
STGSHARPGRAPHICS_API void RenderWindow(GLFWwindow* window, basicWindowInfo info);
|
||||
STGSHARPGRAPHICS_API void TerminateWindow(void);
|
||||
|
||||
STGSHARPGRAPHICS_API int fnStgSharpGraphics(void);
|
||||
STGSHARPGRAPHICS_API int initWindow(basicWindowInfo info);
|
||||
STGSHARPGRAPHICS_API IOpackage initPackage(void);
|
||||
|
||||
STGSHARPGRAPHICS_API TriangleVertexHandler initTriangle(void);
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user