Mattias Gustavsson 💖
@Mattias_G
Hobby game dev, making retro style games: http://mattiasgustavsson.itch.io and public domain C libs: http://github.com/mattiasgustavsson
I’m going to do a 🧵 about making retro-style games in C/C++, and also about getting them to run in a browser.




I wrote a bit about the design of the Yarnspin engine here: mattiasgustavsson.itch.io/yarnspin/devlo…
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/devlo…
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.
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
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/mattiasgustavs…
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:
If you're looking for a vector math lib for C (or C++) check it out github.com/mattiasgustavs… 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
It's been tested on windows, mac, linux and web-assembly, using msvc, clang, gcc and tcc (tiny c compiler).
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.
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.
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.
Here is the library: github.com/mattiasgustavs… 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.
The engine itself is only 12k lines of code, and that includes both the runtime itself, but also the compiler for its custom scripting language, the asset conditioning pipeline and a built-in image adjustment tool.