diff libcore/core/texture.h @ 184:c92957c3b82b

core: add texture_set_(alpha|color)_mod functions Apply either an alpha transparency modulation or a color on the texture.
author David Demelier <markand@malikania.fr>
date Mon, 02 Nov 2020 18:35:44 +0100
parents 5d1b7d123401
children f37b8e95aaaa
line wrap: on
line diff
--- a/libcore/core/texture.h	Mon Nov 02 13:42:51 2020 +0100
+++ b/libcore/core/texture.h	Mon Nov 02 18:35:44 2020 +0100
@@ -65,6 +65,26 @@
 texture_ok(const struct texture *tex);
 
 /**
+ * Apply an alpha modulation (aka transparency).
+ *
+ * \pre texture_ok(tex)
+ * \param tex the texture
+ * \param alpha the alpha (0-255)
+ */
+bool
+texture_set_alpha_mod(struct texture *tex, unsigned int alpha);
+
+/**
+ * Apply a color modulation (for every pixel).
+ *
+ * \pre texture_ok(tex)
+ * \param tex the texture to modify
+ * \param color the color
+ */
+bool
+texture_set_color_mod(struct texture *tex, unsigned long color);
+
+/**
  * Simple texture drawing.
  *
  * \pre tex != NULL