Modern OpenGL bindings for C#.
- OpenGL 4.6, 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.
- GLU (only tessellator commands).
- Generated from the lastest official XML specification
- 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; you can share code for OpenGL and OpenGL ES;
- Strongly typed enumerants;
- OpenGL entry points overloading;
- Fully documented OpenGL entry points with the official manual pages;
- Automatic OpenGL extensions and implementation limits query;
- Checking errors after each OpenGL command (Debug builds only);
- Integrated entry points call logging (Debug builds only);
- Support ANGLE backend (for OpenGL ES on DirectX);
- Vector, math and color data structures. With System.Numerics.Vector support.
If you need more OOP with OpenGL, you can give a try to OpenGL.Net.Objects.
OpenGL.Net is running on a number of .NET frameworks:
- .NET Framework 3.5
- .NET Framework 4.6.1
- Xamarin/Android
- .NET Core 1.1
- .NET Core 2.0
- .NET Standard 2.0/1.4/1.1 (under development)
OpenGL.Net is not aware(*) about the underlying platform or graphical toolkit you're running on. To create a GL context, users are required to provide a window handle and a display handle. There are sub-projects that automate the GL viewport definition and creation.
- System.Windows.Forms toolkit, using an custom UserControl.
- GTK# toolkit, using a custom Widget (need support).
- Android, using a SurfaceView (need support).
- Raspberry Pi 2 VC4, using the platform SDK (need support).
- OpenWF compatible video systems (need support).
Open the Package Manager Console and run the following command:
Install-Package OpenGL.Net
You can choose to restrict the available GL profile:
Install-Package OpenGL.Net.CoreProfile
Install-Package OpenGL.Net.ES2Profile
Math data structures:
Install-Package OpenGL.Net.Math
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
Bindings for OpenVX 1.2; currently under development, but the sample is running well.
- Strongly typed;
- Includes VXU commands;
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
msbuild /p:Configuration=Release OpenGL.Net_VC15.sln
msbuild /p:Configuration=Release OpenGL.Net_Mono.sln
The following environments can be used:
- Visual Studio 2015 for OpenGL.Net_VC14.sln
- Visual Studio 2017 15.3 (Preview 2) for OpenGL.Net_VC15.sln
- Mono 4.5 for OpenGL.Net_Mono.sln; as alternative, you can build using
xbuild
Go to the wiki to look for information about the project, especially the how do I... page. There is also a Samples directory where application skeleton are implemented for various platforms, and there is an exaustive and documented hello triangle application.
Many tools and services are required to build and run OpenGL.Net.
The project is released under the MIT license. Previous revisions of the project were licensed under the LGPL2 licence; this kind of license seems limiting the deployment of the binary forms on some platform (ironic, isn't it?). Since the project is maintained to be useful on the widest range of platforms/user-cases, and considering the spirit of the technology used to build it (.NET Fundation), the MIT license was preferred. The WTFPL license was considered also, but it has not met all requirements.