Automatically updated C# bindings for https://github.com/nothings/stb with native dynamic link libraries.
- Create a new
nuget.configfile if you don't have one already. Put it beside your.sln. If you don't have a.slnput it beside your.csproj.
dotnet new nuget- Add the following NuGet package source to the file.
<add key="lithiumtoast" value="https://www.myget.org/F/lithiumtoast/api/v3/index.json" />- Install one the following packages:
stb_image-cs
If the stb header is not yet provided open up an issue and I'll add it!
- Download and install .NET 5.
- Fork the repository using GitHub or clone the repository manually with submodules:
git clone --recurse-submodules git@github.com:lithiumtoast/stb-cs.git. - Build the native library by running
./library.shon macOS or Linux and.\library.shon Windows.
If using IDE (Visual Studio / Rider): Open SDL.sln and build solution.
If using CLI: dotnet build.
Reference the .csproj from your own project. Be sure you built the native library in step #3 before running your application!
<ItemGroup>
<ProjectReference Include="path/to/stb-cs/src/cs/production/stb-cs/stb-cs.csproj" />
</ItemGroup>If you wish to re-generate the bindings, simple run ./bindgen.sh on macOS or Linux and .\bindgen.cmd on Windows.
For more information on how C# bindings work, see C2CS, the tool that generates the bindings for stb and other C libraries.
To learn how to use stb, check out the Lazy Foo' Production.
stb-cs is licensed under the MIT License (MIT) - see the LICENSE file for details.
stb itself is public domain or otherwise dualed licensed under MIT (MIT) - see https://github.com/nothings/stb/blob/master/LICENSE for more details.