aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2021-12-09 17:36:54 +0100
committerDrew DeVault <sir@cmpwn.com>2021-12-09 17:36:54 +0100
commit35b7fbd12bc11fd5aac6c4c509ea0990735ab0b1 (patch)
treeb189df497bba98dac138ea4ef9c8ecd956e16ace
parentcmd/demo: change background on controller button (diff)
downloadhare-chip8-35b7fbd12bc11fd5aac6c4c509ea0990735ab0b1.tar.gz
Add sdl2::set_texture_color_mod
-rw-r--r--sdl2/render.ha15
1 files changed, 15 insertions, 0 deletions
diff --git a/sdl2/render.ha b/sdl2/render.ha
index d4f0671..5bf1b09 100644
--- a/sdl2/render.ha
+++ b/sdl2/render.ha
@@ -79,6 +79,21 @@ export @symbol("SDL_QueryTexture") fn query_texture(texture: *texture,
format: nullable *u32, access: nullable *int,
w: nullable *int, h: nullable *int) int;
+// Set an additional color value multiplied into render copy operations.
+//
+// When this texture is rendered, during the copy operation each source color
+// channel is modulated by the appropriate color value according to the
+// following formula:
+//
+// srcC = srcC * (color / 255)
+//
+// Color modulation is not always supported by the renderer; it will return -1
+// if color modulation is not supported.
+//
+// Returns 0 on success or a negative error code on failure.
+export @symbol("SDL_SetTextureColorMod") fn set_texture_color_mod(
+ texture: *texture, r: u8, g: u8, b: u8) int;
+
// Copy a portion of the texture to the current rendering target.
//
// Returns 0 on success, or -1 on error