diff options
author | nyorain <nyorain@gmail.com> | 2017-08-09 15:33:30 +0200 |
---|---|---|
committer | nyorain <nyorain@gmail.com> | 2017-08-09 17:26:05 +0200 |
commit | 8473c3955cb8469c5f999410f68a3b3d3e6bee18 (patch) | |
tree | aa4e694d8ddc66eba460f384a5cead619e687a0c /examples/compositor/main.c | |
parent | 6345d6deeda014b8a95ef4a40eef938b552ff153 (diff) |
Add first wlr_surface example implementation
Diffstat (limited to 'examples/compositor/main.c')
-rw-r--r-- | examples/compositor/main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/compositor/main.c b/examples/compositor/main.c index 6afdb391..01292f51 100644 --- a/examples/compositor/main.c +++ b/examples/compositor/main.c @@ -14,6 +14,7 @@ #include <wlr/util/log.h> #include "shared.h" #include "compositor.h" +#include "wlr_surface.h" struct sample_state { struct wlr_renderer *renderer; @@ -32,11 +33,11 @@ void handle_output_frame(struct output_state *output, struct timespec *ts) { struct wl_resource *_res; float matrix[16]; wl_list_for_each(_res, &sample->compositor.surfaces, link) { - struct wlr_texture *texture = wl_resource_get_user_data(_res); - if (texture->valid) { - wlr_texture_get_matrix(texture, &matrix, + struct wlr_surface *surface = wl_resource_get_user_data(_res); + if (surface->texture->valid) { + wlr_texture_get_matrix(surface->texture, &matrix, &wlr_output->transform_matrix, 200, 200); - wlr_render_with_matrix(sample->renderer, texture, &matrix); + wlr_render_with_matrix(sample->renderer, surface->texture, &matrix); } } |