LearnOpenGL
Code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com
Code samples for the Learn OpenGL book and website, organized by chapter so you can follow along while learning 2D and 3D graphics programming in C++ and OpenGL.
This repository contains the code samples that accompany the Learn OpenGL book and its companion website at learnopengl.com. OpenGL is a programming interface for rendering 2D and 3D graphics, used in games, simulations, and visualizations. The repository is organized by chapter so that readers can follow along with the book while having the working code beside them.
The project is written in C++ and uses CMake to handle building across different operating systems. On Windows, the necessary libraries are pre-compiled and included in the repository so that setup requires only running the CMake script and generating a project file. On Linux and macOS, the libraries need to be installed first through a package manager, and then the standard CMake build steps apply. Instructions for all three platforms are provided in the README.
For people who find the library setup process difficult, there is a separate project called Glitter, mentioned in the README, that bundles everything needed to run a single LearnOpenGL chapter into one simple starting point. This can make it easier to experiment with individual examples without managing all the dependencies manually.
The repository is purely a learning resource. It does not provide a library to install or an application to run on its own. Each chapter's code demonstrates a specific concept in graphics programming. A community-maintained port of the same examples in the Rust language is also linked from the README.
Where it fits
- Run working code alongside each Learn OpenGL book chapter to reinforce graphics programming concepts
- Study specific OpenGL topics like shaders, textures, or lighting by reading isolated per-chapter examples
- Use the included CMake setup as a template for starting your own C++ OpenGL project
- Experiment with individual chapters without managing all dependencies using the Glitter companion project