summaryrefslogtreecommitdiff
path: root/fbgl.h
diff options
context:
space:
mode:
authordario-loi <loi.1940849@studenti.uniroma1.it>2024-11-24 20:21:45 +0100
committerdario-loi <loi.1940849@studenti.uniroma1.it>2024-11-24 20:21:45 +0100
commita3bfd065071e2dd4e772fae9da7908ce523148c6 (patch)
tree68b062d79a1b5e59c2bcba2ca8df1cef9852f656 /fbgl.h
parent274cacc5fadb3c3a220b833f027eee47cbda824c (diff)
parentcd0a47245a54c249eca7ef1c0d86bc4aa3489e9b (diff)
Merge branch 'master' into bugfixes
Diffstat (limited to 'fbgl.h')
-rw-r--r--fbgl.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/fbgl.h b/fbgl.h
index 75abb6f..84ce454 100644
--- a/fbgl.h
+++ b/fbgl.h
@@ -161,10 +161,6 @@ void fbgl_clear(uint32_t color);
void fbgl_put_pixel(int x, int y, uint32_t color, fbgl_t *fb);
void fbgl_draw_line(fbgl_point_t x, fbgl_point_t y, uint32_t color, fbgl_t *fb);
-/**
- * Display methods
- */
-void fbgl_display(void);
/**
* Access framebuffer data methods
@@ -291,14 +287,14 @@ void fbgl_set_bg(fbgl_t *fb, uint32_t color)
#endif // DEBUG
// Fill the entire framebuffer with the specified color
- for (uint32_t i = 0; i < fb->width * fb->height; i++) {
+ for (int32_t i = 0; i < fb->width * fb->height; i++) {
fb->pixels[i] = color;
}
}
void fbgl_put_pixel(int x, int y, uint32_t color, fbgl_t *fb)
{
-#ifdef DEBUG
+#ifdef FBGL_VALIDATE_PUT_PIXEL
if (!fb || !fb->pixels) {
fprintf(stderr, "Error: framebuffer not initialized.\n");
return;
@@ -307,7 +303,7 @@ void fbgl_put_pixel(int x, int y, uint32_t color, fbgl_t *fb)
if (x < 0 || x >= fb->width || y < 0 || y >= fb->height) {
return; // Ignore out-of-bound coordinates
}
-#endif // DEBUG
+#endif // FBGL_VALIDATE_PUT_PIXEL
const size_t index = y * fb->width + x;
fb->pixels[index] = color;