Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-10-03 18:31:50 +03:00
parent d5ee59f940
commit 25594baeac
2 changed files with 12 additions and 8 deletions

View File

@@ -348,8 +348,6 @@ void LunarWM_render_windows(LunarWM *this, bool alpha_check)
void LunarWM_render_3d(LunarWM *this, float /*dt*/)
{
LunarWM_render_windows(this, true);
for (int h = 0; this->xr.hand_tracking_enabled && h < 2; ++h) {
auto *hand_info = &this->xr.hands[h];
if (hand_info->hand_tracker == XR_NULL_HANDLE)

View File

@@ -682,12 +682,19 @@ static void surface_compose_draw(
} else {
assert(attribs.target == GL_TEXTURE_2D);
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);
glDisable(GL_STENCIL_TEST);
DrawTexture(tex, sx, sy, WHITE);
rlDrawRenderBatchActive();
}
}
bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
{
if (!this->surface->mapped) {
return false;
}
int width = this->surface->current.width;
int height = this->surface->current.height;
bool const size_changed = !IsRenderTextureValid(this->surface_rt)
@@ -703,7 +710,6 @@ bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
SetTextureWrap(this->surface_rt.texture, TEXTURE_WRAP_CLAMP);
}
rlSetShader(rlGetShaderIdDefault(), rlGetShaderLocsDefault());
BeginTextureMode(this->surface_rt);
ClearBackground(BLANK);
struct SurfaceComposeCtx ctx = {
@@ -712,6 +718,7 @@ bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
};
// DrawRectangle(0, 0, this->surface_rt.texture.width,
// this->surface_rt.texture.height, BLACK);
rlSetShader(rlGetShaderIdDefault(), rlGetShaderLocsDefault());
wlr_surface_for_each_surface(this->surface, surface_compose_draw, &ctx);
DrawFPS(0, 0);
EndTextureMode();
@@ -1558,9 +1565,8 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
struct wlr_render_pass *pass
= wlr_output_begin_render_pass(wlr_output, &state, NULL);
GLint drawFboId = 0, readFboId = 0;
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFboId);
glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &readFboId);
GLint draw_fbo = 0;
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &draw_fbo);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -1572,9 +1578,9 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
// wm->renderer.main_rt = LoadRenderTexture(width, height);
// }
wm->renderer.tmp_rt.id = drawFboId;
wm->renderer.tmp_rt.id = draw_fbo;
wm->renderer.tmp_rt.texture = (Texture) {
.id = drawFboId,
.id = draw_fbo,
.width = width,
.height = height,
.mipmaps = 1,