Hey guys! Ever since DanB’s BitString demo I have been wondering what exactly that mysterious BitString stuff actually is. 😉 All the info I could find was that it’s very efficient to write to the framebuffer, but that’s about it.
Can anyone tell me more about this? How can it be used to write vertical lines to the framebuffer? Would be interesting for a raycaster!
I don’t think it’s very efficient to use to write a framebuffer… it’s really not that efficient speed-wise for anything. I think it’s biggest benefit is that it’s convenient to do operations on data as if it was strings of bits, rather than having to worry about alignment, masking, shifting, etc. If you’re processing a screen, you know where everything should be, and can easily draw vertical lines using standard instructions. Of course it may be more efficient if you do a bitstring function in asm than a vertical line function in c (since gcc doesn’t do bitstrings), but you should be able to do an asm vertical line function without bitstrings much more efficiently than bitstrings.
If you make a raycaster, I’d just use a standard vertical line drawing function written in c, and when you get to a point that you want to optimize, just rewrite the line functions in asm, and drop it right into your existing code without having to make any other changes (and I’d be glad to help out w/ that if you need it).