声明:本教程的图像,资源,代码仅供学习参考使用,禁止以任何形式发布。如有违反代码提供者(本人)不付任何责任。
项目开源地址 https://github.com/OrbitGW/MYCRAFT
前期准备
C++
本教程将以C++为开发语言,OpenGL为渲染引擎。
依赖项
名称 | 地址 |
---|---|
GLFW | `https://github.com/glfw/glfw |
glad | https://glad.dav1d.de/ or https://github.com/Dav1dde/glad |
glm | https://github.com/g-truc/glm |
stb-image | https://github.com/nothings/stb/blob/master/stb_image.h |
Build GLFW
下载CMake工具,进入GLFW目录
mkdir build
cd build
cmake ../.
然后进入build文件夹,编译
然后再build中找到glfw3.lib,在自己项目文件夹中建立lib文件夹并移入。
最后在GLFW目录里找到include,拷贝到自己项目文件夹里
glad & glm & stb-image
解压,将include移入项目文件夹,glad.c也要拷贝
MYCRAFT
├─include
│ │ stb_image.h
│ │
│ ├─glad
│ │ glad.h
│ │
│ ├─GLFW
│ │ glfw3.h
│ │ glfw3native.h
│ │
│ ├─glm
│ │ │ ...
│ │
│ └─KHR
│ khrplatform.h
│
├─lib
│ glfw3.lib
│
└─src
glad.c