diff options
Diffstat (limited to 'include/egl.h')
-rw-r--r-- | include/egl.h | 58 |
1 files changed, 7 insertions, 51 deletions
diff --git a/include/egl.h b/include/egl.h index 82014b9..8a2b6c2 100644 --- a/include/egl.h +++ b/include/egl.h @@ -10,6 +10,8 @@ #include "vec2.h" #include "defs.h" +typedef struct gsr_window gsr_window; + #ifdef _WIN64 typedef signed long long int khronos_intptr_t; typedef unsigned long long int khronos_uintptr_t; @@ -102,11 +104,13 @@ typedef void(*__GLXextFuncPtr)(void); #define GL_RG 0x8227 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 +#define GL_RGB8 0x8051 #define GL_RGBA8 0x8058 #define GL_R8 0x8229 #define GL_RG8 0x822B #define GL_R16 0x822A #define GL_RG16 0x822C +#define GL_RGB16 0x8054 #define GL_UNSIGNED_BYTE 0x1401 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_TEXTURE_WRAP_S 0x2802 @@ -131,6 +135,7 @@ typedef void(*__GLXextFuncPtr)(void); #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 #define GL_COMPILE_STATUS 0x8B81 #define GL_INFO_LOG_LENGTH 0x8B84 @@ -151,54 +156,11 @@ typedef int (*FUNC_eglQueryDisplayAttribEXT)(EGLDisplay dpy, int32_t attribute, typedef const char* (*FUNC_eglQueryDeviceStringEXT)(void *device, int32_t name); typedef int (*FUNC_eglQueryDmaBufModifiersEXT)(EGLDisplay dpy, int32_t format, int32_t max_modifiers, uint64_t *modifiers, int *external_only, int32_t *num_modifiers); -#define GSR_MAX_OUTPUTS 32 - -typedef struct { - char *name; - vec2i pos; - vec2i size; - uint32_t connector_id; - gsr_monitor_rotation rotation; - uint32_t monitor_identifier; /* crtc id */ -} gsr_x11_output; - -typedef struct { - Display *dpy; - Window window; - gsr_x11_output outputs[GSR_MAX_OUTPUTS]; - int num_outputs; - XEvent xev; -} gsr_x11; - -typedef struct { - uint32_t wl_name; - void *output; - vec2i pos; - vec2i size; - int32_t transform; - char *name; -} gsr_wayland_output; - -typedef struct { - void *dpy; - void *window; - void *registry; - void *surface; - void *compositor; - gsr_wayland_output outputs[GSR_MAX_OUTPUTS]; - int num_outputs; -} gsr_wayland; - typedef enum { GSR_GL_CONTEXT_TYPE_EGL, GSR_GL_CONTEXT_TYPE_GLX } gsr_gl_context_type; -typedef enum { - GSR_DISPLAY_SERVER_X11, - GSR_DISPLAY_SERVER_WAYLAND -} gsr_display_server; - typedef struct gsr_egl gsr_egl; struct gsr_egl { void *egl_library; @@ -206,6 +168,7 @@ struct gsr_egl { void *gl_library; gsr_gl_context_type context_type; + gsr_window *window; EGLDisplay egl_display; EGLSurface egl_surface; @@ -217,8 +180,6 @@ struct gsr_egl { gsr_gpu_info gpu_info; - gsr_x11 x11; - gsr_wayland wayland; char card_path[128]; int32_t (*eglGetError)(void); @@ -318,15 +279,10 @@ struct gsr_egl { unsigned char (*glUnmapBuffer)(unsigned int target); }; -bool gsr_egl_load(gsr_egl *self, Display *dpy, bool wayland, bool is_monitor_capture); +bool gsr_egl_load(gsr_egl *self, gsr_window *window, bool is_monitor_capture, bool enable_debug); void gsr_egl_unload(gsr_egl *self); -/* Returns true if an event is available */ -bool gsr_egl_process_event(gsr_egl *self); /* Does opengl swap with egl or glx, depending on which one is active */ void gsr_egl_swap_buffers(gsr_egl *self); -gsr_display_server gsr_egl_get_display_server(const gsr_egl *self); -XEvent* gsr_egl_get_event_data(gsr_egl *self); - #endif /* GSR_EGL_H */ |