{"id":13418302,"url":"https://github.com/cginternals/glbinding","last_synced_at":"2026-03-10T22:36:18.908Z","repository":{"id":16650077,"uuid":"19405480","full_name":"cginternals/glbinding","owner":"cginternals","description":"A C++ binding for the OpenGL API, generated using the gl.xml specification. ","archived":false,"fork":false,"pushed_at":"2025-10-16T16:45:46.000Z","size":25112,"stargazers_count":865,"open_issues_count":25,"forks_count":95,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-12-20T19:01:33.815Z","etag":null,"topics":["c-plus-plus","c-plus-plus-11","library","opengl-bindings","opengl-library"],"latest_commit_sha":null,"homepage":"https://glbinding.org","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"YerevaNN/Spoken-language-identification","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cginternals.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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-05-03T15:10:44.000Z","updated_at":"2025-12-20T09:55:19.000Z","dependencies_parsed_at":"2022-07-19T23:32:45.056Z","dependency_job_id":"ebe7bdb6-eaab-4976-9ad5-f05ad8fca368","html_url":"https://github.com/cginternals/glbinding","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/cginternals/glbinding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cginternals%2Fglbinding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cginternals%2Fglbinding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cginternals%2Fglbinding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cginternals%2Fglbinding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cginternals","download_url":"https://codeload.github.com/cginternals/glbinding/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cginternals%2Fglbinding/sbom","scorecard":{"id":272448,"data":{"date":"2025-08-11","repo":{"name":"github.com/cginternals/glbinding","commit":"69e75ea4907933ba302eeb5fd6f95495210f2f30"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v3.1.0 not signed: https://api.github.com/repos/cginternals/glbinding/releases/17000141","Warn: release artifact v3.1.0 does not have provenance: https://api.github.com/repos/cginternals/glbinding/releases/17000141"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'v3.4'","Warn: branch protection not enabled for branch 'v3.0'","Warn: branch protection not enabled for branch 'v2.1'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/cginternals/glbinding/ci.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:8","Warn: containerImage not pinned by hash: Dockerfile:12","Warn: containerImage not pinned by hash: Dockerfile:44","Warn: containerImage not pinned by hash: Dockerfile:55","Warn: containerImage not pinned by hash: deploy/deb/install-tests/debian-bullseye/Dockerfile:1: pin your Docker image by updating debian:bullseye to debian:bullseye@sha256:8ec25a9073e8cc89a184a6256e219828196d75203375a8ad4f0977f3011f2115","Warn: containerImage not pinned by hash: deploy/deb/install-tests/debian-buster/Dockerfile:1: pin your Docker image by updating debian:buster to debian:buster@sha256:58ce6f1271ae1c8a2006ff7d3e54e9874d839f573d8009c20154ad0f2fb0a225","Warn: containerImage not pinned by hash: deploy/deb/install-tests/debian-stretch/Dockerfile:1: pin your Docker image by updating debian:stretch to debian:stretch@sha256:c5c5200ff1e9c73ffbf188b4a67eb1c91531b644856b4aefe86a58d2f0cb05be","Warn: containerImage not pinned by hash: deploy/deb/install-tests/debian-testing/Dockerfile:1: pin your Docker image by updating debian:testing to debian:testing@sha256:ecdb9d167b4a8a8e41ff8450bc8b337aeb9ef0b87f71b63b194bd6cb62697a03","Warn: containerImage not pinned by hash: deploy/deb/install-tests/ubuntu-bionic-ppa/Dockerfile:1: pin your Docker image by updating ubuntu:18.04 to ubuntu:18.04@sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2e43c98","Warn: containerImage not pinned by hash: deploy/deb/install-tests/ubuntu-bionic/Dockerfile:1: pin your Docker image by updating ubuntu:18.04 to ubuntu:18.04@sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2e43c98","Warn: containerImage not pinned by hash: deploy/deb/install-tests/ubuntu-focal-ppa/Dockerfile:1: pin your Docker image by updating ubuntu:20.04 to ubuntu:20.04@sha256:8feb4d8ca5354def3d8fce243717141ce31e2c428701f6682bd2fafe15388214","Warn: containerImage not pinned by hash: deploy/deb/install-tests/ubuntu-focal/Dockerfile:1: pin your Docker image by updating ubuntu:20.04 to ubuntu:20.04@sha256:8feb4d8ca5354def3d8fce243717141ce31e2c428701f6682bd2fafe15388214","Warn: containerImage not pinned by hash: deploy/deb/install-tests/ubuntu-jammy-ppa/Dockerfile:1: pin your Docker image by updating ubuntu:22.04 to ubuntu:22.04@sha256:1aa979d85661c488ce030ac292876cf6ed04535d3a237e49f61542d8e5de5ae0","Warn: containerImage not pinned by hash: deploy/deb/install-tests/ubuntu-jammy/Dockerfile:1: pin your Docker image by updating ubuntu:22.04 to ubuntu:22.04@sha256:1aa979d85661c488ce030ac292876cf6ed04535d3a237e49f61542d8e5de5ae0","Warn: containerImage not pinned by hash: deploy/deb/install-tests/ubuntu-xenial-ppa/Dockerfile:1: pin your Docker image by updating ubuntu:16.04 to ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d6","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  15 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}}]},"last_synced_at":"2025-08-17T13:43:35.944Z","repository_id":16650077,"created_at":"2025-08-17T13:43:35.945Z","updated_at":"2025-08-17T13:43:35.945Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30359162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"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":["c-plus-plus","c-plus-plus-11","library","opengl-bindings","opengl-library"],"created_at":"2024-07-30T22:01:00.854Z","updated_at":"2026-03-10T22:36:18.895Z","avatar_url":"https://github.com/cginternals.png","language":"C++","readme":"[//]: # (Comment)\n\n\u003cbr\u003e\u003ca href=\"https://glbinding.org\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/cginternals/glbinding/master/glbinding-logo.svg?sanitize=true\" width=\"50%\"\u003e\u003c/a\u003e\n\n*glbinding* is a cross-platform C++ binding for the [OpenGL API](http://www.opengl.org).\n\n![GitHub release](https://img.shields.io/github/release/cginternals/glbinding.svg)\n![C++ CI](https://github.com/cginternals/glbinding/actions/workflows/ci.yml/badge.svg)\n[![Travis](https://img.shields.io/travis/cginternals/glbinding/master.svg?style=flat\u0026logo=travis)](https://travis-ci.org/cginternals/glbinding)\n[![Appveyor](https://img.shields.io/appveyor/build/scheibel/glbinding/master.svg?style=flat\u0026logo=appveyor)](https://ci.appveyor.com/project/scheibel/glbinding)\n[![Tokei](https://tokei.rs/b1/github/cginternals/glbinding)](https://github.com/Aaronepower/tokei)\n\n[![Documentation](https://img.shields.io/badge/documentation-online-blue.svg?style=flat\u0026logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMC41IDEzLjciPjxwYXRoIGQ9Ik0xMS41IDYuOGwtMy43IDYuNEwuNS41aDE0LjdsLTEuMyAyLjFINC4yTDcuOCA5bDIuNS00LjN6bTcuMyA0LjNsMS4yIDIuMWgtOS43TDE3LjYuNWwxLjIgMi4xLTQuOSA4LjV6IiBmaWxsPSIjZmZmIi8%2BPC9zdmc%2B)](https://glbinding.org/docs.html)\n[![Examples](https://img.shields.io/badge/examples-wiki-blue.svg?style=flat\u0026logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMC41IDEzLjciPjxwYXRoIGQ9Ik0xMS41IDYuOGwtMy43IDYuNEwuNS41aDE0LjdsLTEuMyAyLjFINC4yTDcuOCA5bDIuNS00LjN6bTcuMyA0LjNsMS4yIDIuMWgtOS43TDE3LjYuNWwxLjIgMi4xLTQuOSA4LjV6IiBmaWxsPSIjZmZmIi8%2BPC9zdmc%2B)](https://github.com/cginternals/glbinding/wiki/Examples)\n[![Tools](https://img.shields.io/badge/tools-wiki-blue.svg?style=flat\u0026logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMC41IDEzLjciPjxwYXRoIGQ9Ik0xMS41IDYuOGwtMy43IDYuNEwuNS41aDE0LjdsLTEuMyAyLjFINC4yTDcuOCA5bDIuNS00LjN6bTcuMyA0LjNsMS4yIDIuMWgtOS43TDE3LjYuNWwxLjIgMi4xLTQuOSA4LjV6IiBmaWxsPSIjZmZmIi8%2BPC9zdmc%2B)](https://github.com/cginternals/glbinding/wiki/Tools)\n\n[//]: # (HEADER_END)\n\n*glbinding* leverages C++11 features like enum classes, lambdas, and variadic templates, instead of relying on macros;\nall OpenGL symbols are real functions and variables.\nIt provides type-safe parameters, per-feature API headers, lazy function resolution, multi-context and multi-thread support, global and local function callbacks, meta information about the generated OpenGL binding and the OpenGL runtime, as well as tools and examples for quick-starting your projects.\nBased on the OpenGL API specification ([gl.xml](https://github.com/KhronosGroup/OpenGL-Registry/blob/main/xml/gl.xml)) *glbinding* is generated using [python scripts and templates](https://github.com/cginternals/khrbinding-generator) that can be easily adapted to fit custom needs.\n\n![what-is-glbinding](https://raw.githubusercontent.com/cginternals/glbinding/master/docs/what-is-glbinding-v2.png)\n\nCode that is written using a typical C binding for OpenGL, e.g., [GLEW](http://glew.sourceforge.net/), is fully compatible for the use with *glbinding* and causes no significant impact on runtime performance (see [compare example](https://github.com/cginternals/glbinding/wiki/examples#compare)): just replace all includes to the former binding, replace the initialization code and *use* the appropriate API namespace, e.g., ```gl``` for full availability of the OpenGL API.\n\n```cpp\n#include \u003cglbinding/gl/gl.h\u003e\nusing namespace gl;\n\n// ...\nauto shader = glCreateShader(GL_COMPUTE_SHADER);\n// ...\n```\n\n*glbinding* is compatible with OpenGL-compatible windowing toolkits and we provide example integrations for the following ones within the examples:\n\n* [GLFW OpenGL](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-glfw-gl)\n* [GTK 3 OpenGL](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-gtk3-gl) and [GTK 3 OpenGL ES](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-gtk3-gles) (may require `GDK_GL=gles` environment variable)\n* [GTK 4 OpenGL](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-gtk4-gl) and [GTK 4 OpenGL ES](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-gtk3-gles)\n* [Qt 5 OpenGL](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-qt-gl) and [Qt 5 OpenGL ES](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-qt-gles)\n* [SDL OpenGL](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-sdl-gl) and [SDL OpenGL ES](https://github.com/cginternals/glbinding/tree/master/source/examples/cubescape-sdl-gles)\n\n# Resources\n\n* [Tools](https://github.com/cginternals/glbinding/wiki/tools)\n* [Examples](https://github.com/cginternals/glbinding/wiki/examples)\n* [Context Creation Cheat Sheet](https://github.com/cginternals/glbinding/wiki/Context-Creation-Cheat-Sheet)\n\n### Installation and Development\n\n* [Install Instructions](#install-instructions)\n* [Build from Source](#build-instructions)\n* [Updating the Generated Source Code](#update-generated-source-code)\n* [Tips for Linking](#tips-for-linking)\n* [Dependency on KHR Headers](#dependency-on-khr-headers)\n* [Basic Example](#basic-example)\n\n### Feature Documentation and Code Snippets\n\n* [Type-safe Parameters](#type-safe-parameters)\n* [Compilation-Centered Header Design](#compilation-centered-header-design)\n* [Feature-Centered Header Design](#feature-centered-header-design)\n* [Lazy Function Resolution](#lazy-function-pointer-resolution)\n* [Multi-context Support](#multi-context-support)\n* [Multi-thread Support](#multi-threading-support)\n* [Global and Local Function Callbacks](#function-callbacks)\n* [Alternative Signatures for GLboolean and GLenum types](#alternative-signatures)\n* [Meta Information System](#meta-information)\n* [Doxygen Documentations](https://glbinding.org/docs.html) ([stable](https://glbinding.org/docs/v3.1/), [master](https://glbinding.org/docs/master))\n\n# Install Instructions\n\n*glbinding* is available for different platforms using different distribution channels.\nYou can either download the source and manually [compile](#build-instructions) it or use one of the [pre-compiled releases](https://github.com/cginternals/glbinding/releases) of this repository.\nFor systems providing package managers, we generally strive for packages in these package managers.\nAn overview on availability of glbinding can be found on [repology.org](https://repology.org/project/glbinding/versions).\n\n## Windows\n\nThe various *glbinding* packages can be installed either by downloading an installer, e.g., the [x64 installer for glbinding v3.1.0](https://github.com/cginternals/glbinding/releases/download/v3.1.0/glbinding-3.1.0-msvc2017-x64-installer.exe) for Microsoft Visual Studio 2015, or downloading and extracting one of the precompiled archives, e.g. [runtime](https://github.com/cginternals/glbinding/releases/download/v3.1.0/glbinding-3.1.0-msvc2017-x64-runtime.zip),\n[examples](https://github.com/cginternals/glbinding/releases/download/v3.1.0/glbinding-3.1.0-msvc2017-x64-examples.zip),\n[dev](https://github.com/cginternals/glbinding/releases/download/v3.1.0/glbinding-3.1.0-msvc2017-x64-dev.zip), and\n[tools](https://github.com/cginternals/glbinding/releases/download/v3.1.0/glbinding-3.1.0-msvc2017-x64-tools.zip).\nSince lately, glbinding is also available on [vcpkg](https://github.com/Microsoft/vcpkg/tree/master/ports/glbinding) with more recent releases:\n```bash\n\u003e vcpkg install glbinding\n```\nAlternatively, download the source code and commence [building from source](#build-instructions).\n\n## Ubuntu\n\n*glbinding* is provided on Ubuntu using PPAs and in [Ubuntu universe](https://packages.ubuntu.com/source/artful/glbinding) since Artful Aardvark. We maintain our own [PPA](https://launchpad.net/~cginternals/+archive/ubuntu/ppa) for most recent releases.\nUsing the current PPA as example, the following lines install *glbinding* including the GLFW examples:\n\n```shell\n\u003e sudo apt-add-repository ppa:cginternals/ppa\n\u003e sudo apt-get update\n\u003e sudo apt-get install libglbinding-examples-glfw\n\u003e # start example\n\u003e /usr/share/glbinding/cubescape\n```\n\nTo use *glbinding* as dependency, install the development package:\n\n```shell\n\u003e sudo apt-get install libglbinding-dev libglbinding-dbg\n```\n\nAlternatively, download the source code and commence [building from source](#build-instructions).\n\n## Arch Linux\n\nOn Arch, *glbinding* is provided by the [glbinding](https://www.archlinux.org/packages/community/x86_64/glbinding/) package in the community repository. To install *glbinding* execute the following line:\n\n```shell\n\u003e sudo pacman -S glbinding\n```\n\nAlternatively, download the source code and commence [building from source](#build-instructions).\n\n## macOS\n\nThe package manager on macOS we depend on is homebrew. The package there is called [glbinding](http://formulae.brew.sh/formula/glbinding).\nTo install *glbinding* using homebrew, execute the following line:\n\n```bash\n\u003e brew install glbinding\n```\n\nAlternatively, download the source code and commence [building from source](#build-instructions).\n\n## Debian-based Systems\n\n*glbinding* is available for Debian 9 (Stretch), 10 (Buster), 11 (Bullseye) and Sid. Install it using `apt install libglbinding-dev`.\nFor advanced use, download the source code and commence [building from source](#build-instructions).\n\n\n## Cross-Platform Package Managers\n\nAs one of the cross-platform package managers, *conan* provides glbinding in its [center index](https://conan.io/center/glbinding). You can use the following line to install glbinding using conan:\n\n```bash\n\u003e conan install glbinding/3.1.0@\n```\n\n\n# Build Instructions\n\n### Prerequisites and Dependencies\n\nThe only mandatory run-time dependencies of *glbinding* are the STL of the used compiler and an OpenGL driver library, dynamically linked with your application.\nBuilding *glbinding* from source has several mandatory and optional dependencies:\n\n* [CMake](https://cmake.org/) 3.0 or higher for building *glbinding* from source (mandatory for any build from source)\n* [git](https://git-scm.com/) for version control and script supporting tasks\n* [GLFW](http://www.glfw.org/) 3.2 or higher for examples and tools\n* [GLEW](http://glew.sourceforge.net/) 1.6 or higher for the comparison example (optional)\n* [cpplocate](https://github.com/cginternals/cpplocate) for the examples (optional)\n* [Qt5](http://www.qt.io/developers/) 5.0 or higher for the qt-based example (optional)\n* [googletest](https://github.com/google/googletest) for tests (optional)\n* [Doxygen](http://www.stack.nl/~dimitri/doxygen/) 1.8 or higher for generating the documentation on your system\n  * [graphviz](http://www.graphviz.org/) for generating diagrams (optional)\n\n### Compile Instructions\n\nFor compilation, at least C++11 compliant compiler, e.g., GCC 4.8, Clang 3.3, MSVC 2013 **Update 3**, is required.\nThe current release of glbinding defaults to use of C++17, but can be configured to use C++14 and even C++11 as a fallback.\nThese fallbacks are available with using the CMake options `OPTION_CXX_11_COMPATABILITY` and `OPTION_CXX_14_COMPATABILITY`.\n\nFirst, download the source code [as archive](https://github.com/cginternals/glbinding/releases) or via git:\n\n```bash\n\u003e git clone https://github.com/cginternals/glbinding.git\n\u003e cd glbinding\n```\n\nThen, depending on the version of *glbinding* you want to build, choose the appropriate tag or branch, e.g., for the 3.5.0 release:\n\n```bash\n\u003e git fetch --tags\n\u003e git checkout v3.5.0\n```\n\nThe actual compilation can be done using CMake and your favorite compiler and IDE.\n\nFor building *glbinding* CMake via command line can be used (should work on all systems):\n\nFirst, create a build directory (we do not recommend in-source builds):\n\n```bash\n\u003e mkdir build\n\u003e cd build\n```\n\nConfigure *glbinding* with your preferred or default generator, e.g., for Visual Studio 2017 in x64 use\n(note: some IDEs have integrated support for CMake projects, e.g., Qt Creator, and allow you to skip the manual project configuration):\n\n```bash\n\u003e cmake .. -G \"Visual Studio 17 2022\" -A x64\n```\n\nIn order to compile the project, either use you favorite Editor/IDE with the created project or use CMake as follows:\n\n```bash\n\u003e cmake --build .\n```\n\nFor multi-configuration projects specific configuration (e.g., on Windows using MSVC) can be built using:\n\n```bash\n\u003e cmake --build . --config Release\n\u003e cmake --build . --config Debug\n```\n\n### Update Generated Source Code\n\nThe generation scripts for *glbinding* are maintained within the [khrbinding-generator](https://github.com/cginternals/khrbinding-generator) project.\nAssuming a directory structure with both projects such as `\u003cprojects\u003e/glbinding` and `\u003cprojects\u003e/khrbinding-generator`, updating the source code is started as follows:\n\n```bash\n\u003e python3 update.py -p \"profiles/gl.json\"\n\u003e python3 generate.py -p \"profiles/gl.json\" -d \"../glbinding/source\"\n```\n\n# Tips for Linking\n\nWe suggest using the build system [CMake](https://cmake.org/) for a smooth integration.\nFor it, *glbinding* provides a configuration script that should be installed into your system or at least accessible by CMake.\nIn your projects' `CMakeLists.txt`, add one of the following lines:\n\n```cmake\nfind_package(glbinding QUIET) # if you want to check for existence\nfind_package(glbinding REQUIRED) # if it is really required in your project\n```\n\nFinally, just link *glbinding* to your own library or executable:\n\n```cmake\ntarget_link_libraries(${target} ... PUBLIC\n    glbinding::glbinding\n    glbinding::glbinding-aux # for additional, auxiliary features as logging, meta information, or debugging functionality\n)\n```\n\n# Dependency on KHR Headers\n\nAs of mid 2019, the OpenGL API depends on the platform headers from the Khronos group, even on desktop systems.\nThis introduced a direct dependency of *glbinding* to the `KHR/khrplatform.h` header file. For most Linux systems, these headers are easily available (e.g., by installing `libegl1-mesa-dev` on Ubuntu), whereas on other systems, pre-existing packages are scarce. Even in the case of Ubuntu, one can argue that installing the EGL dependency is strange, as glbinding does not depend on EGL in any way.\n\nFor those cases, glbinding comes with a copy of the headers for internal use.\n\nThis solution has one significant downside: As those headers are used by the types of the OpenGL API and the types are used within the public interface of glbinding, the `khrplatform.h` headers needs to be present when building downstream projects, i.e., they need to be installed along glbinding. In order to not conflict with packages providing the official headers, this internal header has to be installed on a separate location. This complicates the project setup and results in the following usage scenarios for you to choose from:\n\n### KHR/khrplatform.h Usage\n\nFor this usage scenario, glbinding needs to get built with the CMake option `OPTION_BUILD_OWN_KHR_HEADERS` set to `Off` and system-wide availability of the `KHR/khrplatform.h` headers, e.g., by having `libegl1-mesa-dev` installed. If either the option is `On` or the system-wide headers are not found, the internally provided headers are used instead.\n\nThis decision is stored as property of the glbinding CMake target and will be used for downstream projects as well.\nThe use and propagation of this decision is transparent to the user as well, i.e., the user should not need to handle this downstream. The only thing to consider is to have the system-wide `KHR/khrplatform.h` headers available when building the downstream project.\n\n### glbinding-internal khrplatform.h Usage\n\nFor this usage scenario, glbinding should get built with the CMake option `OPTION_BUILD_OWN_KHR_HEADERS` set to `On`. Alternatively, this scenario is the fallback if the official `KHR/khrplatform.h` headers are not found.\n\nThis decision is stored as property of the glbinding CMake target and will be used for downstream projects as well.\nThe use and propagation of this decision is transparent to the user as well, i.e., the user should not need to handle this downstream.\n\n# Basic Example\n\nThe following examples are tailored for use with *glbinding* 3.0 and above.\n\n*glbinding* has to be initialized once on the active OpenGL context you want to use *glbinding* with. For initialization, a callback for function pointer resolution must be passed, which your context creation API should provide.\nIn the most basic case, you call ```glbinding::initialize``` once:\n\n```cpp\n#include \u003cglbinding/gl/gl.h\u003e\n#include \u003cglbinding/glbinding.h\u003e\n\nusing namespace gl;\n\nint main()\n{\n  // create context, e.g. using GLFW, Qt, SDL, GLUT, ...\n\n  // Assume context creation using GLFW\n  glbinding::initialize(glfwGetProcAddress);\n\n  glBegin(GL_TRIANGLES);\n  // ...\n  glEnd();\n}\n```\n\n\n# Features\n\nThe following examples are tailored for use with *glbinding* 3.0 and above.\n\n### Type-Safe Parameters\n\nThe original OpenGL API provides several concepts in their interface, namely functions, booleans, bitfields, enums, as well as special values and basic types but mostly does not differentiate between these types.\nHence, actual knowledge about each function and its parameters is required; there is no way for a basic code assistance.\nAs *glbinding* differentiates between all these types, IDEs and compilers can detect wrong usages of the OpenGL API.\n\nOne example is the passing of a named constant in places where a bit combination is expected:\n\n```cpp\nglClear(GL_COLOR_BUFFER_BIT); // valid\nglClear(GL_FRAMEBUFFER);      // compilation error: bitfield of group ClearBufferMask expected, got GLenum\n```\n\nIn the case of bitfields, the OpenGL API offers groups and each parameter states the group valid values must come from.\n*glbinding* uses this information to prevent invalid bit combinations:\n\n```cpp\nglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // valid\nglClear(GL_COLOR_BUFFER_BIT | GL_MAP_READ_BIT);     // compile error: both bitfields share no group\n\nglClear(GL_STENCIL_BUFFER_BIT | GL_LIGHTING_BIT);   // compile error: bitwise or operation is valid,\n                                                    // the shared group is AttribMask, but the\n                                                    // resulting group does not match the expected.\n```\n\nUnfortunately, such groups are incomplete and unmaintained for enums (named values).\nThus, *glbinding* could not provide any assistance for cases such as:\n\n```cpp\nGLuint vertexShader = glCreateShader(GL_VERTEX_SHADER); // All good\nGLuint colorShader = glCreateShader(GL_COLOR);          // No compilation error but a runtime error!\n```\n\n### Compilation-Centered Header Design\n\nC++ strictly separates interface from implementation.\nFor improving the compilation time of a program or system written in C++ forward declarations of types are commonly used and includes of unnecessary symbols are omitted.\n\nFor an interface of a library, class, or module providing OpenGL related functionality, it is likely that only the type information of OpenGL is needed, not actual functions or constants usually required for implementation.\nIn addition to the customary all-in-one header ```gl.h``` *glbinding* also provides specialized headers:\n\n```cpp\n#include \u003cglbinding/gl/gl.h\u003e        // all of the headers below, meaning the complete OpenGL API\n\n#include \u003cglbinding/gl/bitfield.h\u003e  // bitfield constants (e.g., GL_COLOR_BUFFER_BIT)\n#include \u003cglbinding/gl/boolean.h\u003e   // boolean constants (GL_TRUE and GL_FALSE)\n#include \u003cglbinding/gl/enum.h\u003e      // symbol constants (e.g., GL_VERTEX_SHADER)\n#include \u003cglbinding/gl/functions.h\u003e // functions\n#include \u003cglbinding/gl/types.h\u003e     // type declarations of the OpenGL API (including bitfields, boolean, enum, and extensions)\n#include \u003cglbinding/gl/values.h\u003e    // special values (e.g., GL_INVALID_INDEX)\n```\n\nThere is one additional header that provides all extensions and provide them as an enumeration in terms of C++ enums.\n\n```cpp\n#include \u003cglbinding/gl/extension.h\u003e\n```\n\n### Feature-Centered Header Design\n\nThe OpenGL API is iteratively developed and released in versions, internally (for the API specification) named *features*.\nThe latest feature/version of OpenGL is 4.6.\nThe previous version are 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4., and 4.5.\nOpenGL uses a deprecation model for removing outdated parts of its API which results in compatibility (with deprecated API) and core (without deprecated API) usage that is manifested in the targeted OpenGL context.\nOn top of that, new API concepts are suggested as extensions (often vendor specific) that might be integrated into future versions.\nAll this results in many possible specific manifestations of the OpenGL API you can use in your program.\n\nOne tough task is to adhere to one agreed set of functions in your own OpenGL program (e.g., OpenGL 3.2 Core if you want to develop for every Windows, macOS, and Linux released in the last 4 years).\n*glbinding* facilitates this by providing per-feature headers by means of well-defined/generated subsets of the OpenGL API.\n\n#### All-Features OpenGL Headers\n\nIf you do not use per-feature headers the OpenGL program can look like this:\n\n```cpp\n#include \u003cglbinding/gl/gl.h\u003e\n\n// draw code\ngl::glClear(gl::GL_COLOR_BUFFER_BIT | gl::GL_DEPTH_BUFFER_BIT);\ngl::glUniform1i(u_numcubes, m_numcubes);\ngl::glDrawElementsInstanced(gl::GL_TRIANGLES, 18, gl::GL_UNSIGNED_BYTE, 0, m_numcubes * m_numcubes);\n```\n\n#### Single-Feature OpenGL Headers\n\nWhen developing your code on Windows with latest drivers installed, the code above is likely to compile and run.\nBut if you want to port it to systems with less mature driver support (e.g., macOS or Linux using open source drivers), you may wonder if ```glDrawElementsInstanced``` is available.\nIn this case, just switch to per-feature headers of *glbinding* and choose the OpenGL 3.2 Core headers (as you know that at least this version is available on all target platforms):\n\n```cpp\n#include \u003cglbinding/gl32core/gl.h\u003e\n\n// draw code\ngl32core::glClear(gl32core::GL_COLOR_BUFFER_BIT | gl32core::GL_DEPTH_BUFFER_BIT);\ngl32core::glUniform1i(u_numcubes, m_numcubes);\ngl32core::glDrawElementsInstanced(gl32core::GL_TRIANGLES, 18, gl32core::GL_UNSIGNED_BYTE, 0, m_numcubes * m_numcubes);\n```\n\nIf the code compiles you can be sure it is OpenGL 3.2 Core compliant.\nUsing functions that are not yet available or relying on deprecated functionality is prevented.\n\n### Lazy Function Pointer Resolution\n\nBy default, *glbinding* tries to resolve all OpenGL function pointers during initialization, which can consume some time:\n\n```cpp\n// Assume context creation using GLFW\nglbinding::initialize(glfwGetProcAddress); // immediate function pointer resolution\n```\n\nAlternatively, the user can decide that functions pointers are resolved only when used for the first time. This is achieved by:\n\n```cpp\n// Assume context creation using GLFW\nglbinding::initialize(glfwGetProcAddress, false); // lazy function pointer resolution\n```\n\n### Multi-Context Support\n\n*glbinding* has built-in support for multiple contexts. The only requirement is, that the currently active context has to be specified. This feature mixes well with multi-threaded applications, but keep in mind that concurrent use of one context often results in non-meaningful communication with the OpenGL driver.\n\nIn order to use multiple contexts, use your favorite context creation library (e.g., glut, SDL, egl, glfw, Qt) to request the required contexts.\nThe functions to make a context current should be provided by these libraries and is not part of *glbinding* (except that you can get the current context handle).\nWhen using multiple contexts, *glbinding* has to be initialized for each context (when current).\n\nSince each context can correspond to a different feature set of OpenGL and the drivers are free to assign their function pointers, *glbinding* cannot assume any equalities of requested function pointers.\nThus, contexts switches have to be communicated to *glbinding* explicitly in order to have correctly dispatched function pointers:\n\n```cpp\n// use the current active context\nglbinding::useCurrentContext();\n\n// use another context, identified by platform-specific handle\nglbinding::useContext(ContextHandle context);\n```\n\n### Multi-Threading Support\n\nConcurrent use of *glbinding* is mainly intended for usage over multiple contexts in different threads (multiple threads operating on a single OpenGL context requires locking, which *glbinding* will not provide).\nFor it, *glbinding* supports multiple active contexts, one per thread.\nThis necessitates that *glbinding* gets informed in each thread which context is currently active (see [multi-context example](https://github.com/cginternals/glbinding/tree/master/source/examples/multi-context)).\n\nNote: multi-threaded communication with OpenGL will most likely result in a meaningless sequence of OpenGL calls.\nTo avoid this, semantic groups of OpenGL calls should be treated as critical sections.\n\nExample for usage of multiple contexts:\n```cpp\n// Context 1 creation\n// GLFWwindow * window1 = glfwCreateWindow(640, 480, \"\", nullptr, nullptr);\n// glfwMakeContextCurrent(window1);\nglbinding::initialize(0, glfwGetProcAddress); // 0 here is the context identifier\n// Context 1 initialization\nglClearColor(1.0f, 0.0f, 0.0f, 0.0f);\n\n// Context 2 creation\n// GLFWwindow * window2 = glfwCreateWindow(640, 480, \"\", nullptr, nullptr);\n// glfwMakeContextCurrent(window2);\nglbinding::initialize(1, glfwGetProcAddress); // 1 here is the context identifier\n// Context 1 initialization\nglClearColor(0.0f, 1.0f, 0.0f, 0.0f);\n\n// Rendering\nwhile (doNotClose()) {\n  // Make context 1 active\n  // glfwMakeContextCurrent(window1);\n  glbinding::useContext(0);\n\n  // Context 1 rendering\n  glViewport(0, 0, width, height);\n  glClear(GL_COLOR_BUFFER_BIT);\n\n  // Swap buffer for context 1\n  // glfwSwapBuffers(window1);\n\n  // Make context 2 active\n  // glfwMakeContextCurrent(window2);\n  glbinding::useContext(1);\n\n  // Context 2 rendering\n  glViewport(0, 0, width, height);\n  glClear(GL_COLOR_BUFFER_BIT);\n\n  // Swap buffer for context 2\n  // glfwSwapBuffers(window2);\n}\n```\n\n### Multiple OpenGL Contexts in Multiple Threads\n\nThe combination of multiple OpenGL contexts and multiple threads for OpenGL usage is supported by *glbinding* in general.\nYou must tell *glbinding* which OpenGL context is used in which thread by calling the initialize method once the context is used first (```glbinding::initialize```) and if you want to switch the current context for one thread, you have to update the current context, too (```glbinding::useContext```).\nHowever, we discourage the use of one context in multiple threads.\n\n### Function Callbacks\n\nTo support orthogonal features of the OpenGL API, *glbinding* allows attaching a number of callbacks to several concepts of the OpenGL API (e.g. a function).\nSuch orthogonal features include runtime error checking (i.e., ```glGetError``` after each function call), logging, and caching of driver information.\n\n*glbinding* supports different types of callbacks that can be registered.\nThe main types are\n\n * global and local (per-function) before callbacks, that are called before the OpenGL function call,\n * global and local (per-function) after callbacks, that are called after the OpenGL function call,\n * unresolved callbacks, that are called each time an unresolved OpenGL function should be called (instead of a segmentation fault),\n * context switch callbacks, that are called if the internal current OpenGL context of *glbinding* is changed.\n\nThe before callbacks are useful , e.g., for tracing or application-specific parameter checking.\nThe available information in this callback is the wrapped OpenGL function (including its name and bound function address) and all parameters.\nThe after callbacks are useful, e.g., for tracing, logging, or the obligatory error check (```glGetError```).\nAvailable information is extended by the return value.\nThe unresolved callback provides information about the (unresolved) wrapped OpenGL function object.\n\nExample for error checking:\n\n```cpp\nsetCallbackMaskExcept(CallbackMask::After, { \"glGetError\" });\nsetAfterCallback([](const FunctionCall \u0026)\n{\n  const auto error = glGetError();\n  if (error != GL_NO_ERROR)\n    std::cout \u003c\u003c \"error: \" \u003c\u003c std::hex \u003c\u003c error \u003c\u003c std::endl;\n});\n\n// OpenGL Code ...\n```\n\nAs a shortcut, *glbinding* 3.0 introduced a debugging interface for error-checking after callbacks within the *glbinding-aux* library:\n\n```cpp\n#include \u003cglbinding-aux/debug.h\u003e\n\nglbinding::aux::enableGetErrorCallback();\n\n// OpenGL Code ...\n```\n\nExample for logging:\n\n```cpp\nsetCallbackMask(CallbackMask::After | CallbackMask::ParametersAndReturnValue);\nsetAfterCallback([](const FunctionCall \u0026 call)\n{\n  std::cout \u003c\u003c call.function-\u003ename() \u003c\u003c \"(\";\n  for (unsigned i = 0; i \u003c call.parameters.size(); ++i)\n  {\n    std::cout \u003c\u003c call.parameters[i].get();\n    if (i \u003c call.parameters.size() - 1)\n      std::cout \u003c\u003c \", \";\n  }\n  std::cout \u003c\u003c \")\";\n\n  if (call.returnValue)\n    std::cout \u003c\u003c \" -\u003e \" \u003c\u003c call.returnValue.get();\n\n  std::cout \u003c\u003c std::endl;\n});\n\n// OpenGL Code ...\n```\n\n### Alternative Signatures\n\nThe OpenGL API is designed without function overloading using only simple parameter types.\nThis results in explicit parameter encoding in function names for conceptually overloaded functions (e.g., glTexParameteri and glTexParameterf).\nAnother design decision for the OpenGL API is the high similarity of the integer, boolean, enum, and bitfield data types.\nThis means, that for *overloaded* functions, there is no separate function for ```GLboolean```, ```GLenum```, and ```GLbitfield``` types.\nUsing type-save functions of *glbinding*, some typically compiling code constructs are now deliberately broken.\nFor most of those cases, we provide alternative *overloaded* function signatures.\nAdditionally, we also fix signatures that are semantically broken in the OpenGL API specification, i.e., when base types (C types) are similar such as in the case of enums and integers.\n\nAlternative function signatures are enabled by default, so the following example works out-of-the-box:\n\n```cpp\n#include \u003cglbinding/gl/gl.h\u003e\n\nusing namespace gl;\n\n// ...\nglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);\nglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);\nglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);\nglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);\nglTexImage2D(GL_TEXTURE_2D, 0, GL_R8, 64, 64, 0, GL_RED, GL_UNSIGNED_BYTE, terrain.data());\n```\n\n### Meta Information\n\nBesides an actual OpenGL binding, *glbinding* also supports queries for both compile time and runtime information about the gl.xml and your OpenGL driver within the *glbinding-aux* library. This library comes with own includes and needs to be linked separately.\nTypical use cases are querying the available OpenGL extensions or the associated extensions to an OpenGL feature and their functions and enums.\n\nThe following example prints out a list of all available OpenGL versions/features:\n\n```cpp\n#include \u003ciostream\u003e\n\n#include \u003cglbinding/Version.h\u003e\n\n#include \u003cglbinding-aux/Meta.h\u003e\n#include \u003cglbinding-aux/types_to_string.h\u003e\n\n// ...\nusing namespace glbinding;\n\nfor (const Version \u0026 v : aux::Meta::versions())\n  std::cout \u003c\u003c v \u003c\u003c std::endl;\n```\n","funding_links":[],"categories":["TODO scan for Android support in followings","C++","Profile Loaders","Graphics"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcginternals%2Fglbinding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcginternals%2Fglbinding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcginternals%2Fglbinding/lists"}