diff options
| author | kkard2 <[email protected]> | 2025-09-01 20:21:40 +0200 |
|---|---|---|
| committer | kkard2 <[email protected]> | 2025-09-01 20:21:40 +0200 |
| commit | 3e5a38dbf6bc785e73ce127dbd2d9566b2dbf1c2 (patch) | |
| tree | 99af90bd93168bb9b5c4337c1a0032de1174a5c6 /softrender.h | |
| parent | f33cd3a03ceaceda089e8ef658650e52a70938a4 (diff) | |
rename to sponge
Diffstat (limited to 'softrender.h')
| -rw-r--r-- | softrender.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/softrender.h b/softrender.h deleted file mode 100644 index e417ab2..0000000 --- a/softrender.h +++ /dev/null @@ -1,35 +0,0 @@ -#include <stdint.h> - -typedef struct { - // TODO(kard): define byte order - uint32_t *pixels; - uint32_t width; - uint32_t height; - uint32_t stride; -} soft_Canvas; - -void soft_clear(soft_Canvas c, uint32_t color); -void soft_draw_rect(soft_Canvas c, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t color); - -// TODO(kard): prefix stripping - -#ifdef SOFTRENDER_IMPLEMENTATION - -void soft_clear(soft_Canvas c, uint32_t color) { - soft_draw_rect(c, 0, 0, c.width - 1, c.height - 1, color); -} - -// TODO(kard): probably bounds checking -// TODO(kard): alpha blending maybe -void soft_draw_rect(soft_Canvas c, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t color) { - uint32_t *row = c.pixels + (y0 * c.stride); - - for (uint32_t y = y0; y <= y1; y++, row += c.stride) { - for (uint32_t x = x0; x <= x1; x++) { - row[x] = color; - } - } -} - -#endif // SOFTRENDER_IMPLEMENTATION - |
