diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-09 11:32:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-09 11:32:02 -0400 |
commit | df378d32740495d33dc46e799a547adc9b9620e1 (patch) | |
tree | 969d1e4d3d557cdeaa6544ebf3ffd7b4579d5fbd /examples/compositor/main.c | |
parent | 6345d6deeda014b8a95ef4a40eef938b552ff153 (diff) | |
parent | fb58307a5006366e791c96491f855777a11fdf2c (diff) |
Merge pull request #50 from nyorain/wl_surface
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..8e5fcc34 100644 --- a/examples/compositor/main.c +++ b/examples/compositor/main.c @@ -10,6 +10,7 @@ #include <wlr/render.h> #include <wlr/render/gles2.h> #include <wlr/types/wlr_output.h> +#include <wlr/types/wlr_surface.h> #include <xkbcommon/xkbcommon.h> #include <wlr/util/log.h> #include "shared.h" @@ -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); } } |