diff options
author | emersion <contact@emersion.fr> | 2018-03-15 19:31:02 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-15 19:31:02 +0100 |
commit | 876f07e9f13946609047e8e32ca7918548315e1c (patch) | |
tree | 07fe534708d37ffa146a6631445cf57d19e931fb /render/wlr_renderer.c | |
parent | 1914a1aa2b4f3c5678bbbf7d734352a6f51bec58 (diff) |
renderer: replace wlr_texture_get_matrix by wlr_render_texture
Diffstat (limited to 'render/wlr_renderer.c')
-rw-r--r-- | render/wlr_renderer.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index e847fcc2..c4f91d5e 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -1,6 +1,7 @@ #include <stdbool.h> #include <stdlib.h> #include <wlr/render/interface.h> +#include <wlr/types/wlr_matrix.h> void wlr_renderer_init(struct wlr_renderer *renderer, struct wlr_renderer_impl *impl) { @@ -35,6 +36,17 @@ struct wlr_texture *wlr_render_texture_create(struct wlr_renderer *r) { return r->impl->texture_create(r); } +bool wlr_render_texture(struct wlr_renderer *r, struct wlr_texture *texture, + const float projection[static 9], int x, int y, float alpha) { + float mat[9]; + wlr_matrix_identity(mat); + wlr_matrix_translate(mat, x, y); + wlr_matrix_scale(mat, texture->width, texture->height); + wlr_matrix_multiply(mat, projection, mat); + + return wlr_render_texture_with_matrix(r, texture, mat, alpha); +} + bool wlr_render_texture_with_matrix(struct wlr_renderer *r, struct wlr_texture *texture, const float matrix[static 9], float alpha) { |