4 ms·
There's an accompanying blog post at https://zserge.com/posts/fenster/ https://zserge.com/posts/fenster/ This author has some pretty cool stuff, like a tiny al
by vmsp 1y ago
There's an accompanying blog post at https://zserge.com/posts/fenster/ https://zserge.com/posts/fenster/
This author has some pretty cool stuff, like a tiny alternative to Firebase https://zserge.com/posts/pennybase/ https://zserge.com/posts/pennybase/
- unwind 1y agoThere is at least two bugs in the blog post, here: Next simple task would be to fill the complete framebuffer with a solid colour: memset(f->buf, rgb, f->width*f->height*sizeoof(uint32_t)); The first is the obvious typo around `sizeof`, which I didn't even see at first (edit: this). The second is that code will only work for 8-bit colors, i.e. only the 8 (technically CHAR_BIT, "a byte") least-significant bits of `rgb` will be used. This is a quirk of the `memset()` standard C function, which has the prototype: void *memset(void s[.n], int c, size_t n); but then the man page [1] says: The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c. [1]: https://man7.org/linux/man-pages/man3/memset.3.html https://man7.org/linux/man-pages/man3/memset.3.html
- deleted 1y ago[deleted]
- naruhodo 1y agoIt will fill the screen with any of 256 shades of grey, for which r == g == b.
- darccio 1y agoNeato! It's nice to find zserge around. He built upon the idea of my static site generator Zas [0] to create his own zs [1][2] a few years ago. I think he's still using it :) [0]: https://github.com/darccio/zas https://github.com/darccio/zas [1]: https://github.com/zserge/zs https://github.com/zserge/zs [2]: https://zserge.com/posts/new-site-generator2/ https://zserge.com/posts/new-site-generator2/