Jump to content
  • Advertisement
Sign in to follow this  

StbSharp: C# Port of Famous C Framework

This topic is 675 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.
Edited by roman_shapiro

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!