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:
- Tutorial 01 ‐ Color Triangle
- Tutorial 02 ‐ Texture Mapping
- Tutorial 03 ‐ Transformation
- Tutorial 04 ‐ Camera
- Tutorial 05 ‐ Skybox
Planned tutorial
- Load Object
- Reflection
- UI
- Lighting
- Shadow
- Physics
- Fire
- 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 intoSharedhelper code and individualTutorials.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:
- Clone the repository.
- 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. - Open the
LearnOpenGL.xcodeprojin Xcode. - 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.