From 6e037ccc63cfc83ddda71824700ffa91ab9daab9 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Tue, 10 Feb 2026 16:46:07 +0100 Subject: dont need yet --- src/graphics.cc | 5 ----- src/graphics.h | 9 +++------ src/utils.h | 2 ++ src/wayclock.cc | 6 ------ 4 files changed, 5 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/graphics.cc b/src/graphics.cc index 3eddc74..eecab73 100644 --- a/src/graphics.cc +++ b/src/graphics.cc @@ -27,10 +27,6 @@ static EGLint WAYC_OGL_ATTRS[] = { EGL_NONE }; -static struct graphics_s WAYC_GRAPHICS_DUMMY = { - nullptr, nullptr, nullptr -}; - /* clang-format on */ static bool wayc_graphics_config(EGLDisplay display, EGLConfig* config) { @@ -88,7 +84,6 @@ void wayc_graphics_deinit(struct graphics_s* graphics) { if (graphics->display == nullptr || graphics->context == nullptr) return; - wayc_graphics_use(&WAYC_GRAPHICS_DUMMY); eglDestroyContext(graphics->display, graphics->context); eglTerminate(graphics->display); diff --git a/src/graphics.h b/src/graphics.h index 0419f46..d2028a7 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -22,10 +22,7 @@ struct graphics_s { enum graphics_error_e wayc_graphics_init(struct graphics_s* graphics, struct wlstate_s* state); void wayc_graphics_deinit(struct graphics_s* graphics); -static inline bool wayc_graphics_use(struct graphics_s* graphics) { - wayc_notnull(graphics); - eglMakeCurrent(graphics->display, EGL_NO_SURFACE, EGL_NO_SURFACE, - graphics->context); - return true; -} +struct renderer_s { + wl_egl_surface_t surface; +}; \ No newline at end of file diff --git a/src/utils.h b/src/utils.h index b599a85..a7b0702 100644 --- a/src/utils.h +++ b/src/utils.h @@ -37,6 +37,8 @@ typedef struct xdg_wm_base* xdg_wm_base_t; typedef struct xdg_surface* xdg_surface_t; typedef struct xdg_toplevel* xdg_toplevel_t; +typedef struct wl_egl_surface* wl_egl_surface_t; + static inline u32 wayc_min(u32 a, u32 b) { return a > b ? a : b; } [[noreturn]] static inline void wayc_panic_impl(const char* file, int line, diff --git a/src/wayclock.cc b/src/wayclock.cc index 2c6a98b..ac6a796 100644 --- a/src/wayclock.cc +++ b/src/wayclock.cc @@ -49,12 +49,6 @@ int main() { if (wayc_graphics_init(&graphics, &loop.state) != GRAPHICS_ERROR_NONE) wayc_panic("Failed to initialize graphics"); - if (!wayc_graphics_use(&graphics)) { - wayc_graphics_deinit(&graphics); - wayc_eventloop_deinit(&loop); - wayc_panic("Failed to use graphics"); - } - struct window_s window; if (wayc_window_init(&window, WAYC_APP_NAME, &loop) != WINDOW_ERROR_NONE) { wayc_graphics_deinit(&graphics); -- cgit v1.2.3