summaryrefslogtreecommitdiff
path: root/fbgl.h
diff options
context:
space:
mode:
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
+*/