{"id":31250614,"url":"https://github.com/d3m1d0s/opengltemplate","last_synced_at":"2026-05-16T17:04:39.709Z","repository":{"id":310693769,"uuid":"1040799500","full_name":"d3m1d0s/OpenGLTemplate","owner":"d3m1d0s","description":"Modern C++20 OpenGL starter template with CMake, GLFW, and GLAD","archived":false,"fork":false,"pushed_at":"2025-09-17T22:06:44.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-05T02:17:20.549Z","etag":null,"topics":["cmake","cmakelists","cpp","cpp20","cross-platform","glad","glfw","graphics","opengl","template"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d3m1d0s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T14:21:15.000Z","updated_at":"2025-09-17T22:06:47.000Z","dependencies_parsed_at":"2025-08-19T18:34:22.759Z","dependency_job_id":"cbef684a-baa6-4ea1-bf78-23f25c04c34b","html_url":"https://github.com/d3m1d0s/OpenGLTemplate","commit_stats":null,"previous_names":["d3m1d0s/opengltemplate"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/d3m1d0s/OpenGLTemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3m1d0s%2FOpenGLTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3m1d0s%2FOpenGLTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3m1d0s%2FOpenGLTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3m1d0s%2FOpenGLTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d3m1d0s","download_url":"https://codeload.github.com/d3m1d0s/OpenGLTemplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3m1d0s%2FOpenGLTemplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33111497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cmakelists","cpp","cpp20","cross-platform","glad","glfw","graphics","opengl","template"],"created_at":"2025-09-23T05:33:39.212Z","updated_at":"2026-05-16T17:04:39.703Z","avatar_url":"https://github.com/d3m1d0s.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenGLTemplate\n\n[![CMake](https://github.com/d3m1d0s/OpenGLTemplate/actions/workflows/cmake-multi-platform.yml/badge.svg?branch=main)](https://github.com/d3m1d0s/OpenGLTemplate/actions/workflows/cmake-multi-platform.yml)\n![C++20](https://img.shields.io/badge/C%2B%2B-20-blue.svg)\n![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)\n\nA modern **C++20 OpenGL starter template** with [GLFW](https://www.glfw.org/) and [GLAD](https://glad.dav1d.de/).\nWorks **out-of-the-box**: uses preinstalled packages (vcpkg/Conan/system) or auto-fetches sources via CMake.\n\n---\n\n## 📚 Table of Contents\n- [⚡ Quick Start](#-quick-start)\n- [💻 Recommended IDE: CLion](#-recommended-ide-clion)\n- [✨ Features](#-features)\n- [📦 Dependencies](#-dependencies)\n- [🖼️ Example Output](#-example-output)\n- [📂 Project Structure](#-project-structure)\n- [🆘 Troubleshooting](#-troubleshooting)\n- [📜 License](#-license)\n- [🙌 Attribution](#-attribution)\n\n---\n\n## ⚡ Quick Start\nTip: It’s recommended to preinstall [Dependencies](#-dependencies).\nIf something goes wrong - check [Troubleshooting](#-troubleshooting).\n\n```bash\ngit clone https://github.com/\u003cyouruser\u003e/\u003cyourrepo\u003e.git\ncd OpenGLTemplate\ncmake -B build -S .\ncmake --build build\n./build/OpenGLTemplate   # Windows: .\\build\\OpenGLTemplate.exe\n```\n\n---\n\n## 💻 Recommended IDE: CLion\n\n[JetBrains CLion](https://www.jetbrains.com/clion/) is a great choice for CMake/C++ projects.\nJust open this folder in CLion and it will automatically detect the `CMakeLists.txt` and configure everything.\n\nTip: if you use **vcpkg** with CLion, set a toolchain file in\n`Settings → Build, Execution, Deployment → CMake → CMake options` and pick a proper triplet (e.g. `x64-windows-static`):\n\n```bash\n-DCMAKE_TOOLCHAIN_FILE=C:/\u003cpath-to-vcpkg\u003e/scripts/buildsystems/vcpkg.cmake \n-DVCPKG_TARGET_TRIPLET=x64-windows-static\n```\n\n---\n\n## ✨ Features\n\n* ⚙️ Minimal CMake (\u003e= 3.20), C++20.\n* 🌍 Cross-platform: Windows, Linux, macOS.\n* 🔀 Dual dependency strategy:\n\n  * Uses `find_package` if `glfw3` / `glad` are installed.\n  * Otherwise `FetchContent` pulls GLFW 3.4 \u0026 GLAD 0.1.36.\n* 🔗 Clean linking: `OpenGL::GL`, `glfw`, `glad`.\n\n---\n\n## 📦 Dependencies\n\n### 🪟 Windows (via vcpkg)\n\n```powershell\nvcpkg install glfw3 glad\ncmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static\n```\n\n\u003e Static triplets easiest (no DLLs). Dynamic require shipping `glfw3.dll`.\n\n### 🐧 Linux (system packages)\n\n```bash\nsudo apt install cmake g++ pkg-config libglfw3-dev libgl1-mesa-dev\nsudo apt install libglad-dev    # If glad is not available via your package manager, no worries - this template will fetch it automatically.\ncmake -B build -S .\ncmake --build build\n```\n\n### 🍏 macOS (Homebrew)\n\n```bash\nbrew install cmake glfw\nbrew install glad        # If glad is not available via your package manager, no worries - this template will fetch it automatically.\ncmake -B build -S .\ncmake --build build\n```\n\n\u003e macOS OpenGL is capped at **4.1**.\n\n### 📦 Self-contained (no pkg manager)\n\nDo nothing - CMake auto-fetches **GLFW 3.4** and **GLAD 0.1.36**.\n\n---\n\n## 🖼️ Example Output\n\nOpens a **800×600 window**, clears to white, prints OpenGL version, e.g.:\n\n```\nOpenGL: 3.3.0 - Build 31.0.101.2135\n```\n\n---\n\n## 📂 Project Structure\n\n```\nOpenGLTemplate/\n├─ src/              # C++ sources (main.cpp included)\n├─ include/          # Headers\n├─ shaders/          # GLSL files\n├─ assets/           # Textures, models\n├─ CMakeLists.txt\n└─ README.md\n```\n\n\u003e To bump OpenGL version, edit in CMake:\n\u003e `set(GLAD_API \"gl=4.6\")`.\n\n## 🆘 Troubleshooting\n\n- **Windows: mixing toolchains/triplets**  \n  Errors like `__security_cookie`, `sscanf_s`, or `fprintf` usually mean you’re compiling with **MinGW** but linked **MSVC** vcpkg triplets (or vice versa).  \n  Align them:\n  - MSVC ↔ `x64-windows` / `x64-windows-static`\n  - MinGW-w64 ↔ `x64-mingw-dynamic` / `x64-mingw-static`\n\n- **CMake can’t find `glfw3Config.cmake`**  \n  If using vcpkg, make sure you pass the toolchain file and a triplet:\n  ```bash\n  -DCMAKE_TOOLCHAIN_FILE=\u003cpath-to-vcpkg\u003e/scripts/buildsystems/vcpkg.cmake\n  -DVCPKG_TARGET_TRIPLET=x64-windows-static   # or your platform\n\n- **DLLs missing on Windows (dynamic triplets)**  \n   Copy runtime DLLs (e.g., `glfw3.dll`) next to your executable or use a static triplet.\n\n- **Linux: missing dev packages**  \n   Some distros don’t ship certain OpenGL helpers (e.g., `libglad-dev`).\n  On Ubuntu/Debian, enable `universe` or just skip it — this template will **auto-fetch GLAD** via `FetchContent`.\n\n---\n## 📜 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n## 🙌 Attribution\n\nThis project was originally generated from [d3m1d0s/OpenGLTemplate](https://github.com/d3m1d0s/OpenGLTemplate) - MIT.\nIf you use this as a template, please keep this line or move it to your `NOTICE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3m1d0s%2Fopengltemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd3m1d0s%2Fopengltemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3m1d0s%2Fopengltemplate/lists"}