记录学习OpenGL的过程,顺便把踩过的坑和大家分享一下。每个项目都可以单独运行。
- Windows 10
- Visual Studio Community 2022
├── Project 解决方案
│ ├─ Dependencies 依赖文件夹
│ ├─ 01_CreateWindow
│ ├─ 02_HelloPrimitive
│ ├─ 03_GLEW
│ ├─ 04_DrawArrays
│ ├─ 05_DrawElements
│ ├─ 06_Shader
│ ├─ src
│ ├─ Shader
│ ├─ res
│ ├─ 07_Texture
│ ├─ src
│ ├─ vendor
│ ├─ stb_image
│ ├─ Shader
│ ├─ Texture2D
│ ├─ res
│ ├─ 08_Transformation
│ ├─ src
│ ├─ vendor
│ ├─ stb_image
│ ├─ glm
│ ├─ Shader
│ ├─ Texture2D
│ ├─ res
│ ├─ 09_CoordinateSystem
│ ├─ src
│ ├─ vendor
│ ├─ stb_image
│ ├─ glm
│ ├─ Shader
│ ├─ Texture2D
│ ├─ res
│ ├─ 10_Assimp
│ ├─ res
│ ├─ 11_Mesh
│ ├─ src
│ ├─ vendor
│ ├─ stb_image
│ ├─ glm
│ ├─ Mesh
│ ├─ Shader
│ ├─ Texture2D
│ ├─ res
│ ├─ 12_Model
│ ├─ src
│ ├─ vendor
│ ├─ stb_image
│ ├─ glm
│ ├─ Mesh
│ ├─ Model
│ ├─ Shader
│ ├─ Texture2D
│ ├─ res
├── Project.sln 工程文件
每一个项目工程都可以独立运行的。
-
打开一个窗口:01_CreateWindow https://www.toutiao.com/article/7294560261539725843/

- 通过 GLFW 创建一个窗口
-
你好,图元:02_HelloPrimitive https://www.toutiao.com/article/7298165586935333417/

- glBegin
- glVertex3f
- glEnd
- glPointSize
- glLineWidth
-
接入GLEW:03_GLEW https://www.toutiao.com/article/7299268967548486155/

-
使用DrawArrays进行绘制:04_DrawArrays https://www.toutiao.com/article/7314116504373510695/

- glGenBuffers
- glBindBuffer
- glBufferData
- glVertexAttribPointer
- glEnableVertexAttribArray
- glDrawArrays
-
使用DrawElemtes进行绘制:05_DrawElements https://www.toutiao.com/article/7317075299152527883/

- glDrawElements
-
着色器基础:06_Shader https://www.toutiao.com/article/7317915584849723915/

- glCreateShader
- glShaderSource
- glCompileShader
- glCreateProgram
- glAttachShader
- glLinkProgram
- glUseProgram
-
纹理基础:07_Texture https://www.toutiao.com/article/7323047177029190180/

- glGenTextures
- glBindTexture
- glTexParameteri
- glTexImage2D
- glGenerateMipmap
- glActiveTexture
-
变换:08_Transformation https://www.toutiao.com/article/7327209720761401868/

- glGetUniformLocation
- glUniformMatrix4fv
-
坐标系统:09_CoordinateSystem https://www.toutiao.com/article/7327967563743347239/

-
Assimp构建和导入:10_Assimp https://www.toutiao.com/article/7355314396362457663/
-
网格基础:11_Mesh https://www.toutiao.com/article/7363125067305304595/

-
导入3D模型:12_Model https://www.toutiao.com/article/7363461359126594067/

- TheCherno OpenGL教程,来源:哔哩哔哩
- LearnOpen CN, https://learnopengl-cn.github.io/
- opengl-tutoial CN, http://www.opengl-tutorial.org/cn
- 《OpenGL 编程指南》(第9版)—— 红宝书
- 《OpenGL 超级宝典》(第5版)—— 蓝宝书