摘要: 1 #include <GL/glew.h> 2 #include <GLFW/glfw3.h> 3 #include <iostream> 4 #include <fstream> 5 #include <string> 6 7 using namespace std; 8 9 const int 阅读全文
posted @ 2021-09-07 15:51 禅元天道 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 2004年,2.0版本中引入了OpenGL着色语言(GLSL),使得“着色器程序”可以在图形管线的各个阶段被安装和直接执行。GLSL作为一种着色器语言,主要运行于GPU上。虽然说着色器代码可以硬编码在C++程序的字符串中,但是对于大型程序,这无疑是一种灾难,所以有必要学习怎么从文件读取GLSL源码。 阅读全文
posted @ 2021-09-07 15:46 禅元天道 阅读(660) 评论(0) 推荐(0) 编辑
摘要: 1 #include <GL/glew.h> 2 #include <GLFW/glfw3.h> 3 #include <iostream> 4 5 using namespace std; 6 7 const int numVAOs = 1; 8 GLuint renderingProgram; 阅读全文
posted @ 2021-09-07 14:28 禅元天道 阅读(433) 评论(0) 推荐(0) 编辑