From d5ee59f940a3bcbf765f44710e2f9c1e14a3a558 Mon Sep 17 00:00:00 2001 From: Slendi Date: Fri, 3 Oct 2025 17:56:39 +0300 Subject: [PATCH] yea Signed-off-by: Slendi --- src/LunarWM_core.c | 4 ++-- src/LunarWM_wayland.c | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/LunarWM_core.c b/src/LunarWM_core.c index 2a25c13..0265799 100644 --- a/src/LunarWM_core.c +++ b/src/LunarWM_core.c @@ -434,10 +434,10 @@ void LunarWM_run(LunarWM *wm) wlr_log(WLR_ERROR, "Failed to end OpenXR frame"); return; } + + EndDrawing(); } else { wm->renderer.camera.fovy = 75; } - - EndDrawing(); } } diff --git a/src/LunarWM_wayland.c b/src/LunarWM_wayland.c index c3ba614..99187ee 100644 --- a/src/LunarWM_wayland.c +++ b/src/LunarWM_wayland.c @@ -650,7 +650,7 @@ static void surface_compose_draw( .id = (unsigned int)attribs.tex, .width = (int)wlr_tex->width, .height = (int)wlr_tex->height, - .mipmaps = 0, + .mipmaps = 1, .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, }; @@ -681,22 +681,21 @@ static void surface_compose_draw( } } else { assert(attribs.target == GL_TEXTURE_2D); - DrawTexturePro(tex, src, dst, (Vector2) { 0.0f, 0.0f }, 0.0f, WHITE); + + DrawTexture(tex, sx, sy, WHITE); } } bool LunarWM_Toplevel_update(LunarWM_Toplevel *this) { - auto texture = wlr_surface_get_texture(this->surface); - if (!texture) - return false; - + int width = this->surface->current.width; + int height = this->surface->current.height; bool const size_changed = !IsRenderTextureValid(this->surface_rt) - || this->surface_rt.texture.width != texture->width - || this->surface_rt.texture.height != texture->height; + || this->surface_rt.texture.width != width + || this->surface_rt.texture.height != height; if (size_changed) { LunarWM_Toplevel_release_surface_rt(this); - this->surface_rt = LoadRenderTexture(texture->width, texture->height); + this->surface_rt = LoadRenderTexture(width, height); if (!IsRenderTextureValid(this->surface_rt)) { return true; } @@ -708,7 +707,7 @@ bool LunarWM_Toplevel_update(LunarWM_Toplevel *this) BeginTextureMode(this->surface_rt); ClearBackground(BLANK); struct SurfaceComposeCtx ctx = { - .size = (Vector2) { texture->width, texture->height }, + .size = (Vector2) { width, height }, .wm = this->server, }; // DrawRectangle(0, 0, this->surface_rt.texture.width, @@ -1651,6 +1650,8 @@ static void handle_output_frame(struct wl_listener *listener, void *data) wlr_render_pass_submit(pass); wlr_output_commit_state(wlr_output, &state); wlr_output_state_finish(&state); + + EndDrawing(); } static void handle_new_output(struct wl_listener *listener, void *data)