aboutsummaryrefslogtreecommitdiff
path: root/example/rotation.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/rotation.c')
-rw-r--r--example/rotation.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/example/rotation.c b/example/rotation.c
index b8c43d4c..2dd148d0 100644
--- a/example/rotation.c
+++ b/example/rotation.c
@@ -46,6 +46,7 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
int32_t width, height;
wlr_output_effective_resolution(wlr_output, &width, &height);
+ wlr_output_make_current(wlr_output);
wlr_renderer_begin(sample->renderer, wlr_output);
float matrix[16];
@@ -59,6 +60,7 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
}
wlr_renderer_end(sample->renderer);
+ wlr_output_swap_buffers(wlr_output);
long ms = (ts->tv_sec - output->last_frame.tv_sec) * 1000 +
(ts->tv_nsec - output->last_frame.tv_nsec) / 1000000;
@@ -205,7 +207,7 @@ int main(int argc, char *argv[]) {
state.renderer = wlr_gles2_renderer_init();
state.cat_texture = wlr_render_surface_init(state.renderer);
wlr_surface_attach_pixels(state.cat_texture, GL_RGBA,
- cat_tex.width, cat_tex.height, cat_tex.pixel_data);
+ cat_tex.width, cat_tex.width, cat_tex.height, cat_tex.pixel_data);
compositor_run(&compositor);