.NET bindings for GLFW. Currently only tested / works on Windows but should be fairly easy to make it work on other platforms. Pull requests are welcome.
Use one of the following options:
If you include GLFW.cs directly into your project you'll need to implement the LoadAssembly() method of the GLFW class yourself, the default implementation is in GLFW.LoadAssembly.cs.
This can also just be included in your project of course, in which case the GLFW dlls must be copied into runtimes\{win-x86|win-x64}\native subdirectories relative to the GLFWDotNet.dll. See the output of the samples. An example MSBuild Target can be seen in the CopyDependencies.targets build script.
<PropertyGroup>
<GLFWDirectory>$(MSBuildThisFileDirectory)..\ext\GLFW\</GLFWDirectory>
</PropertyGroup>
<Target Name="CopyGLFW" AfterTargets="AfterBuild">
<Copy
SourceFiles="$(GLFWDirectory)x64\glfw3.dll"
DestinationFolder="$(TargetDir)runtimes\win-x64\native" />
<Copy
SourceFiles="$(GLFWDirectory)x86\glfw3.dll"
DestinationFolder="$(TargetDir)runtimes\win-x86\native" />
</Target>
Usage on Linux requires libglfw.so
to be installed as well as libdl.so
.
In Ubuntu the dependencies can be installed via the following command:
sudo apt install libc6-dev libglfw3-dev
Usage on MacOS requires libglfw.dylib
to be installed. Dependencies can be installed
via brew with the following command:
brew install glfw3
There are a few samples showing how to use GLFWDotNet.
- HelloWorld Basic HelloWorld program to get you started.
- GLFWInfo Writes information about the system out to the console.