Set opacity of image sub region

univrsal

Member
Hey there,

I currently have an image file that's loaded and drawn with gs_draw_sprite_subregion and now I need a way to set the opacity. I that the color correction filter offers an option to change the opacity, but I don't really know how to carry that over into my custom source.
So I'm basically looking for a way to change the opacity in a situation like this:
C++:
inline void input_history_source::render(gs_effect_t* effect)
{
    gs_effect_set_texture(gs_effect_get_param_by_name(effect, "image"),
        m_image_file->texture);
        
    gs_matrix_push();
    gs_matrix_translate3f(pos->x, pos->y, 1.f);
    gs_draw_sprite_subregion(m_image_file->texture, 0, m_icon.u,
        m_icon.v, m_icon_w + 1, m_icon_h + 1);
    /* Set opacity here or before the draw call */
    gs_matrix_pop();
}
Maybe anyone knows a way of doing that.
 
Top