{"id":15731735,"url":"https://github.com/flyx/openglada","last_synced_at":"2025-07-24T06:04:55.946Z","repository":{"id":43350733,"uuid":"3179275","full_name":"flyx/OpenGLAda","owner":"flyx","description":"Thick Ada binding for OpenGL and GLFW","archived":false,"fork":false,"pushed_at":"2022-09-08T07:15:20.000Z","size":11683,"stargazers_count":97,"open_issues_count":3,"forks_count":13,"subscribers_count":16,"default_branch":"develop","last_synced_at":"2025-05-06T21:07:39.622Z","etag":null,"topics":["ada","ada-binding","glfw","opengl-bindings"],"latest_commit_sha":null,"homepage":"flyx.github.io/OpenGLAda/","language":"Ada","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/flyx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-14T18:01:33.000Z","updated_at":"2025-01-07T06:44:44.000Z","dependencies_parsed_at":"2023-01-18T00:45:54.493Z","dependency_job_id":null,"html_url":"https://github.com/flyx/OpenGLAda","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/flyx/OpenGLAda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyx%2FOpenGLAda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyx%2FOpenGLAda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyx%2FOpenGLAda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyx%2FOpenGLAda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flyx","download_url":"https://codeload.github.com/flyx/OpenGLAda/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyx%2FOpenGLAda/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266801402,"owners_count":23986371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ada","ada-binding","glfw","opengl-bindings"],"created_at":"2024-10-04T00:04:45.626Z","updated_at":"2025-07-24T06:04:55.918Z","avatar_url":"https://github.com/flyx.png","language":"Ada","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenGLAda – OpenGL binding for Ada\n\n**Project Status:** I do not have the time and energy to maintain this project anymore.\nBoth this project and the corresponding Alire crates are unmaintained.\nI would be okay with someone taking over the project, feel free to [contact me](https://flyx.org) about it.\n\n## Overview\n\n**OpenGLAda** is a thick OpenGL binding for the Ada 2005 programming language.\nUnlike other, thin, bindings (see the [project's homepage][4] for a list),\nOpenGLAda enriches the original API with concepts and features provided by\nAda, like object orientation, type safety and generics.\n\nOpenGLAda provides the following libraries:\n\n| Library name   | [Alire][29] crate name | Description                  |\n| ---            | ---                    | ---                          |\n| `opengl`       | `openglada`            | The OpenGL binding itself    |\n| `opengl-glfw`  | `openglada_glfw`       | [GLFW][3] binding            |\n| `opengl-text`  | `openglada_text`       | Text rendering library       |\n| `opengl-images`| `openglada_images`     | Image loading library        |\n\nThe library name is what you want to **`with`** in your `.gpr` file, e.g. `with \"opengl-glfw\";`.\nThe Alire crate is how you refer to the library if you're using Alire, e.g. `alr with openglada`.\n\nThe **GLFW binding** requires the [GLFW][3] library.\nThe **Text rendering library** requires the [FreeType][19] library.\nThe **Image loading library** uses [GID][10].\n\nThe GLFW and FreeType dependencies will be fetched automatically by Alire on Windows, Debian, Ubuntu and Arch Linux.\nOn other systems, you need to make them available to the linker yourself.\n\nOpenGLAda supports macOS, Windows and X11-based systems.\nAPI documentation can be found on the [project's homepage][4].\n\n### Migrating from C\n\nCompared to C, OpenGLAda provides the features of the following C libraries:\n\n * OpenGL\n * [GLEW][22]: OpenGLAda loads all post-OpenGL 1.1 subroutines dynamically via\n   pointers, so that available features may be queried at runtime.\n * [GLUT][23]: Long deprecated, yet still referenced from articles about OpenGL.\n   OpenGLAda provides an optional wrapper for the GLFW library that provides\n   functionality similar to GLUT.\n\n   Text rendering functionality superior to what GLUT provides are supplied by\n   `opengl-text.gpr` with the help of the FreeType library.\n * [Image loading][24]: OpenGLAda includes the [GID][10] library for image\n   loading.\n\n## Installation\n\nOpenGLAda is designed to be used with the [Alire][29] package manager.\nYou can instead install the projects via `gprbuild` + `gprinstall`.\nThis needs to be done for each project you want to use.\n\n## Scenario Variables\n\nOpenGLAda defines a number of scenario variables.\nSome are set automatically by Alire, others need to be changed manually with the `-X` command line parameter (either through `alr` or `grpbuild`).\n\nThe available variables are:\n\n * `Auto_Exceptions`: Configures exception handling:\n\n    - `enabled` (default): After each call to OpenGL, OpenGLAda checks whether\n      OpenGL has set an error flag and if it had, raises the corresponding\n      exception.\n    - `disabled`: The user has to query the error flag on their own.\n\n * `mode`: May take one of the following values:\n\n    - `debug` (default): Compile the project with debugging symbols and without\n               optimization.\n    - `release`: Compile the project for a release environment.\n\n\n * `Windowing_System`: *Automatically set by Alire*.\n    Sets the backend windowing system.\n    Used for GLFW and also for system-dependent parts of the API (GLX, WGL, CGL):\n\n    - `x11`: X Windowing System (Linux, BSD, etc)\n    - `windows`: Microsoft Windows\n    - `quartz`: Quartz Compositor (macOS)\n\n * `GLFW_Linker_Param`:\n   Relevant for the GFLW binding.\n   Define how you will link to GLFW. Default is `-lglfw`\n   everywhere but on Windows with GLFW 3, in which case it is `-lglfw3`.\n   No need to change this if the GLFW library is loaded via Alire.\n\n * `FreeType_Linker_Param`: *Automatically set by Alire*.\n   Relevant for the text rendering library.\n   Define how you will link to FreeType.\n   Default is `-lfreetype`.\n\nA typical Windows installation would be\n\n    $ cd opengl\n    $ gprbuild -p -XWindowing_System=windows -Xmode=release opengl.gpr\n    $ gprinstall -XWindowing_System=windows -Xmode=release opengl.gpr\n\n## Tests\n\nThe tests in this repository are small programs that are mainly used to check\nif the basic system is working. You can build them with\n\n    $ env GPR_PROJECT_PATH=opengl:opengl-glfw:opengl-images:opengl-text \\\n          alr build\n\nThe tests use Alire for fetching the dependencies, but do not use the Alire projects of the libraries.\nThe Alire workspace for the tests is not meant to be published.\n\n## Examples\n\nExamples are available in [this repository][11].\n\n## Developer Documentation\n\nI have written an article about the development of OpenGLAda on AdaCore's blog:\n\n * [Part 1][25]\n * [Part 2][26]\n\n### Binding Generation\n\nOpenGL implementations do not necessarily provide the newest OpenGL version,\nbut possibly some older one with some functionality of the newer versions\nprovided as extensions. For OpenGLAda, this means that most OpenGL functionality\ncannot be linked against via the library loader, since loading the library\nwould immediately fail if any function is not available, even if the user never\ncalls it. Most notoriously, Windows does not provide any OpenGL functionality\nnewer than 1.1 via library loading.\n\nThe remedy for this is that function pointers of newer OpenGL functions must\nbe queried at runtime. This is a tedious process and similar for each function.\nFor this reason, OpenGLAda uses a code generator to autogenerate the function\npointer types and the code loading each function, as well as the code importing\nOpenGL 1.1 functions via library loading.\n\nThe code generator can be found in `opengl/src/generator`. It processes the files found\nin `opengl/src/specs` and creates the files found in `opengl/src/generated`. The\ngenerator is a tool used at compile-time for building OpenGLAda and of no\ninterest to the general user. The generated files are checked in to version\ncontrol. The generator also generates the markdown file which is the base for\nthe [function mapping list][27] on the website.\n\nThe process of wrapping a new OpenGL function is:\n\n * Build the generator using `gprbuild generator.gpr` in the `opengl` directory.\n * Add the function specification to one of the `*.spec` files in `opengl/src/specs`.\n * Run `./generator` in the `opengl` directory (or `generator.exe` on Windows), which runs the generator on the specs and generates the Ada code.\n * Check in the newly generated code along with the changed spec.\n\nThe `*.spec` files use a syntax similar to Ada.\n\n## License\n\nOpenGLAda, as well as the Ada dependencies FreeTypeAda and GID, are\ndistributed under the terms of the [MIT License][7].\n\nThe Ada 2012 logo that is used in the images tests is distributed under the\nterms of the [CC BY-ND 3.0][8] license, the original author is [AdaCore][9].\n\n [1]: http://libre.adacore.com/\n [2]: http://www.adacore.com/gnatpro/toolsuite/gprbuild/\n [3]: http://www.glfw.org/\n [4]: http://flyx.github.io/OpenGLAda/\n [5]: http://gcc.gnu.org/wiki/GNAT\n [6]: http://www.glfw.org/docs/3.0/moving.html\n [7]: COPYING\n [8]: http://creativecommons.org/licenses/by-nd/3.0/deed.en_GB\n [9]: http://www.ada2012.org/#the_logo\n [10]: https://gen-img-dec.sourceforge.io/\n [11]: https://github.com/flyx/OpenGLAda-examples\n [12]: https://sourceforge.net/projects/gnuada/files/\n [13]: http://flyx.github.io/OpenGLAda/setup.html\n [16]: http://getadanow.com/#get_windows\n [17]: http://tdm-gcc.tdragon.net/\n [19]: https://freetype.org/\n [20]: https://github.com/flyx/FreeTypeAda\n [21]: https://github.com/flyx/OpenGLAda/releases\n [22]: http://glew.sourceforge.net/\n [23]: https://www.opengl.org/resources/libraries/glut/\n [24]: https://www.khronos.org/opengl/wiki/Image_Libraries\n [25]: https://blog.adacore.com/the-road-to-a-thick-opengl-binding-for-ada\n [26]: https://blog.adacore.com/the-road-to-a-thick-opengl-binding-for-ada-part-2\n [27]: https://flyx.github.io/OpenGLAda/mapping.html\n [28]: https://wixtoolset.org/\n [29]: https://alire.ada.dev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflyx%2Fopenglada","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflyx%2Fopenglada","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflyx%2Fopenglada/lists"}