代码实现 1.1 C++部分 GLFWwindow *window; GLuint shader_program; GLuint VAO; void init() { static const GLfloat positions[] = { -1.0f, -1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, }; static const GLfloat color…