diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-03-22 20:06:53 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-03-22 20:06:53 -0400 |
commit | 30b8fb5572cd59c096b00a26c7a41cd674e9337b (patch) | |
tree | 2a7de55685259200422f2bf23cab909fa788db54 /examples/output-layout.c | |
parent | 8836b167bf0ff152de951f7fdabb1deae85f6e93 (diff) | |
parent | 77d3be66eaabca4309794536984c54a5e94e9eb5 (diff) |
Merge branch 'master' into xdg-positioner
Diffstat (limited to 'examples/output-layout.c')
-rw-r--r-- | examples/output-layout.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/examples/output-layout.c b/examples/output-layout.c index 45257be9..45d896b0 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -1,29 +1,29 @@ #define _POSIX_C_SOURCE 199309L #define _XOPEN_SOURCE 700 +#include <GLES2/gl2.h> +#include <limits.h> +#include <math.h> #include <stdio.h> #include <stdlib.h> -#include <time.h> #include <string.h> #include <strings.h> +#include <time.h> #include <unistd.h> -#include <limits.h> -#include <wayland-server.h> #include <wayland-server-protocol.h> -#include <xkbcommon/xkbcommon.h> -#include <GLES2/gl2.h> -#include <wlr/render/matrix.h> -#include <wlr/render/gles2.h> -#include <wlr/render.h> -#include <wlr/util/log.h> +#include <wayland-server.h> #include <wlr/backend.h> #include <wlr/backend/session.h> +#include <wlr/render/gles2.h> +#include <wlr/render/wlr_renderer.h> +#include <wlr/types/wlr_keyboard.h> +#include <wlr/types/wlr_matrix.h> #include <wlr/types/wlr_output_layout.h> #include <wlr/types/wlr_output.h> -#include <wlr/types/wlr_keyboard.h> -#include <math.h> -#include "support/shared.h" -#include "support/config.h" +#include <wlr/util/log.h> +#include <xkbcommon/xkbcommon.h> #include "support/cat.h" +#include "support/config.h" +#include "support/shared.h" struct sample_state { struct example_config *config; @@ -101,8 +101,8 @@ static void handle_output_frame(struct output_state *output, struct wlr_output *wlr_output = output->output; wlr_output_make_current(wlr_output, NULL); - wlr_renderer_begin(sample->renderer, wlr_output); - wlr_renderer_clear(sample->renderer, &(float[]){0.25f, 0.25f, 0.25f, 1}); + wlr_renderer_begin(sample->renderer, wlr_output->width, wlr_output->height); + wlr_renderer_clear(sample->renderer, (float[]){0.25f, 0.25f, 0.25f, 1}); animate_cat(sample, output->output); @@ -111,18 +111,14 @@ static void handle_output_frame(struct output_state *output, .width = 128, .height = 128, }; if (wlr_output_layout_intersects(sample->layout, output->output, &box)) { - float matrix[16]; - // transform global coordinates to local coordinates double local_x = sample->x_offs; double local_y = sample->y_offs; wlr_output_layout_output_coords(sample->layout, output->output, &local_x, &local_y); - wlr_texture_get_matrix(sample->cat_texture, &matrix, - &wlr_output->transform_matrix, local_x, local_y); - wlr_render_with_matrix(sample->renderer, - sample->cat_texture, &matrix, 1.0f); + wlr_render_texture(sample->renderer, sample->cat_texture, + wlr_output->transform_matrix, local_x, local_y, 1.0f); } wlr_renderer_end(sample->renderer); |