No description
Find a file
2026-01-07 02:11:46 +05:30
assets rename hello-triangle -> triangle 2025-12-22 12:36:05 +05:30
cmake add cgltf git submodule 2026-01-06 02:58:54 +05:30
docs add gltf and gltf-tutorials as git submodules 2026-01-06 03:24:12 +05:30
libs add cgltf git submodule 2026-01-06 02:58:54 +05:30
scripts add a shell-file for local testing & a README to generate artifacts for website 2025-12-17 00:59:58 +05:30
source back to the main tutorial, transforms 2026-01-07 02:11:46 +05:30
.clang-format pointer alignment formatting changes int* ip -> int *ip 2025-12-24 04:58:29 +05:30
.editorconfig initial commit 2025-11-08 08:47:32 +05:30
.gitattributes update .gitattributes, no-one-knows what's in the update :) 2025-11-30 12:02:53 +05:30
.gitignore add graphviz subdirectory 2025-12-14 08:38:50 +05:30
.gitmodules add gltf and gltf-tutorials as git submodules 2026-01-06 03:24:12 +05:30
CMakeLists.txt add cgltf git submodule 2026-01-06 02:58:54 +05:30
Makefile add install target in makefile 2026-01-06 02:58:33 +05:30
README.md add some important shader resource links to readme 2025-12-31 15:27:19 +05:30
TODO add a todo for performance metrics measurement using timer queries 2025-12-31 23:59:27 +05:30
UNLICENSE add unlicense 2025-12-02 09:50:40 +05:30

LearnOpenGL

Project Structure

The project uses external libraries cloned as git submodules in /libs directory. Common project assets like logo are stored in /assets, CMake specific files live in /cmake and these include header only projects, config template files, graph generation steps etc. /source contains all the source files

The project is organized into modules like source/core, source/loader, source/tutorials. core provides the core functionality like windowing and logging while loader as the name suggests, provids the loading functionality. core and loader are built as libraries used by executable modules in the tutorials module.

 assets
 cmake
 libs
 scripts
 source
│  core
│ │  include
│ │  source
│ │  CMakeLists.txt
│  loader
│ │  include
│ │  source
│ │  CMakeLists.txt
│ ...
│  tutorials
│ │  hello-triangle
│ │ │  assets
│ │ │  source
│ │ │  CMakeLists.txt
│ │ │ 󰂺 README.md
│ │ ...
 CMakeLists.txt

Dependencies

See dependencies.sh, it's a shell script to install all the required dependencies on archlinux and MSYS2 (Winodws). I will later create a dependencies.bat file to install dependencies on windows.

How to Build

cd learnopengl
cmake -B build -S .                    # for normal build
emcmake cmake -B build -S .            # for wasm build
cmake --build build -j $(nproc)        # build
cmake --install build --prefix install # install

Naming Convention

Single word variables are named as usual like texture or shader but when there are multiple words involved, we use the shrinked words in camel case, like txUnits or shVarName. This is applicable for both variable and function names. For entities like mesh, the base name is already not that long, so we don't shorten that further.

TODO: we need a proper naming convention for the shader variables,

  • uniforms
  • vertex attributes
  • internal variables

shaders