Added API functions for modulating the colour and alpha of a texture

This commit is contained in:
abdelrahman committed 2022-12-30 00:44:49 +00:00
1 parent b95cff5f0c
commit 24a86ba6e3
4 files changed
+41

No files matched your search

+28
View File
@@ -326,6 +326,34 @@ void render_texture_asset(AssetID id, RenderRect *src, RenderRect *dest) {
render_texture(GameEngine.window.renderer, texture, src, dest);
}
void modulate_texture_color(AssetID id, SDL_Color color) {
if (id < 0) {
return;
}
SDL_Texture *texture = get_texture(GameEngine.asset_manager, id);
if (!texture) {
return;
}
set_texture_color_modulation(texture, color);
}
void modulate_texture_alpha(AssetID id, u8 alpha) {
if (id < 0) {
return;
}
SDL_Texture *texture = get_texture(GameEngine.asset_manager, id);
if (!texture) {
return;
}
set_texture_alpha_modulation(texture, alpha);
}
TextSize get_text_size_from_font_asset(AssetID id, const char *text) {
TextSize output = {};