Automatic generated bindings of GLFW3 for .NET
Please report any bugs and suggestions!
Please keep in mind to add the file WrapperGLFW.dll.config to your project and change the option CopyToOutputPath
of the file WrapperGLFW.dll.config to Always.
The file can be found under /yoursolutionpath/packages/GLFW.NET.x.x.x/Content/WrapperGLFW.dll.config
.
This is required for Linux or Mac and if you don't do it, the library won't work.
This repository provides bindings for the latest GLFW3 version. It covers almost the complete API except Vulkan.
The binding is generated automatically but for a small part.
To get support for the Vulkan specific functions it's recommeneded to use the additional file GLFW3_Wrapper.cs which includes the missing bindings (for Vulkan) and an object oriented wrapper.
The projects under src are the generator, raw GLFW binding and an oop wrapper with binding for GLFW.
To get the binding as dll please read further.
- Clone
- Go into src/
- Build the project with the command
Build.cmd
- Link the output dll to your project and copy the native glfw.dll into your output directory
The x64 glfw3.dll can be found in the dependencies folder. If you need a custom binary for windows go to the glfw website Pre-build binaries for all other architectures on windows e.g. x86 can be found there.
- Install glfw with your package-manager (version glfw 3.2.1)
- Clone
- Go into src/
- Build the library file with the command
sh build.sh
- Link the dll to your project and link/copy WrapperGLFW.dll.config to your build-output directory (needed!)
There are also custom targets available for FAKE:
Build WrapperBinding
to get the binding with oop wrapper (default target).Build RawBinding
to get the binding without oop wrapper.Build Generator
to build the generator.Build all bindings
to build the raw and wrapper binding.- ```Build`` to build all projects available in the src folder.
Clean
to clean the build folder.
To use them simply add them with quotation marks after the build command.
- The project is compatible with Mono. It can be opened and built by MonoDevelop too but using the script file is recommended.
- The current GLFW.dll is for windows. For Linux/Mac please keep in mind to install glfw with your package-manager
- Again, the wrapper which is highly recommended to prevent seg faults can be found under src/GLFW_Wrapper.cs
Few usage examples are under the examples folder:
- How to use GLFW3.NET with SharpVk to acquire a VkSurfaceKHR from GLFW
Other examples can be seen in the wiki page of this repository.
- The library uses CppSharp for binding generation.
Contributions to make this binding better and staying up to date are readily appreciated, feel free to send PR's and open issues if there are any.
To build the generator under Linux or Mac you have to compile the latest CppSharp on your own.
Windows developers can easily use the existing dlls in the dependencies folder.
We're having a gitter chat for discussing binding generation and or additional features! Feel free to join us!