1 Star 1 Fork 0

劉亜崇 / LearnOpenGL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

learnopengl.com code repository

Contains code samples for all chapters of Learn OpenGL and https://learnopengl.com.

Windows building

All relevant libraries are found in /libs and all DLLs found in /dlls (pre-)compiled for Windows. The CMake script knows where to find the libraries so just run CMake script and generate project of choice.

Keep in mind the supplied libraries were generated with a specific compiler version which may or may not work on your system (generating a large batch of link errors). In that case it's advised to build the libraries yourself from the source.

Linux building

First make sure you have CMake, Git, and GCC by typing as root (sudo) apt-get install g++ cmake git and then get the required packages: Using root (sudo) and type apt-get install libsoil-dev libglm-dev libassimp-dev libglew-dev libglfw3-dev libxinerama-dev libxcursor-dev libxi-dev libfreetype-dev libgl1-mesa-dev xorg-dev . Next, run CMake (preferably CMake-gui). The source directory is LearnOpenGL and specify the build directory as LearnOpenGL/build. Creating the build directory within LearnOpenGL is important for linking to the resource files (it also will be ignored by Git). Hit configure and specify your compiler files (Unix Makefiles are recommended), resolve any missing directories or libraries, and then hit generate. Navigate to the build directory (cd LearnOpenGL/build) and type make in the terminal. This should generate the executables in the respective chapter folders.

Note that CodeBlocks or other IDEs may have issues running the programs due to problems finding the shader and resource files, however it should still be able to generate the exectuables. To work around this problem it is possible to set an environment variable to tell the tutorials where the resource files can be found. The environment variable is named LOGL_ROOT_PATH and may be set to the path to the root of the LearnOpenGL directory tree. For example:

`export LOGL_ROOT_PATH=/home/user/tutorials/LearnOpenGL`

Running ls $LOGL_ROOT_PATH should list, among other things, this README file and the resources direcory.

Linux building in Docker

Using this project you can start IDE in docker:

.../docker-ide/ide cpp-gpu ~/.../clion/bin/clion.sh -x11docker "--gpu"

Mac OS X building

Building on Mac OS X is fairly simple (thanks @hyperknot):

brew install cmake assimp glm glfw freetype
mkdir build
cd build
cmake ../.
make -j8

Create Xcode project on Mac platform

Thanks @caochao: After cloning the repo, go to the root path of the repo, and run the command below:

mkdir xcode
cd xcode
cmake -G Xcode ..

Glitter

Polytonic created a project called Glitter that is a dead-simple boilerplate for OpenGL. Everything you need to run a single LearnOpenGL Project (including all libraries) and just that; nothing more. Perfect if you want to follow along with the chapters, without the hassle of having to manually compile and link all third party libraries!

空文件

简介

中文版本 https://learnopengl-cn.github.io English 版本 https://learnopengl.com 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/liuyachong/LearnOpenGL.git
git@gitee.com:liuyachong/LearnOpenGL.git
liuyachong
LearnOpenGL
LearnOpenGL
master

搜索帮助