Modern OpenGL bindings for C#.
Clone or download
Permalink
Failed to load latest commit information.
AMDOVX Added pre-compiler OpenVX implementation from https://github.com/GPUO… Jan 7, 2018
ANGLE Added precompiled binaries for ANGLE (from google repository). Dec 26, 2017
BindingsGen Added unsafe and generic overloads for Get commands and few others. Jun 4, 2018
GLSpecs Updated to lastest GL specification: Oct 14, 2018
Khronos.Net Using RTDL_LAZY flag (#93) Mar 23, 2018
OpenGL.Net.CoreUI.Test Downgraded to NUnit 3.6.1. Mar 13, 2018
OpenGL.Net.CoreUI Removed Trace message. Jan 25, 2018
OpenGL.Net.GTK3 Created x64 configurations for compiling with VS native tools (#79). Nov 9, 2017
OpenGL.Net.Objects.Test Included testing/coverage target for OpenGL.Net.Objects.Test_net461.c… Nov 3, 2018
OpenGL.Net.Objects Do not assume that Gl.GetString(StringName.ShadingLanguageVersion) re… Nov 3, 2018
OpenGL.Net.OpenWF Updated license preamble on other projects. Aug 9, 2017
OpenGL.Net.Test Ops. No Uniform matrix tests. Jun 4, 2018
OpenGL.Net.VideoCore Moved Bcm to the most appropriate location (VideoCore). Feb 21, 2018
OpenGL.Net.WinForms.Test Downgraded to NUnit 3.6.1. Mar 13, 2018
OpenGL.Net.WinForms Removed unused KhronosApi.ExtensionSupportAttribute. Feb 13, 2018
OpenGL.Net.Xamarin.Android VS has autonomously changed android target framework to v7. (?) Jan 15, 2018
OpenGL.Net Ignore documentation warnings. Oct 14, 2018
OpenVX.Net Removed unused KhronosApi.ExtensionSupportAttribute. Feb 13, 2018
OpenWF.Net Removed unused KhronosApi.ExtensionSupportAttribute. Feb 13, 2018
RefPages Included ES 1.1 documentation. ES3.2 documentation will missing. Mixe… Apr 26, 2017
Samples Fixes constructor execution. Oct 26, 2018
Tools MSBuild target can be setup with specific environment variables. Feb 21, 2018
VXSpecs Progress in sample. Oct 21, 2017
Wiki Supporter's logos. Dec 10, 2017
.appveyor.yml Temporarily disable Visual Studio 2017 image: seems to have issues to… Nov 3, 2018
.codecov.yml Exclude GL tests from coverage (generally not runnable on CI servers). Feb 14, 2018
.gitignore Ignore test script output files. Jan 15, 2018
.gitmodules Using Khronos/EGL-Registry as source for EGL reference pages. Apr 23, 2017
.travis.yml Trying to force mono version. Mar 4, 2018
AUTHORS Duplicated strongly typed enumerant are removed, but keep track of th… Mar 3, 2015
CONTRIBUTING.md Updated README.md Jul 28, 2017
LICENSE Changed LICENSE, from LGPL2 to MIT: more permissive, more useful. Jul 28, 2017
OpenGL.Net-Logo.gif Added tesseract animation, creating project logo. Aug 9, 2017
OpenGL.Net.CoreProfile.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.CoreUI.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.Debug.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.ES2Profile.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.Math.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.Objects.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.Objects_VC14.sln Unit tests running. Oct 26, 2018
OpenGL.Net.SC2Profile.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.VideoCore.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.WinForms.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.Xamarin.Android.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.nuspec Do not require license acceptance. Mar 14, 2018
OpenGL.Net.targets Included testing/coverage target for OpenGL.Net.Objects.Test_net461.c… Nov 3, 2018
OpenGL.Net_Mono.sln * KhronosLogMapGlx.xml: Nov 14, 2017
OpenGL.Net_VC14.sln Updated to lastest GL specification: Oct 14, 2018
OpenGL.Net_VC14.sln.DotSettings Added NT as allowed word. Feb 25, 2018
OpenGL.Net_VC15.sln Include Xamarin/Android in VS 2017 solution. Jan 7, 2018
OpenGL.Net_VC15.sln.DotSettings Solved many code issues reported by R#. Dec 14, 2017
README.md Update README.md Feb 10, 2018
RunTests_VC14.bat Run test script. Jan 15, 2018
RunTests_VC15.bat Fixed compilation on .NET Core projects. Jan 15, 2018

README.md

build build codecov nuget NuGet

wiki

OpenGL.Net

Modern OpenGL bindings for C#.

OpenGL

Features

  • 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.

Frameworks

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)

Toolkits

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).

NuGet

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

OpenVX

Bindings for OpenVX 1.2; currently under development, but the sample is running well.

Features

  • Strongly typed;
  • Includes VXU commands;

OpenWF

OpenWF Composition.

Instructions

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).

Clone the repository

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

Documentation

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.

Acknowledgements

Many tools and services are required to build and run OpenGL.Net.

Licensing

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.