@@ -348,8 +348,6 @@ void LunarWM_render_windows(LunarWM *this, bool alpha_check)
|
|||||||
|
|
||||||
void LunarWM_render_3d(LunarWM *this, float /*dt*/)
|
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) {
|
for (int h = 0; this->xr.hand_tracking_enabled && h < 2; ++h) {
|
||||||
auto *hand_info = &this->xr.hands[h];
|
auto *hand_info = &this->xr.hands[h];
|
||||||
if (hand_info->hand_tracker == XR_NULL_HANDLE)
|
if (hand_info->hand_tracker == XR_NULL_HANDLE)
|
||||||
|
|||||||
@@ -682,12 +682,19 @@ static void surface_compose_draw(
|
|||||||
} else {
|
} else {
|
||||||
assert(attribs.target == GL_TEXTURE_2D);
|
assert(attribs.target == GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
glClearStencil(0);
|
||||||
|
glClear(GL_STENCIL_BUFFER_BIT);
|
||||||
|
glDisable(GL_STENCIL_TEST);
|
||||||
DrawTexture(tex, sx, sy, WHITE);
|
DrawTexture(tex, sx, sy, WHITE);
|
||||||
|
rlDrawRenderBatchActive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
|
bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
|
||||||
{
|
{
|
||||||
|
if (!this->surface->mapped) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
int width = this->surface->current.width;
|
int width = this->surface->current.width;
|
||||||
int height = this->surface->current.height;
|
int height = this->surface->current.height;
|
||||||
bool const size_changed = !IsRenderTextureValid(this->surface_rt)
|
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);
|
SetTextureWrap(this->surface_rt.texture, TEXTURE_WRAP_CLAMP);
|
||||||
}
|
}
|
||||||
|
|
||||||
rlSetShader(rlGetShaderIdDefault(), rlGetShaderLocsDefault());
|
|
||||||
BeginTextureMode(this->surface_rt);
|
BeginTextureMode(this->surface_rt);
|
||||||
ClearBackground(BLANK);
|
ClearBackground(BLANK);
|
||||||
struct SurfaceComposeCtx ctx = {
|
struct SurfaceComposeCtx ctx = {
|
||||||
@@ -712,6 +718,7 @@ bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
|
|||||||
};
|
};
|
||||||
// DrawRectangle(0, 0, this->surface_rt.texture.width,
|
// DrawRectangle(0, 0, this->surface_rt.texture.width,
|
||||||
// this->surface_rt.texture.height, BLACK);
|
// this->surface_rt.texture.height, BLACK);
|
||||||
|
rlSetShader(rlGetShaderIdDefault(), rlGetShaderLocsDefault());
|
||||||
wlr_surface_for_each_surface(this->surface, surface_compose_draw, &ctx);
|
wlr_surface_for_each_surface(this->surface, surface_compose_draw, &ctx);
|
||||||
DrawFPS(0, 0);
|
DrawFPS(0, 0);
|
||||||
EndTextureMode();
|
EndTextureMode();
|
||||||
@@ -1558,9 +1565,8 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
|
|||||||
struct wlr_render_pass *pass
|
struct wlr_render_pass *pass
|
||||||
= wlr_output_begin_render_pass(wlr_output, &state, NULL);
|
= wlr_output_begin_render_pass(wlr_output, &state, NULL);
|
||||||
|
|
||||||
GLint drawFboId = 0, readFboId = 0;
|
GLint draw_fbo = 0;
|
||||||
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFboId);
|
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &draw_fbo);
|
||||||
glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &readFboId);
|
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
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.main_rt = LoadRenderTexture(width, height);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
wm->renderer.tmp_rt.id = drawFboId;
|
wm->renderer.tmp_rt.id = draw_fbo;
|
||||||
wm->renderer.tmp_rt.texture = (Texture) {
|
wm->renderer.tmp_rt.texture = (Texture) {
|
||||||
.id = drawFboId,
|
.id = draw_fbo,
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
.mipmaps = 1,
|
.mipmaps = 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user