Mattias Gustavsson
banner
mattiasg.bsky.social
Mattias Gustavsson
@mattiasg.bsky.social
Hobby game dev, making retro style games: mattiasgustavsson.itch.io and public domain C libs: github.com/mattiasgustavsson
I write about things at mattiasgustavsson.com
Feel free to DM me about anything
Pinned
I’m going to do a 🧵 about making retro-style games in C/C++, and also about getting them to run in a browser.
what are the worst things about the modern day internet?
November 1, 2025 at 1:06 PM
Reposted by Mattias Gustavsson
Got back into using the video editing features of Blender to make a trailer for some of my open source shenanigans - Announcing: DOSBox Pure Unleashed 🥳 www.youtube.com/watch?v=t4q8...
DOSBox Pure Unleashed
YouTube video by Psyraven
www.youtube.com
October 11, 2025 at 3:40 PM
Reposted by Mattias Gustavsson
hi, looking for game programming or related work. primarily experienced in unity dev and c++. been looking for work for two years now even outside games/tech and won’t have a place to stay soon. i’m in los angeles / US
my portfolio eslee.dev/portfolio/ | her@eslee.dev
Eslee / Portfolio
eslee.dev
October 15, 2025 at 7:11 PM
Reposted by Mattias Gustavsson
The single header lib also includes source code for an encoder utility and a playback app (both which makes use of other single header libs), behind conditional compile switches (ifdefs). Instructions for how to build them can be found at the top of the file.
August 31, 2025 at 6:48 PM
Reposted by Mattias Gustavsson
The code is public domain, and available here github.com/mattiasgusta...
For most uses, you are probably better off using a real codec. But for something small, simple, self-contained with no dependencies, this might fit the bill.
github.com
August 31, 2025 at 6:48 PM
Reposted by Mattias Gustavsson
The videos in the examples are compressed with my "default" setting, which makes them quite small, with ok-ish quality. On "max" they are more like dvd in size/quality. I focused on avoiding temporal aliasing, and I think i pulled that off quite well.
August 31, 2025 at 6:48 PM
Reposted by Mattias Gustavsson
All in all, it seems like my quality/compression is maybe around dvd quality (?), so not in the same league as modern codecs (but attempting that would start to infringe on patents, so I don't particularly want to go down that route).
August 31, 2025 at 6:48 PM
Reposted by Mattias Gustavsson
Here are two sample video snippets:
mattiasgustavsson.com/wasm/fmv.html
mattiasgustavsson.com/wasm/fmvdl.h...
(both are displayed with my CRT filter, because that's how I am most likely to be using this myself, but it can be toggled with F9).
August 31, 2025 at 6:48 PM
Reposted by Mattias Gustavsson
I tried my hand at making a video codec. I didn't know the first thing about video codecs when I started, so was quite fun to learn about the concepts and how to implement them.

I packaged the result in a stb-style, single-file header-only lib, < 2500 loc with no dependencies.
August 31, 2025 at 6:48 PM
I tried my hand at making a video codec. I didn't know the first thing about video codecs when I started, so was quite fun to learn about the concepts and how to implement them.

I packaged the result in a stb-style, single-file header-only lib, < 2500 loc with no dependencies.
August 31, 2025 at 6:48 PM
Reposted by Mattias Gustavsson
Round a uint32 up to the nearest power-of-two value:
gist.github.com/mattiasgusta...
pow2_ceil.h
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
August 1, 2025 at 1:45 PM
Round a uint32 up to the nearest power-of-two value:
gist.github.com/mattiasgusta...
pow2_ceil.h
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
August 1, 2025 at 1:45 PM
Reposted by Mattias Gustavsson
I am excited to share this new single-header C library I have been working on for a while now: vecmath.h, a comprehensive vector/matrix math library for graphics/games/3d.
It allows you to write vector math code in C that looks like this:
July 21, 2025 at 3:09 PM
Reposted by Mattias Gustavsson
If you're looking for a vector math lib for C (or C++) check it out

github.com/mattiasgusta...

If you do take a look, please let me know what you think about it - getting feedback is a big part of the reward releasing libraries like this, and I spent a lot of time and effort on it
github.com
July 21, 2025 at 3:09 PM
Reposted by Mattias Gustavsson
It's been tested on windows, mac, linux and web-assembly, using msvc, clang, gcc and tcc (tiny c compiler).
July 21, 2025 at 3:09 PM
Reposted by Mattias Gustavsson
It is not trying to be the most optimized library, not using any SIMD intrinsics or assembly code, just straightforward, fully portable, simple implementations of a large number of math functions.
July 21, 2025 at 3:09 PM
Reposted by Mattias Gustavsson
It has a large set of functions, as it attempts to implement most of what you get in shader languages like HLSL and GLSL, and also most of the utility functions from libraries like D3DX in DirectX.
July 21, 2025 at 3:09 PM
Reposted by Mattias Gustavsson
Even though it is primarily designed as a C library, I have also tried to make it fairly nice to use from C++, conditionally adding operator overloads and constructors, but it is not trying to be idiomatic "modern C++" in any way.
July 21, 2025 at 3:09 PM
Reposted by Mattias Gustavsson
Here is the library: github.com/mattiasgusta...

Now, you get the best ergonomics if you use it with clang compiler in C11 or later, as it makes (optional) use of C11 _Generics and clang vector type extension, but it doesn't require either to work.
github.com
July 21, 2025 at 3:09 PM
I am excited to share this new single-header C library I have been working on for a while now: vecmath.h, a comprehensive vector/matrix math library for graphics/games/3d.
It allows you to write vector math code in C that looks like this:
July 21, 2025 at 3:09 PM
Reposted by Mattias Gustavsson
Reposted by Mattias Gustavsson
The engine also includes an editor for adjusting images, implemented using a custom basic imgui system. I've written a bit about it here: mattiasgustavsson.itch.io/yarnspin/dev...
June 29, 2025 at 3:05 PM
Reposted by Mattias Gustavsson
This is what my dev environment looks like when I'm making a game in Yarnspin. I use notepad++, with a custom color scheme, with the "folder as workspace" to get a tree view for both scripts and image files. And with keyboard shortcuts for run/compile and go to error.
June 29, 2025 at 3:05 PM
Reposted by Mattias Gustavsson
The custom script language for Yarnspin is made to be simple, and without a lot of notation or complex syntax. Mostly it's just specifying images and text to display, listing options to choose from and where they lead to
June 29, 2025 at 3:05 PM
Reposted by Mattias Gustavsson
It was made in about a week, using my Yarnspin game engine, which is written in plain C using only stb-style single header libraries github.com/mattiasgusta...
GitHub - mattiasgustavsson/yarnspin: A simple story-telling game engine
A simple story-telling game engine. Contribute to mattiasgustavsson/yarnspin development by creating an account on GitHub.
github.com
June 29, 2025 at 3:05 PM