summaryrefslogtreecommitdiff
path: root/fns.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-12-23 00:12:34 +0000
committerrodri <rgl@antares-labs.eu>2023-12-23 00:12:34 +0000
commitb34446e7025a15bd5b74fd5f88bb952028cc8a4a (patch)
treebb6e51e0c63bcf4f167936fd8e7991da2bbb1ac1 /fns.h
parentf69cd8f04bbe059ce21f0c7be93fd081495c6371 (diff)
downloadtinyrend-b34446e7025a15bd5b74fd5f88bb952028cc8a4a.tar.gz
tinyrend-b34446e7025a15bd5b74fd5f88bb952028cc8a4a.tar.bz2
tinyrend-b34446e7025a15bd5b74fd5f88bb952028cc8a4a.zip
organize the code better.
Diffstat (limited to 'fns.h')
-rw-r--r--fns.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/fns.h b/fns.h
new file mode 100644
index 0000000..6547c6c
--- /dev/null
+++ b/fns.h
@@ -0,0 +1,32 @@
+#define HZ2MS(hz) (1000/(hz))
+
+void resized(void);
+
+/* nanosec */
+uvlong nanosec(void);
+
+/* alloc */
+void *emalloc(ulong);
+void *erealloc(void*, ulong);
+Image *eallocimage(Display*, Rectangle, ulong, int, ulong);
+Memimage *eallocmemimage(Rectangle, ulong);
+
+/* fb */
+Framebuf *mkfb(Rectangle);
+Framebufctl *newfbctl(Rectangle);
+
+/* shadeop */
+double step(double, double);
+double smoothstep(double, double, double);
+
+/* util */
+int min(int, int);
+int max(int, int);
+double fmin(double, double);
+double fmax(double, double);
+void swap(int*, int*);
+void swappt2(Point2*, Point2*);
+void swappt3(Point3*, Point3*);
+void memsetd(double*, double, usize);
+Memimage *readtga(char*);
+Memimage *rgb(ulong);