aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-03-26 22:44:38 +0200
committerkdx <kikoodx@paranoici.org>2023-03-26 22:44:44 +0200
commit8b92076145893cfdaf3e648e0324b163c1a6d28e (patch)
tree8848fe3d5cfca371335bdd0082a0120ee6eb2e1b
parenteb741d4dc4fbd9f2ad0fbd0193df7d1fceb35c94 (diff)
downloadtzr-8b92076145893cfdaf3e648e0324b163c1a6d28e.tar.gz
optional paranoid nodiscard
-rw-r--r--headers/TZR_render.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/headers/TZR_render.h b/headers/TZR_render.h
index b3f2ba3..2ba0b3c 100644
--- a/headers/TZR_render.h
+++ b/headers/TZR_render.h
@@ -15,25 +15,35 @@ int TZR_DrawEnd(void);
/* Return -1 on error. */
#define TZR_DrawSetColor(...) _TZR_DrawSetColor(&(const TZR_Color){ \
.r=-1.0f, .g=-1.0f, .b=-1.0f, .a=-1.0f, ._=0, __VA_ARGS__ })
+#ifdef TZR_PARANOID
[[nodiscard]]
+#endif
int _TZR_DrawSetColor(const TZR_Color *color);
/* Return -1 on error. */
+#ifdef TZR_PARANOID
[[nodiscard]]
+#endif
int TZR_DrawClear(void);
/* Return -1 on error. Draw point on `x`;`y` in the framebuffer. */
+#ifdef TZR_PARANOID
[[nodiscard]]
+#endif
int TZR_DrawPoint(int x, int y);
/* Return -1 on error. Draw line between `x0`;`y0` and `x1`;`y1` in the
* framebuffer. */
+#ifdef TZR_PARANOID
[[nodiscard]]
+#endif
int TZR_DrawLine(int x0, int y0, int x1, int y1);
/* Return -1 on error. Draw rectangle at `x`;`y` position of size `w`x`h` in the
* framebuffer. */
+#ifdef TZR_PARANOID
[[nodiscard]]
+#endif
int TZR_DrawRectangle(bool fill, int x, int y, int w, int h);
/* Return -1 on error. Draw texture ressource `id` at `x`;`y` position of
@@ -41,5 +51,7 @@ int TZR_DrawRectangle(bool fill, int x, int y, int w, int h);
#define TZR_DrawImage(...) _TZR_DrawImage(&(const TZR_DrawImageArgs){ \
.x=0, .y=0, .ix=0, .iy=0, .w=INT_MIN, .h=INT_MIN, .r=0.0f, .sx=1.0f, \
.sy=1.0f, .center=false, ._=0, __VA_ARGS__ })
+#ifdef TZR_PARANOID
[[nodiscard]]
+#endif
int _TZR_DrawImage(const TZR_DrawImageArgs *args);