aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-12-25 12:21:29 +0100
committerSimon Ser <contact@emersion.fr>2020-12-25 12:21:29 +0100
commitb9460ab724fb8df18d22cb0e10cf6e07646fc1cf (patch)
tree0ec73b0989d250debb08d6576c2477c104e28284 /examples
parentae5275c09fbd2cce326dee2b6d13fd8b9cdc08aa (diff)
Stop using wlr_texture_get_size
Just use wlr_texture.{width,height} directly.
Diffstat (limited to 'examples')
-rw-r--r--examples/touch.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/touch.c b/examples/touch.c
index 3d18dfd0..7f8980e1 100644
--- a/examples/touch.c
+++ b/examples/touch.c
@@ -78,13 +78,10 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
wlr_renderer_begin(sample->renderer, wlr_output->width, wlr_output->height);
wlr_renderer_clear(sample->renderer, (float[]){0.25f, 0.25f, 0.25f, 1});
- int tex_width, tex_height;
- wlr_texture_get_size(sample->cat_texture, &tex_width, &tex_height);
-
struct touch_point *p;
wl_list_for_each(p, &sample->touch_points, link) {
- int x = (int)(p->x * width) - tex_width / 2;
- int y = (int)(p->y * height) - tex_height / 2;
+ int x = (int)(p->x * width) - sample->cat_texture->width / 2;
+ int y = (int)(p->y * height) - sample->cat_texture->height / 2;
wlr_render_texture(sample->renderer, sample->cat_texture,
wlr_output->transform_matrix, x, y, 1.0f);
}