SBgl 0.1.0
A graphics framework in C99
Loading...
Searching...
No Matches
linux_internal.h
Go to the documentation of this file.
1#ifndef LINUX_INTERNAL_H
2#define LINUX_INTERNAL_H
3
4#include "sbgl_types.h"
5#include "core/sbgl_input.h"
6#include <stdint.h>
7
8#include <stdbool.h>
9
10#ifdef SBGL_PLATFORM_WAYLAND
11#include <wayland-client.h>
12#include "xdg-shell-client-protocol.h"
13#include "pointer-constraints-unstable-v1-client-protocol.h"
14#include "relative-pointer-unstable-v1-client-protocol.h"
15
19struct sbgl_Window {
20 struct wl_display* display;
21 struct wl_compositor* compositor;
22 struct xdg_wm_base* wm_base;
23 struct wl_seat* seat;
24 struct wl_surface* surface;
25 struct xdg_surface* xdg_surface;
26 struct xdg_toplevel* xdg_toplevel;
27 struct zwp_pointer_constraints_v1* pointer_constraints;
28 struct zwp_locked_pointer_v1* locked_pointer;
29 struct zwp_relative_pointer_manager_v1* relative_pointer_manager;
30 struct zwp_relative_pointer_v1* relative_pointer;
32 uint32_t pointer_serial;
33 bool shouldClose;
34 bool resized;
35 bool focused;
36 bool cursor_visible;
37 int width, height;
38};
39
40void linux_init_input(struct wl_registry* registry, uint32_t name, uint32_t version, sbgl_Window* window);
41
42extern const struct wl_keyboard_listener keyboard_listener;
43extern const struct wl_pointer_listener pointer_listener;
44#else
45#include <X11/Xlib.h>
46
60
61void x11_internal_process_event(XEvent* event, struct sbgl_Window* window);
62#endif
63
64// Internal update function called by PollEvents
66
67#endif // LINUX_INTERNAL_H
void linux_init_input(struct wl_registry *registry, uint32_t name, uint32_t version, sbgl_Window *window)
const struct wl_pointer_listener pointer_listener
const struct wl_keyboard_listener keyboard_listener
void x11_internal_process_event(XEvent *event, struct sbgl_Window *window)
Definition input_x11.c:32
void linux_internal_update_input_states(struct sbgl_Window *window)
Internal Input Abstraction Layer (HAL).
Represents the real-time state of physical inputs.
Definition sbgl_input.h:165
Native X11 window state.
sbgl_InputState * input
Display * display