Modern OpenGL bindings for C#.
Generated from the lastest official XML specification, OpenGL.Net provides:
- Function pointer wrappers, with safe and unsafe parameters, pinning managed memory when necessary;
- Automatic entry points aliasing management: function loader is aware of the current OpenGL context;
- Strongly typed enumerants;
- OpenGL entry points overloading;
- Fully documented OpenGL entry points with the official manual pages;
- Vector, math and color data structures. With System.Numerics.Vector support.
- Automatic OpenGL extensions and implementation limits query;
- Checking errors after each OpenGL command (Debug builds only);
- Integrated entry points call logging (Debug builds only);
Currently implemented API are:
- OpenGL 4.5, including compatibility profile
- OpenGL ES 3.2, including OpenGL ES 1.0
- OpenGL SC 2.0; OpenGL SC 1.0 is not supported.
- WGL, GLX 1.4 and EGL (Native Platform Interface) 1.5 as platform APIs.
- Broadcom VideoCore IV and OpenWF Composition (alpha state)
If you need more OOP in OpenGL, you can give a try to OpenGL.Net.Objects.
In order to use OpenGL.Net you only need to link the library; due the current state of the project, it is advisable to clone the repository and work directly with the library, since this method offers more flexible solution (i.e. Debug builds).
Follow the command below to clone and build the repository.
git clone https://github.com/luca-piccioni/OpenGL.Net.git
cd OpenGL.Net
msbuild /p:Configuration=Release OpenGL.Net_VC14.sln`
Open the Package Manager Console and run the following command:
Install-Package OpenGL.Net
To integrate window systems, run the most appropriate command for your platform:
Install-Package OpenGL.Net.WinForms
Install-Package OpenGL.Net.Xamarin.Android
Install-Package OpenGL.Net.VideoCore
Or just download the nuget binary packages:
- OpenGL.Net
- OpenGL.Net.WinForms: System.Windows.Forms UI integration (GlControl), supporting Windows and Linux.
- OpenGL.Net.Xamarin.Android: Xamarin/Android UI integration.
- OpenGL.Net.VideoCore: Rpi Broadcom VC4 UI integration (native, no X11 support).
Go to the wiki to look for information about the project.
If you use OpenGL.Net, and you're willing to improve the project, your contributions are welcome.
If you find something wrong during the development, you can open an issue to get help. The issue should specify all information that helps to identify the problem. The minimal information to be included should be:
- OpenGL.Net version and configuration;
- Operating system;
- GPU device driver vendor, if correlated with the problem.
The common reasons for creating an issue:
- Unexpected exceptions: if you get an unexpected exception from OpenGL.Net, the issue should specify the exception stack and message.
- Missing OpenGL API: if you expect a GL command, a GL constant or an enumeration, but it is missing or wrong, you can create an issue about it; you can go further by checking the local gl.xml specification, and if it is reasonable, create an issue to the Khronos GitHub repository.
- Toolkit integration: you can run OpenGL.Net with any toolkit on any(*) platform, just find the display and window handles. You can open an issue for requesting a support library for integrating some toolkit.
- Missing feature: you can request any feature implementation, if it is related to the project target.
Once you have created an issue, you are free to submit a pull request relative to the issue.
If you like the project, or if it has saved you time, or you just want to offer a free beer to me, you can .