The public source code is not up to date with the current development. I’m in the middle my “why serve it for free to vibe coders to call me obsolete” reflection.
Since then, there has been more videos, so here is a video playlist
What did I learn? Let’s say when I started I was trying to figure out how to open an empty window…
The part you may be mostly interested in, technically, has been treating the painting history as a log rather than just maintaining a snapshot stack to undo brush strokes. It opens original possibilities.
A .slap file is essentially a log of painting actions, which makes the entire document replay-able. This gives me guaranteed undo all the way back to the beginning.
Supported Zig versions
It is still written in Zig 0.16.0
AI / LLM usage disclosure
I use free chat as a contemporary search engine for certain things like:
Finding what I need around Objective-C
GPU vocabulary and finding what corresponds to what concept in Metal
Edit: My biggest regret about that initial post was not to have pinned a painting done with Slap
This one is not new, but now it’s on the top
Keycode is a different beast though! It’s identifies a physical keyboard button no matter what the layout (En, Ar, Fr…) e.g. semi colon means M on a french layout! (azerty)
Hmm, for some reason I can’t get it to work in that no cursor, brush or overlays are visible. In debug mode the console correctly logs all events, but nothing appears on the screen. It could obviously be just me being stupid.
I am running macOS Tahoe 26.5.1 (aarch64).
I built it using Zig 16.0 and have xcode 26.6 installed.
In the middle of the Zig logs, do you find some other long format with a timestamp? That would be ObjC logs (happen in case of failing at something).
Did the compilation output no specific message? (I would still give a shot to wiping out .zig-cache in case something failed and stayed stall during a build attempt)
Do you use a window manager that may have sent the window to another desktop?
Ah yes, the problem seems to be that it doesn’t work on my secondary monitor. If I start the program through the terminal on my primary monitor everything works as expected. Thanks for the help!
That’s a bitter-sweet conclusion lol.
I’m glad it did work. I wonder why not on the second screen? Here I have a noname external screen which I do most of my use on.
If you ever find out more, please feel free to let me know!
Thats really cool. If you get linux support in some form it would be dope. I implemented something similar a while ago but it wasn’t really focused on been useful app and more of a programming exercise. I wanted to rewrite it from scratch for a while now. Your project gives me motivation to actually come back to it)
Oh I actually just ran it on mac!
I get the red circle (~20px radius) and a counter on the top left (didn’t seem to show mouse coordinates) but I couldn’t leave a mark.
I’m glad Slap could motivate you!
About the linux port. I would love to at some point… I need to get my hands on some linux workstation. I am also very tempted by running it in browser…
Anyway, those are wishes at that point
yea it worked when i was using x11. But it was broken when i tried to use anything else (im on wayland now so it doesn’t work). It kinda relied on raylib’s feature of transparent window. And it doesn’t work anywhere else. Its obvious in hindsight what i shouldn’t have used third party library for cornerstone feature)
I have added a transparency mask to Slap.
I thought I would present it now instead of having another 40 minutes video to record on my hands in a few month…
Setting up a transparency mask allows defining selections with a brush.
It’s foundation work for selection tools to come.
But really using it for now is not my target. It’s there, you can clear it, but you can’t toggle it on and off as this means layers management which I intend to handle properly when I get at multi-layer.
The challenge were double:
integrating with the history model I had to kind of step into multi-layer
the first UX I made was disturbing and it felt contradictory as it was trying to address separate concerns. So I dropped it.
Slap has received some meaningful features and has been tagged 0.3.0 which brings me one step further to implementing selection transformation (which I crave).
I have recorded a small video demo.
In a nutshell:
although I went silent on the public repo, I am continuously working on Slap. So here is an update.
One very important tool for me when painting is selecting and transforming pixels around.
This means being able to alter the canvas in a transient/preview way.
I also doodle a lot of schemas at work and having a straight line which’s angle you can adjust as you draw is both something that needs preview and something I was simply craving.
So I have started defining a notion of dirty texture.
I thought let’s add the straight line tool, it’s at most a 2 days quicky feature which would prove my dirty texture works properly, then I will finally add my lasso and be happy ever after.
But well, adding the dirty texture into play I remembered I needed to integrate with the masks and history system etc.
It gave me the opportunity to spot some perf optimizations and to fix some alpha blending issues.
Finally, having a dirty layer gives some very nice possibilities, like straightening a stroke you started freehanded and as you go.
As I worked on the UX I found a lot of challenges and ideas along the way to make the tool both the simplest and most powerful I can get it to be.
I have recorded a video demo but bellow is a sum up of the main things that line tool does:
@WiserOrb thank you again for the help with the striding approach. I wanted to move across the TabletPoints and modify their .cursor field to align them that way. Even-though I found out copying redundant data was still faster, I still made a tested struct out of it for the day this approach is the most efficient one.
I was looking for a way to loop over nested fields of structs without repeating invariant context data and without declaring the structs in the function doing the looping so it was not coupled to the struct declaration.
However, the pointer arithmetic happened to be more costly than duplicating data in that case.
May sound very cryptic like this but here is the topic if you want more detail: