🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

StbSharp: C# Port of Famous C Framework

Started by
-1 comments, last by roman_shapiro 7 years, 4 months ago
Hello,
I would like to introduce StbSharp: https://github.com/rds1983/StbSharp
It is open-source(MIT licensed) C# port of famous framework Stb: https://github.com/nothings/stb
StbSharp is quite young. Only stb_image.h is ported and not completely; it can load only .png and .jpg files.
It requires VS2013 & MonoGame 3.5 to be opened/compiled.
The sample loads the same .jpg image twice: first time through the Texture2D.FromStream(standard MonoGame way of loading images during the run-time) and second - through StbSharp. Then it renders both images and reports loading time. The attached screenshot demonstrates the sample in action.
As you can see the StbSharp is somewhat slower. But on the other hand it gives consistent result of the run-time image loading through different platforms.
It is important to note, that StbSharp is not manual port. It has been ported using another open-source(also MIT licensed) project called Sichem: https://github.com/rds1983/Sichem
Sichem is C to C# code converter. It uses libclang to build the syntax tree from C and generates the C# code from it. Right now, Sichem works only with stb_image.h. However it could be tuned to port other C projects if required .
Now, let's return to StbSharp. My first priority is to add other images types supported by stb_image.h (gif, pic, psd, etc). Then I'll consider taking another stb library (i.e. stb_truetype.h).
If the project will attrack any interest, I'll post updates there.
Thanks.

This topic is closed to new replies.

Advertisement