https://github.com/mfl28/opengl-cpp-starter
Starter code for OpenGL C++ projects using modern CMake.
https://github.com/mfl28/opengl-cpp-starter
azure-pipelines cmake computer-graphics cpp opengl
Last synced: 9 months ago
JSON representation
Starter code for OpenGL C++ projects using modern CMake.
- Host: GitHub
- URL: https://github.com/mfl28/opengl-cpp-starter
- Owner: mfl28
- License: mit
- Created: 2020-08-23T17:41:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-27T07:24:52.000Z (over 5 years ago)
- Last Synced: 2025-04-14T02:53:16.287Z (12 months ago)
- Topics: azure-pipelines, cmake, computer-graphics, cpp, opengl
- Language: CMake
- Homepage:
- Size: 24.4 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenGL Cpp Starter
[](https://dev.azure.com/mfl28/opengl-cpp-starter/_build/latest?definitionId=2&branchName=master)


| OS | Build Status |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Linux | [](https://dev.azure.com/mfl28/opengl-cpp-starter/_build/latest?definitionId=2&branchName=master) |
| MacOS | [](https://dev.azure.com/mfl28/opengl-cpp-starter/_build/latest?definitionId=2&branchName=master) |
| Windows | [](https://dev.azure.com/mfl28/opengl-cpp-starter/_build/latest?definitionId=2&branchName=master) |
This repo provides easy to use starter code for OpenGL C++ projects
using modern CMake. The included CMake scripts automatically fetch and link [glfw](https://github.com/glfw/glfw), [glad](https://github.com/Dav1dde/glad), [glm](https://github.com/g-truc/glm) and [stb_image](https://github.com/nothings/stb). Optionally, you can also fetch and link [assimp](https://github.com/assimp/assimp) (see [Generating build system](#generate-build-system)). The sample OpenGL code is based on [learnopengl.com](https://learnopengl.com) and currently just opens a blank window.
## Getting started
**Requirements**
- [CMake](https://cmake.org/) (minimum version 3.18.0)
### Clone
```bash
git clone https://github.com/mfl28/opengl-cpp-starter.git
cd opengl-cpp-starter
```
### Generate build system
```bash
# Useful options:
# -D USE_ASSIMP=(YES|NO) (fetch and link assimp library, default: NO)
cmake -B build
```
### Build
```bash
# Useful options:
# --parallel (build in parallel)
cmake --build build
```
### Run
#### Linux / MacOS
```bash
cd build
./starter
```
#### Windows
```bash
# When using Visual Studio as generator:
cd build\(Debug|Release)
.\starter
```
## License
This repository is licensed under MIT, see [LICENSE](LICENSE).