mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
Clean up Wayland backend GL context and such
This commit is contained in:
parent
51f35e7af0
commit
c9d5a0b2fb
8 changed files with 48 additions and 44 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#include <wayland-server.h>
|
||||
#include <wayland-server-protocol.h>
|
||||
|
|
@ -193,22 +194,23 @@ static void parse_args(int argc, char *argv[], struct wl_list *config) {
|
|||
|
||||
int main(int argc, char *argv[]) {
|
||||
struct sample_state state = { 0 };
|
||||
struct compositor_state compositor;
|
||||
wl_list_init(&state.config);
|
||||
parse_args(argc, argv, &state.config);
|
||||
|
||||
struct compositor_state compositor = { 0,
|
||||
.data = &state,
|
||||
.output_add_cb = handle_output_add,
|
||||
.output_remove_cb = handle_output_remove,
|
||||
.output_frame_cb = handle_output_frame,
|
||||
.keyboard_key_cb = handle_keyboard_key,
|
||||
};
|
||||
compositor_init(&compositor);
|
||||
compositor.output_add_cb = handle_output_add;
|
||||
compositor.output_remove_cb = handle_output_remove;
|
||||
compositor.output_frame_cb = handle_output_frame;
|
||||
compositor.keyboard_key_cb = handle_keyboard_key;
|
||||
|
||||
state.renderer = wlr_gles3_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);
|
||||
|
||||
compositor.data = &state;
|
||||
compositor_run(&compositor);
|
||||
|
||||
wlr_surface_destroy(state.cat_texture);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue