提交 013a2518 编写于 作者: O Orient

bug fixed

上级 bcf30b63
...@@ -14,21 +14,21 @@ glfw将会被安装在`/usr/local/Cellar/glfw` ...@@ -14,21 +14,21 @@ glfw将会被安装在`/usr/local/Cellar/glfw`
`/usr/local/Cellar/glfw`路径下找到`header``lib`对应路径,在`Xcode->Preferences->Localtion->Custom Paths`设置路径。 `/usr/local/Cellar/glfw`路径下找到`header``lib`对应路径,在`Xcode->Preferences->Localtion->Custom Paths`设置路径。
![image](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/Localtion.png) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/localtion.png)
3、配置`header/library searcher path` 3、配置`header/library searcher path`
在项目`Build Settings`中搜索`header search`,添加如下配置: 在项目`Build Settings`中搜索`header search`,添加如下配置:
![image](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/header.png) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/header.png)
搜索`library search`,添加如下配置: 搜索`library search`,添加如下配置:
![image](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/library.png) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/library.png)
4、在项目中导入需要的库文件,如下图示: 4、在项目中导入需要的库文件,如下图示:
![image](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/linked.png) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/linked.png)
## 配置glad ## 配置glad
...@@ -60,13 +60,13 @@ glfw将会被安装在`/usr/local/Cellar/glfw` ...@@ -60,13 +60,13 @@ glfw将会被安装在`/usr/local/Cellar/glfw`
2、将生成的zip文件下载解压。将其中的`include``src`文件夹复制到项目目录中,并将三个文件拖入项目中 2、将生成的zip文件下载解压。将其中的`include``src`文件夹复制到项目目录中,并将三个文件拖入项目中
![image](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/ScreenShot.jpg) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/ScreenShot.jpg)
3、在项目->属性->VC++目录中,添加包含目录和源目录 3、在项目->属性->VC++目录中,添加包含目录和源目录
![image](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/win-include.jpg) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/win-include.jpg)
![image](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/win-src.jpg) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/win-src.jpg)
# 至此Visual Studio配置基本完成 # 至此Visual Studio配置基本完成
...@@ -50,7 +50,7 @@ ourShader.setInt("texture2", 1); // 或使用着色器类设置 ...@@ -50,7 +50,7 @@ ourShader.setInt("texture2", 1); // 或使用着色器类设置
``` ```
最终结果如下图: 最终结果如下图:
![image](https://github.com/Orient-ZY/OpenGL-Learning/raw/master/img/texture_unit1.png) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/texture_unit1.png)
因为OpenGL要求y轴0.0坐标是在图片的底部的,但是图片的y轴0.0坐标通常在顶部,所以纹理上下颠倒了,我们只需要在加载任何图像之前加入以下语句: 因为OpenGL要求y轴0.0坐标是在图片的底部的,但是图片的y轴0.0坐标通常在顶部,所以纹理上下颠倒了,我们只需要在加载任何图像之前加入以下语句:
...@@ -60,4 +60,4 @@ stbi_set_flip_vertically_on_load(true); ...@@ -60,4 +60,4 @@ stbi_set_flip_vertically_on_load(true);
结果如下图: 结果如下图:
![image](https://github.com/Orient-ZY/OpenGL-Learning/raw/master/img/texture_unit2.png) ![image](http://git.oschina.net/orient01/OpenGL-img/raw/master/texture_unit2.png)
...@@ -164,5 +164,5 @@ while (!glfwWindowShouldClose(window)) ...@@ -164,5 +164,5 @@ while (!glfwWindowShouldClose(window))
``` ```
你可以在[这里](https://github.com/Orient-ZY/OpenGL-Learning/tree/master/Textures)找到源码,最后渲染出的三角形与矩形(只需要将注释中三角形与矩形的代码互换即可)效果如下: 你可以在[这里](https://github.com/Orient-ZY/OpenGL-Learning/tree/master/Textures)找到源码,最后渲染出的三角形与矩形(只需要将注释中三角形与矩形的代码互换即可)效果如下:
![triangle_texture](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/triangleTexture.png) ![triangle_texture](http://git.oschina.net/orient01/OpenGL-img/raw/master/triangleTexture.png)
![rectangle_texture](https://github.com/Orient-ZY/OpenGL-Learning/blob/master/img/rectangleTexture.png) ![rectangle_texture](http://git.oschina.net/orient01/OpenGL-img/raw/master/rectangleTexture.png)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册