A comprehensive learning repository for OpenGL graphics programming in C++, following modern OpenGL practices (OpenGL 3.3+). This project contains implementations of various OpenGL concepts, from basic window creation to advanced rendering techniques.
This repository simply documents my hands-on learning journey and exercises covering fundamental OpenGL topics. Each example is self-contained and demonstrates specific OpenGL concepts with detailed comments and notes. Most of the code for now are direclty associated with units from learnopengl.com.
The codebase has been refactored into a structured layout to cleanly separate assets, dependencies, core logic, and specific lessons:
assets/- Contains 3D models and textures (e.g., models like the backpack, planets, and skyboxes).external/- Third-party libraries and dependencies (e.g., GLAD, GLFW, GLM, Assimp).images/- Output screenshots and animated GIFs used for this documentation.include/- Common header files representing the core OpenGL wrappers (camera.h,mesh.h,model.h,shader.h).src/- Contains all execution code and scripts:core/- Implementing code for core components (camera.cpp,mesh.cpp,shader.cpp,stb_image.cpp).lessons/- Directory containing the individual.cppfiles withmainentrypoints for each tutorial/concept covered.shaders/- GLSL shader files (.vs,.fs,.gs) loaded and utilized by the diverse lessons.
- C++ Compiler: MSVC 2019 or later (Visual Studio)
- OpenGL: Version 3.3 or higher
- GLFW: Window creation and input handling
- GLAD: OpenGL function loader
- GLM: OpenGL Mathematics library (for transformations)
- stb_image: Image loading library (included in project)
- Windows (Visual Studio project)
- Can be adapted for Linux/macOS with CMake
-
Clone the repository:
git clone https://github.com/yourusername/learnOpenGL.git cd learnOpenGL -
Open the solution:
- Open
learnOpenGL.slnxin Visual Studio 2022 or later
- Open
-
Configure the project:
- Ensure GLFW and GLM are properly linked
- Set include directories for GLAD, GLFW, GLM, and stb_image
- Set library directories for GLFW
-
Build:
- Select your build configuration (Debug/Release)
- Build the solution (Ctrl+Shift+B)
-
Run:
- Set the desired .cpp file as the startup file
- Run the project (F5 or Ctrl+F5)
Make sure to link the following libraries in your project settings:
opengl32.libglfw3.lib(orglfw3dll.libif using DLL)
Include directories should point to:
- GLAD include folder containing
glad/glad.h - GLFW include folder containing
GLFW/glfw3.h - GLM include folder containing
glm/glm.hpp
This project follows the excellent tutorials from:
- LearnOpenGL.com - Primary learning resource
- OpenGL Documentation - Official reference
- GLFW Documentation - Window management
- GLM Documentation - Mathematics library
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2026 Bill Wang
- Joey de Vries for the amazing LearnOpenGL tutorials
- The OpenGL community for extensive documentation and support
- GLFW, GLAD, GLM, and stb_image library authors

































