tmpvar.com wrench logo

Convering PNG to a Win32 Resource File (.res)

Wanting to add application icons to my prototyping platform (hotcart) I discovered there is pretty trivial way to add icons to applications without using the Visual Studio GUI or tools like rc.exe.

Running C on the browser with WebAssembly

Over the past couple years, all of my hobby programming has been done in C with light usage of C++. To be more precise, I only use C++ features where it would be more painful in C. Things like operator overloading, function overloading, constexpr, and very limited template usage where macros would do more harm than good.

Recently, I've been working up proof of concepts and publishing them under the /poc directory. Each of these POCs have multiple demos, which are all built to be self contained to avoid bitrot, written in Javascript. Javscript is a fine language, but sometimes I want the demo to serve a dual purpose:

  1. demonstrate some technique / approach / etc..
  2. give me a starting point for using some aspect the POC in native code (most likely in C)

Dynamic Cubemaps

While watching John Beech work in MM Dreams, I noticed the background and had to try and replicate it. This effort resulted in a easy method of rendering painterly / cloudy looking backgrounds, with the added benefit of being very flexible while remaining cheap.

Rendering Interactive Graphics in Kitty

Using kitty's graphics protocol, one can quickly build visualizations and interactive demos.

Using C/C++ as a scripting language (Part 2)

Continuing on the previous article, we consider what it would mean to persist state across hot reloads.

Using C/C++ as a scripting language (Part 1)

Those familiar with web development will probably have used some form of hot module reloading. This dramatically reduces the development to test iteration time. It is also very common to run a Javascript file via node path/to/file.js or similar. Since I've been preferring C/C++ lately, how can these conveniences be ported to a lower-level language?

Blur Based 2D Realtime Radiosity (CPU)

This experiment is an attempt to find a simple & parallel algorithm for lighting a scene with low-frequency light (read: global illumination, soft shadows). This approach stems from radiosity, so instead of shooting rays from every visible surface to each light we instead fill a grid with energy from each light.