summaryrefslogtreecommitdiff
path: root/fbgl.h
diff options
context:
space:
mode:
authordario-loi <loi.1940849@studenti.uniroma1.it>2024-11-24 20:13:23 +0100
committerdario-loi <loi.1940849@studenti.uniroma1.it>2024-11-24 20:13:23 +0100
commitcd0a47245a54c249eca7ef1c0d86bc4aa3489e9b (patch)
treec6c1b2e0471c5dfbfce2add70dbb894bf2b4649c /fbgl.h
parente416c072833477d1e50a036414100f7b75d5e1be (diff)
parentff43c66c491b443b7522a3b3d716905ee9732b60 (diff)
Merge branch 'master' of https://github.com/dario-loi/fbgl
Diffstat (limited to 'fbgl.h')
-rw-r--r--fbgl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/fbgl.h b/fbgl.h
index 0f108fc..6b2b3f0 100644
--- a/fbgl.h
+++ b/fbgl.h
@@ -296,6 +296,7 @@ void fbgl_set_bg(fbgl_t *fb, uint32_t color)
void fbgl_put_pixel(int x, int y, uint32_t color, fbgl_t *fb)
{
+#ifdef FBGL_VALIDATE_PUT_PIXEL
if (!fb || !fb->pixels) {
fprintf(stderr, "Error: framebuffer not initialized.\n");
return;
@@ -304,7 +305,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 // FBGL_VALIDATE_PUT_PIXEL
size_t index = y * fb->width + x;
fb->pixels[index] = color;
}
@@ -685,4 +686,4 @@ AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------
-*/ \ No newline at end of file
+*/