#include "glad/glad.h" #include "GLFW/glfw3.h" #include "stdio.h" #include "StgSharpGraphics.h" extern float* triangleVertexes; STGSHARPGRAPHICS_API TriangleVertexHandler initTriangle(void) { float vertex[9] = { 0,0,0, 0,0,0, 0,0,0, }; TriangleVertexHandler tri; tri.vertex1 = &vertex[0]; tri.vertex2 = &vertex[3]; tri.vertex3 = &vertex[6]; return tri; } STGSHARPGRAPHICS_API void inputTriangle(TriangleVertexHandler triangle) { triangleVertices = triangle.vertex1; } STGSHARPGRAPHICS_API Polygon4VertexesHandler initPolygon4(void) { float vertex[12] = { 0,0,0, 0,0,0, 0,0,0, 0,0,0, }; int triangleOrder[6] = { 0,1,3, 1,2,3, }; Polygon4VertexesHandler poly; poly.vertex1 = &vertex[0]; poly.vertex2 = &vertex[3]; poly.vertex3 = &vertex[6]; poly.vertex4 = &vertex[9]; poly.triangle1 = &triangleOrder[0]; poly.triangle2 = &triangleOrder[3]; return poly; } STGSHARPGRAPHICS_API Polygon5VertexesHandler initPolygon5(void) { float vertex[15] = { 0,0,0, 0,0,0, 0,0,0, 0,0,0, 0,0,0, }; int triangleOrder[9] = { 0,1,2, 1,2,3, 2,3,4 }; Polygon5VertexesHandler poly; poly.vertex1 = &vertex[0]; poly.vertex2 = &vertex[3]; poly.vertex3 = &vertex[6]; poly.vertex4 = &vertex[9]; poly.triangle1 = &triangleOrder[0]; poly.triangle2 = &triangleOrder[3]; return poly; }