aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-09 09:38:48 -0500
committerGitHub <noreply@github.com>2018-02-09 09:38:48 -0500
commit34489dca16ef9e7fd05c161b8b4f2fd5ce5e4ef0 (patch)
tree2a90beb98aacd85bbc5bd30df998b4e7c92ec3e7 /examples
parent09c2626e32fd0eadc4b95a4f36b34f6bde79f6f4 (diff)
parentcdd55b5d19470981ad71f8e6d31bd8152e44364b (diff)
Merge pull request #571 from emersion/output-damage
Output damage tracking
Diffstat (limited to 'examples')
-rw-r--r--examples/multi-pointer.c4
-rw-r--r--examples/output-layout.c5
-rw-r--r--examples/pointer.c4
-rw-r--r--examples/rotation.c5
-rw-r--r--examples/simple.c4
-rw-r--r--examples/tablet.c5
-rw-r--r--examples/touch.c5
7 files changed, 18 insertions, 14 deletions
diff --git a/examples/multi-pointer.c b/examples/multi-pointer.c
index 62aa1bac..d3d425f2 100644
--- a/examples/multi-pointer.c
+++ b/examples/multi-pointer.c
@@ -56,13 +56,13 @@ static void handle_output_frame(struct output_state *output,
struct sample_state *sample = state->data;
struct wlr_output *wlr_output = output->output;
- wlr_output_make_current(wlr_output);
+ wlr_output_make_current(wlr_output, NULL);
glClearColor(sample->clear_color[0], sample->clear_color[1],
sample->clear_color[2], sample->clear_color[3]);
glClear(GL_COLOR_BUFFER_BIT);
- wlr_output_swap_buffers(wlr_output);
+ wlr_output_swap_buffers(wlr_output, NULL, NULL);
}
static void handle_output_add(struct output_state *ostate) {
diff --git a/examples/output-layout.c b/examples/output-layout.c
index 35ed22a8..91ab80f4 100644
--- a/examples/output-layout.c
+++ b/examples/output-layout.c
@@ -100,8 +100,9 @@ static void handle_output_frame(struct output_state *output,
struct sample_state *sample = state->data;
struct wlr_output *wlr_output = output->output;
- wlr_output_make_current(wlr_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});
animate_cat(sample, output->output);
@@ -125,7 +126,7 @@ static void handle_output_frame(struct output_state *output,
}
wlr_renderer_end(sample->renderer);
- wlr_output_swap_buffers(wlr_output);
+ wlr_output_swap_buffers(wlr_output, NULL, NULL);
}
static void handle_output_add(struct output_state *ostate) {
diff --git a/examples/pointer.c b/examples/pointer.c
index 9894e311..0dbd02d2 100644
--- a/examples/pointer.c
+++ b/examples/pointer.c
@@ -85,13 +85,13 @@ static void handle_output_frame(struct output_state *output,
struct sample_state *sample = state->data;
struct wlr_output *wlr_output = output->output;
- wlr_output_make_current(wlr_output);
+ wlr_output_make_current(wlr_output, NULL);
glClearColor(sample->clear_color[0], sample->clear_color[1],
sample->clear_color[2], sample->clear_color[3]);
glClear(GL_COLOR_BUFFER_BIT);
- wlr_output_swap_buffers(wlr_output);
+ wlr_output_swap_buffers(wlr_output, NULL, NULL);
}
static void handle_output_add(struct output_state *ostate) {
diff --git a/examples/rotation.c b/examples/rotation.c
index 6ec6b439..e390daaf 100644
--- a/examples/rotation.c
+++ b/examples/rotation.c
@@ -42,8 +42,9 @@ 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_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});
float matrix[16];
for (int y = -128 + (int)odata->y_offs; y < height; y += 128) {
@@ -56,7 +57,7 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
}
wlr_renderer_end(sample->renderer);
- wlr_output_swap_buffers(wlr_output);
+ wlr_output_swap_buffers(wlr_output, NULL, NULL);
long ms = (ts->tv_sec - output->last_frame.tv_sec) * 1000 +
(ts->tv_nsec - output->last_frame.tv_nsec) / 1000000;
diff --git a/examples/simple.c b/examples/simple.c
index 95c056c8..90808b0f 100644
--- a/examples/simple.c
+++ b/examples/simple.c
@@ -35,12 +35,12 @@ void handle_output_frame(struct output_state *output, struct timespec *ts) {
sample->dec = inc;
}
- wlr_output_make_current(output->output);
+ wlr_output_make_current(output->output, NULL);
glClearColor(sample->color[0], sample->color[1], sample->color[2], 1.0);
glClear(GL_COLOR_BUFFER_BIT);
- wlr_output_swap_buffers(output->output);
+ wlr_output_swap_buffers(output->output, NULL, NULL);
}
int main() {
diff --git a/examples/tablet.c b/examples/tablet.c
index f3cd5339..ca76ec5a 100644
--- a/examples/tablet.c
+++ b/examples/tablet.c
@@ -42,8 +42,9 @@ 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_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});
float matrix[16], view[16];
float distance = 0.8f * (1 - sample->distance);
@@ -76,7 +77,7 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
}
wlr_renderer_end(sample->renderer);
- wlr_output_swap_buffers(wlr_output);
+ wlr_output_swap_buffers(wlr_output, NULL, NULL);
}
static void handle_tool_axis(struct tablet_tool_state *tstate,
diff --git a/examples/touch.c b/examples/touch.c
index 4c1f97b6..3cf00e9c 100644
--- a/examples/touch.c
+++ b/examples/touch.c
@@ -41,8 +41,9 @@ 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_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});
float matrix[16];
struct touch_point *p;
@@ -56,7 +57,7 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
}
wlr_renderer_end(sample->renderer);
- wlr_output_swap_buffers(wlr_output);
+ wlr_output_swap_buffers(wlr_output, NULL, NULL);
}
static void handle_touch_down(struct touch_state *tstate, int32_t touch_id,