A basic example of rendering a triangle using C++ and OpenGL.
The app creates a window using the GLFW library, loads OpenGL function pointers using the GLAD library, and renders a triangle using a simple GLSL shader and shader class.
- Git
- CMake
- C++ compiler
- Windows: MSVC (Bundled with Visual Studio)
- MacOS: Clang (Bundled with Xcode)
- Linux: GCC
- Clone the repository:
git clone https://github.com/taardal/opengl-triangle
- Generate project files:
cmake -S . -B build
- Build executable from generated files:
cmake --build build
- Run the executable:
./build/opengltriangle
- CMake (Build tool)
- The Cherno: OpenGL (YouTube)
- The Cherno: C++ (YouTube)
- OpenGL Tutorial (Website)
- Learn OpenGL (Website)