diff options
author | Guido Günther <agx@sigxcpu.org> | 2018-02-21 23:20:09 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2018-02-25 13:47:48 +0100 |
commit | d08792bfffc6b7b28f59d7ee100091805367b7fa (patch) | |
tree | 33c514b2e9f70be4980614717093029f675fc7fd /render/gles2/renderer.c | |
parent | e6ca78b0e4b81e02958628c4b3b4db911b51714b (diff) |
Add alpha to wlr_render_with_matrix
so we can use the alpha channel to e.g. blend in textures
Diffstat (limited to 'render/gles2/renderer.c')
-rw-r--r-- | render/gles2/renderer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 81a932e6..ad739cf8 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -171,7 +171,7 @@ static void draw_quad() { } static bool wlr_gles2_render_texture(struct wlr_renderer *wlr_renderer, - struct wlr_texture *texture, const float (*matrix)[16]) { + struct wlr_texture *texture, const float (*matrix)[16], float alpha) { if (!texture || !texture->valid) { wlr_log(L_ERROR, "attempt to render invalid texture"); return false; @@ -179,12 +179,12 @@ static bool wlr_gles2_render_texture(struct wlr_renderer *wlr_renderer, wlr_texture_bind(texture); GL_CALL(glUniformMatrix4fv(0, 1, GL_FALSE, *matrix)); - // TODO: source alpha from somewhere else I guess - GL_CALL(glUniform1f(2, 1.0f)); + GL_CALL(glUniform1f(2, alpha)); draw_quad(); return true; } + static void wlr_gles2_render_quad(struct wlr_renderer *wlr_renderer, const float (*color)[4], const float (*matrix)[16]) { GL_CALL(glUseProgram(shaders.quad)); |