No description
  • C 96.9%
  • CMake 2%
  • GLSL 0.8%
  • Shell 0.2%
Find a file
2026-02-01 17:28:37 +05:30
assets specular lighting 2026-02-01 12:12:09 +05:30
cmake clangd: just supress the unused includes warning 2026-02-01 10:15:58 +05:30
docs add gltf and gltf-tutorials as git submodules 2026-01-06 03:24:12 +05:30
include simple ambient and diffuse lighting 2026-02-01 11:30:15 +05:30
libs add cgltf git submodule 2026-01-06 02:58:54 +05:30
scripts purge emscripten config/files for now, we will look at it later 2026-01-09 19:36:44 +05:30
source more conversions to snake_case 2026-02-01 17:28:37 +05:30
.clang-format use simple formatting and snake case 2026-02-01 11:06:26 +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 refactor out the camera code into a separate struct Camera 2026-01-20 17:22:27 +05:30
Makefile purge emscripten config/files for now, we will look at it later 2026-01-09 19:36:44 +05:30
README.md static build instead of a lot of dlls, simple project structure 2026-01-09 10:04:34 +05:30
UNLICENSE add unlicense 2025-12-02 09:50:40 +05:30

LearnOpenGL

2025-12-31 - [ ] Implement an fps counter - [ ] Performance Metrics using Timer Queries (https://wikis.khronos.org/opengl/Query_Object#Timer_queries) - [ ] Load a simple glTF model with a few textures

TODO: - create docs/cmake.md to explain the cmake lessons - purge the modules and unnecessary wrappers - just have one executable.

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