[Klug-general] random post: video of some code in action

James Morris james at jwm-art.net
Thu May 20 20:30:18 UTC 2010


just some stuff i've been working on in my spare time.

for the past month or so i've been working out how to get a
window-manager-like window-placement algorithm fast enough to work in a
real-time context. originally started by ripping code out of fluxbox, but
this was far too slow after around 200 'windows' were placed.

then i decided to go the other way and instead of working out where to
place blocks (i'll call the windows blocks now) by inspecting the blocks
already placed, i'd divide the unused space itself up into blocks which
all link to each other. straight to the point: it got far too complicated.

then i figure out to just use a 2d array (which is ok, for my use, it will
be 128x128) which marks each element in the (128x128) grid as used or
unused. oh but an array of chars look at all those wasted bits!

so eventually after much work and broken concentration, have each bit in
the array representing used/unused state. it's a bit of a departure from a
window-manager like placement algorithm - the test program has five
boundaries which mark where block placement can happen and outside of
which cannot happen. the last of these boundaries overlaps all the others.
each has a different placement strategy.

looks like an old retro demo or something:

http://jwm-art.net/art/freespace_grid.ogv

(bit of an odd shape around 650 x 920 px)

james.




More information about the Kent mailing list