Public domain image and OGG Vorbis loading

Well, another change to SIEGE, this time without screenshots — namely, SIEGE has now received public domain image (via stb_image) and OGG Vorbis (via stb_vorbis) loading!

All the example programs have been modified to use this instead now, to be able to use SIEGE with image, audio (and, from before, font) loading without any external libraries!

Posted in SIEGE.

Public Domain font loading and other improvements

A couple of days ago, SIEGE has received Public Domain font rendering via the excellent stb_truetype library; other improvements have been added to both the STB and Freetype modules and implementations, however:

  • Kerning has been implemented
  • User-provided DPI setting for glyph rendering (default is 96)
  • Loading fonts from generic streams (SGStream — see the previous post)
  • Major cleanup of text-rendering and related (text size, offset position, …) functions in siege/graphics/font.c
  • Fixed a bug with rendering artefacts on the left-hand side of some glyphs

The new module is named “STB-TrueType” — in order to use it, simply replace “Freetype” in the sgLoadModule() call with “STB-TrueType”.

The changes are spread across multiple commits, but this is the largest: https://github.com/SIEGE/siege/commit/34e31681738a7b4b479780a8c7069f50acbc6be6.

And finally, a screenshot of the new module in action with all the improvements:

As you may have noticed, the new module does create a bit more “blurry” text, which may be (depending on the situation and the style of the game) a good or a bad thing. If that is a problem, simply use the Freetype module, which is still available (and will be available — I have no intention of removing it). I will probably be changing all the SIEGE examples to use this by default for one very simple reason — no external dependencies, everything is included with the module.

Posted in SIEGE.

SIEGE Streams

SIEGE has just received a new feature — streams. They allow the user to load, say, textures and audio, directly from sockets, memory and whatnot, without any issues.

Of course, existing functions will remain for loading, as it is much more convenient to simply use the file load function rather than who-knows-what when advanced functionality isn’t required; internally, it now all uses streams, however.

The API is very simple and can be seen here: https://github.com/SIEGE/siege/blob/master/include/siege/util/stream.h.

Posted in SIEGE.