Have backend manage opengl context

This commit is contained in:
Drew DeVault 2017-05-31 15:15:42 -04:00
parent 66e02e97ec
commit 03c9b46034
3 changed files with 16 additions and 25 deletions

View file

@ -24,9 +24,7 @@ struct output_state {
};
void output_frame(struct wl_listener *listener, void *data) {
struct wlr_output *output = data;
struct output_state *ostate = wl_container_of(
listener, ostate, frame);
struct output_state *ostate = wl_container_of(listener, ostate, frame);
struct state *s = ostate->state;
struct timespec now;
@ -48,12 +46,8 @@ void output_frame(struct wl_listener *listener, void *data) {
s->last_frame = now;
wlr_drm_output_begin(output);
glClearColor(s->color[0], s->color[1], s->color[2], 1.0);
glClear(GL_COLOR_BUFFER_BIT);
wlr_drm_output_end(output);
}
void output_add(struct wl_listener *listener, void *data) {