diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-06-30 22:23:08 +0200 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-06-30 22:29:30 +0200 |
commit | 87c8428df0bf1b2f6932bb16390f69be57e21f6b (patch) | |
tree | 0cc0f7cab79a0373ef366898df8f5773391bae17 /src/window.h |
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'src/window.h')
-rw-r--r-- | src/window.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h new file mode 100644 index 0000000..36e32a2 --- /dev/null +++ b/src/window.h @@ -0,0 +1,35 @@ +#ifndef _WINDOW_H_ +#define _WINDOW_H_ + +#include <stdint.h> +#include <stdbool.h> +#include <vulkan/vulkan.h> + +#include <wayland-client.h> +#include "xdg-shell-protocol.h" +#include "xdg-decoration-unstable-v1-protocol.h" + +struct vlkn_window { + const char *title; + + struct wl_display *dpy; + struct wl_registry *reg; + struct wl_compositor *comp; + struct zxdg_decoration_manager_v1 *deco_manager; + struct zxdg_toplevel_decoration_v1 *deco; + struct wl_surface *surface; + struct xdg_wm_base *xdg_base; + struct xdg_surface *xdg_surface; + struct xdg_toplevel *xdg_toplevel; + + int32_t width, height; + bool resize, should_close; + + void *data; + void (*on_resize)(void *data); +}; + +void window_on_resize(struct vlkn_window *win, void (*callback)(void *data), void *data); +VkSurfaceKHR window_create_vk_surface(VkInstance instance, struct vlkn_window *win); + +#endif |