Wall of text!
September 6th, 2008 3:24 amMy first thought when I saw what the theme would be for this MiniLD was, this is the perfect chance to finally start making that pixel/paint program I’ve been meaning to do for literally half a decade! So far I’ve gotten by with Gimp, but I really don’t like its interface, and it’s pretty obvious it wasn’t made with pixel art in mind at all, among other things. Its tablet handling is also buggy, though to be fair that’s actually a GTK issue. (On the other hand, GTK was made for Gimp, so, uh.)
Anyway, a gfx editor needs an interface. This is part of the reason it’s been delayed for so long, there just hasn’t been any cross-platform interface lib that I’ve been satisfied with, and apart from GTK’s buggy support I haven’t found any cross-platform tablet libs either. Tablet support isn’t exactly essential for a pixel editor, but if I put that in it wouldn’t be just for pixels. And it doesn’t have to be cross-platform, the Linux tablet evdev interface is pretty easy to use (or was, until Xorg started blocking it), but it’d be nice. Still, I’ve made some half-hearted false starts on a tablet-less version using a custom interface in SDL, but SDL is also limited to one window, which is really not that big of a deal either, but still, multi-window support would be nice.
While these things shouldn’t have prevented me from getting it done, they have been.. irksome. Which bothers me. That’s the problem with being a perfectionist, if you want something to be perfect the first time around you’ll never actually get anything done. But! I’ve been getting slightly better at avoiding that problem, not least of which thanks to Ludum Dare and some other game compos. If you’ve seen some of my entries you know what I mean =)
Also, SDL 1.3 has been getting to a usable state lately. It’s still in development, but it supports multiple windows and pressure-sensitive tablets, and it’s cross-platform. This kinda leaves my excuses baseless.
In short, it’s time to make this thing.
It still needs that interface, though! I actually started working on a simple library for that earlier this week with the intention of getting it done and ready to be used before the compo started, so that I could use it for my tool and maybe others could, too. While that didn’t happen, I did get some things done, and I like how it’s turning out. It’s based on SDL 1.3, using Lua for the interface. You can do stuff like this:
Frame {
w = 100,
h = 100,
Button {
label = "Click",
onclick = function () print "whee" end
},
}
But it also supports a kind of hybrid immediate mode!
if Button{ x=10, y=5, label="Click" }.clicked then
print "hurray"
end
I say hybrid because I’m not sure it could be called a true IMGUI, since some things like drawing are really delayed actions (though it happens behind the scenes, so you usually don’t have to care about this). This way immediate and retained mode can be freely mixed, so you could eg. have immediate-mode stuff inside a retained-mode frame’s onhover handler, and it’d all combine seamlessly.
I call it “SIF 2″ for now, but that might change. (If you’re wondering about SIF 1, that’s an ancient project that never really got anywhere. I guess I could just call it SIF. Or probably something completely different.)
Anyway, it’s not quite ready for use yet, so now I’ve got to decide what I want to do for this MiniLD! Do I keep working on the interface lib, even though that means I cheated by starting way before the deadline? Or, do I make some other tool without using the interface lib, so I can keep it within the 48 hours? I do have an idea for another very simple tool that could possibly be slightly useful. Decisions..