Home - vquanghuy/learn-opengl GitHub Wiki

Welcome to Learn OpenGL on macOS

This wiki serves as a guide and documentation for the Learn OpenGL repository. This project is my personal journey through learning modern OpenGL, heavily inspired by the comprehensive tutorials available at learnopengl.com.

The repository contains code examples and experiments specifically tailored for development on macOS, using Xcode, targeting OpenGL 4.1, and configured for Apple Silicon (arm64) and Intel (x86_64) architectures.

About the Project

The goal of this project is to provide a hands-on approach to understanding the fundamental concepts of real-time 3D graphics programming using OpenGL. Each major concept or tutorial from learnopengl.com is implemented as a separate target within a single Xcode project, allowing you to build and run individual examples.

Tutorials

Each tutorial corresponds to a target in the Xcode project. Select the desired scheme in Xcode to build and run a specific tutorial. The tutorials cover topics such as:

  1. Tutorial 01 ‐ Color Triangle
  2. Tutorial 02 ‐ Texture Mapping
  3. Tutorial 03 ‐ Transformation
  4. Tutorial 04 ‐ Camera
  5. Tutorial 05 ‐ Skybox

Planned tutorial

  1. Load Object
  2. Reflection
  3. UI
  4. Lighting
  5. Shadow
  6. Physics
  7. Fire
  8. Water

Project Structure

The code and assets are organized to keep things clear and manageable:

  • LearnOpenGL.xcodeproj/: The main Xcode project file.
  • Source/: Contains all the C++ source code, separated into Shared helper code and individual Tutorials.
  • External/: Houses the necessary external libraries (GLM, STB, GLFW, GLAD).
  • Assets/: Stores assets like shaders and textures, organized by tutorial.

Beside, the source code also structured based on Modularizing OpenGL Development with C++: Building Essential Classes

Setup and Building

To get started with the project on your macOS machine:

  1. Clone the repository.
  2. Obtain and place the necessary external libraries (GLM, STB, GLFW, GLAD) in the External/ folder as described in the repository's README or a dedicated setup page.
  3. Open the LearnOpenGL.xcodeproj in Xcode.
  4. Configure the build settings and phases for each target (Header Search Paths, Library Search Paths, Copy Files, Link Binary With Libraries) to correctly link the external libraries and copy assets.

Coding convention

Troubleshooting

Encountering issues during development is part of the learning process. If you run into problems, check the following resources:

  • The repository's README.
  • The build settings and phases in your Xcode project.

I have documented a specific issue that you might encounter:

Acknowledgements

This project is made possible by the incredible free resources provided by learnopengl.com.