LearnOpenGL README

The project's README from github.com/JoeyDeVries/LearnOpenGL. As one markdown file: README.md.

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 .

Build through 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.

Build through Cmake command line:

cd /path/to/LearnOpenGL
mkdir build && cd build
cmake ..
cmake --build .

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 executables. 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 directory.

Mac OS X building

Building on Mac OS X is fairly simple:

brew install cmake assimp glm glfw freetype
cmake -S . -B build
cmake --build build -j$(sysctl -n hw.logicalcpu)

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!

Ports

Check out @srcres258's port in Rust here.

LearnOpenGL (JoeyDeVries/LearnOpenGL)

Searching Database…

Что это такое?Это репозиторий с кодом к книге Learn OpenGL и сопутствующему сайту (learnopengl.com). Здесь находятся примеры программ на C++ к каждой главе учебника по программированию графики в OpenGL.
Это библиотека, которую можно импортировать, или просто примеры кода, которые читаются вместе с книгой?Это набор самостоятельных примеров программ, по одной (или несколько) на главу, которые собираются отдельно с помощью CMake. Это не переиспользуемая библиотека, которую можно подключить к своему проекту.
Как собрать эти примеры?Установите CMake, Git и компилятор, затем запустите CMake-скрипт, чтобы создать проект (CMake-gui или командная строка), и соберите его через make или свою IDE. В Windows готовые библиотеки и DLL уже лежат в /libs и /dlls.
Какие библиотеки нужно установить перед сборкой в Linux?В Linux нужны g++, cmake и git, а также пакеты для разработки: libsoil-dev, libglm-dev, libassimp-dev, libglew-dev, libglfw3-dev, libxinerama-dev, libxcursor-dev, libxi-dev, libfreetype-dev, libgl1-mesa-dev и xorg-dev.
Будут ли готовые библиотеки для Windows всегда корректно подключаться при сборке?Не обязательно: они скомпилированы конкретной версией компилятора, и при использовании другой может появиться целая серия ошибок линковки. Поэтому, возможно, придётся пересобрать библиотеки самостоятельно из исходников.
Для каких операционных систем описан процесс сборки?В README есть отдельные инструкции по сборке через CMake для Windows, Linux и Mac OS X, так что примеры должны собираться на всех трёх системах.
Что такое Glitter?Glitter — это минимальный шаблонный проект (его создал Polytonic), который включает всё необходимое для запуска одной главы LearnOpenGL, в том числе все нужные библиотеки. Так можно следовать уроку без ручной сборки и подключения сторонних зависимостей.
Есть ли версия этих уроков на Rust?Да, в README указан поддерживаемый сообществом порт примеров LearnOpenGL на Rust, его автор — пользователь @srcres258.
Где читать текст самих уроков?Написанные главы находятся на сопутствующем сайте learnopengl.com; этот репозиторий содержит только исходный код к каждой главе.
Как программы находят файлы шейдеров и ресурсов, если IDE не может их найти?Можно задать переменную окружения LOGLROOTPATH, указав в ней корень дерева каталогов LearnOpenGL. Она подскажет исполняемым файлам, где искать ресурсы.
Size
199.9 MB
Stars
12.7K
Updated
CommitAug 05
Age
11y
Commits · 90 Days