https://github.com/gasinfinity/rena.interop.khronos
Raw API bindings of Khronos APIs for modern .NET
https://github.com/gasinfinity/rena.interop.khronos
bindings dotnet-core graphics-programming opengl
Last synced: about 2 months ago
JSON representation
Raw API bindings of Khronos APIs for modern .NET
- Host: GitHub
- URL: https://github.com/gasinfinity/rena.interop.khronos
- Owner: GasInfinity
- License: mit
- Created: 2023-04-13T19:26:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T21:14:27.000Z (about 1 year ago)
- Last Synced: 2026-02-20T18:10:44.482Z (4 months ago)
- Topics: bindings, dotnet-core, graphics-programming, opengl
- Language: C#
- Homepage:
- Size: 832 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🔗 Rena.Interop.Khronos
Almost type-safe, modern and raw .NET interop bindings for numerous Khronos APIs.
## ❓ How to use the generator
I recommend cloning the repo for now and running it from there, until a .NET tool is published.
The generator supports currently generating Vulkan, OpenGL (ES Included!) and WGL bindings with support for almost all extensions (as I cannot test all of them). It maintains 'type-safety' to an extend by making use of the 'group' attribute in OpenGL enums. However, the gl.xml spec from Khronos doesn't have group attributes for every element and command parameter so if something doesn't have a group it will end up in an 'Ungrouped' enum.
It currently generates everything in a self contained file with all the declarations inside a `static class`. All functions are stored as C# unmanaged function pointers so the only overhead is that of the instantiation of the Loader (e.g: .Commands in OpenGL based ones) and P/Invoke stubs // GC Transitions.
The bindings are generated on a 'per-device basis', that is: It is recommended to maintain different instantiations of `Commands` per context for OpenGL. Vulkan already mandates a different `DeviceCommands` instantiation per device.
The main CLI arguments are:
```bash
--spec --apis [ ...] --namespace --class-name --output --extensions [ ...]
```