aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/recorder
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2026-08-01 21:22:04 +0200
committerdec05eba <dec05eba@protonmail.com>2026-08-01 21:22:04 +0200
commitcdb8493eed42c386919280b17bbd31b713a5ac35 (patch)
tree54310e33f809ca248b9af6e00a4944a05a1edd19 /include/recorder
parentd02955183135dbc72072492cdfcb35f2387e2c00 (diff)
Move windowing setup from main.cpp into windowing module
The recording path and the list commands now share the same windowing setup code instead of duplicating it.
Diffstat (limited to 'include/recorder')
-rw-r--r--include/recorder/windowing.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/recorder/windowing.h b/include/recorder/windowing.h
new file mode 100644
index 0000000..6bc5f5f
--- /dev/null
+++ b/include/recorder/windowing.h
@@ -0,0 +1,34 @@
+#ifndef GSR_RECORDER_WINDOWING_H
+#define GSR_RECORDER_WINDOWING_H
+
+#include <stdbool.h>
+#include "../defs.h"
+#include "../egl.h"
+
+#include <X11/Xlib.h>
+
+typedef struct {
+ bool monitor_capture;
+ bool gl_debug;
+ bool listen_to_x11_events;
+} gsr_windowing_params;
+
+typedef struct {
+ Display *display;
+ gsr_window *window;
+ gsr_egl egl;
+ bool egl_loaded;
+ bool card_path_found;
+} gsr_windowing;
+
+/* Returns a |gsr_error| value. Connects to the display server and creates a window */
+int gsr_windowing_init(gsr_windowing *self, const gsr_windowing_params *params);
+/* Returns a |gsr_error| value. Loads opengl and finds the drm card to use */
+int gsr_windowing_load_egl(gsr_windowing *self, const gsr_windowing_params *params);
+bool gsr_windowing_is_wayland(const gsr_windowing *self);
+
+bool gsr_windowing_is_using_prime_run(void);
+void gsr_windowing_disable_prime_run(void);
+bool monitor_capture_use_drm(const gsr_window *window, gsr_gpu_vendor vendor);
+
+#endif /* GSR_RECORDER_WINDOWING_H */