@@ -1508,7 +1508,7 @@ static bool init_xr(LunarWM *this)
|
||||
XrReferenceSpaceCreateInfo const ci = {
|
||||
.type = XR_TYPE_REFERENCE_SPACE_CREATE_INFO,
|
||||
.next = nullptr,
|
||||
.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_STAGE,
|
||||
.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL,
|
||||
.poseInReferenceSpace = { .orientation = { 0.0f, 0.0f, 0.0f, 1.0f },
|
||||
.position = { 0.0f, 0.0f, 0.0f } },
|
||||
};
|
||||
@@ -1815,8 +1815,6 @@ static void cleanup_xr(LunarWM *this)
|
||||
}
|
||||
|
||||
if (this->xr.session != XR_NULL_HANDLE) {
|
||||
if (this->xr.session_running)
|
||||
xrEndSession(this->xr.session);
|
||||
xrDestroySession(this->xr.session);
|
||||
this->xr.session = XR_NULL_HANDLE;
|
||||
this->xr.session_running = false;
|
||||
@@ -1841,6 +1839,16 @@ static void cleanup_wayland(LunarWM *this)
|
||||
}
|
||||
|
||||
if (this->wayland.xwayland) {
|
||||
if (this->wayland.xwayland_new_surface.link.prev
|
||||
|| this->wayland.xwayland_new_surface.link.next) {
|
||||
wl_list_remove(&this->wayland.xwayland_new_surface.link);
|
||||
this->wayland.xwayland_new_surface.notify = NULL;
|
||||
}
|
||||
if (this->wayland.xwayland_ready.link.prev
|
||||
|| this->wayland.xwayland_ready.link.next) {
|
||||
wl_list_remove(&this->wayland.xwayland_ready.link);
|
||||
this->wayland.xwayland_ready.notify = NULL;
|
||||
}
|
||||
wlr_xwayland_destroy(this->wayland.xwayland);
|
||||
this->wayland.xwayland = NULL;
|
||||
}
|
||||
@@ -2193,17 +2201,17 @@ void render_hud(LunarWM *this, float /*dt*/, int hud_size)
|
||||
|
||||
void render_3d(LunarWM *this, float /*dt*/)
|
||||
{
|
||||
Skybox_draw(this->renderer.skybox, (Vector3) { 0, 0, 0 });
|
||||
Skybox_draw(this->renderer.skybox, this->renderer.center);
|
||||
|
||||
rlDisableBackfaceCulling();
|
||||
// rlDisableBackfaceCulling();
|
||||
for (size_t i = 0; i < vector_size(this->wayland.v_toplevels); i++) {
|
||||
auto *tl = this->wayland.v_toplevels[i];
|
||||
|
||||
if (!tl || !tl->surface)
|
||||
continue;
|
||||
|
||||
if (!LunarWM_Toplevel_update(tl))
|
||||
continue;
|
||||
// if (!LunarWM_Toplevel_update(tl))
|
||||
// continue;
|
||||
|
||||
DrawTexture3D(tl->rl_texture,
|
||||
Vector3Add(this->renderer.center,
|
||||
@@ -2211,7 +2219,7 @@ void render_3d(LunarWM *this, float /*dt*/)
|
||||
0, 0, this->cman->cfg.space.radius - 0.01 * (float)i }),
|
||||
this->renderer.center, this->cman->cfg.space.window_scale, false);
|
||||
}
|
||||
rlEnableBackfaceCulling();
|
||||
// rlEnableBackfaceCulling();
|
||||
|
||||
for (int h = 0; h < 2; ++h) {
|
||||
auto *hand_info = &this->xr.hands[h];
|
||||
@@ -2356,7 +2364,8 @@ static bool render_layer(LunarWM *this, LunarWM_RenderLayerInfo *info, float dt)
|
||||
rlSetMatrixViewOffsetStereo(view_off_r, view_off_l);
|
||||
|
||||
glViewport(0, 0, (GLsizei)eye_w * view_count, (GLsizei)eye_h);
|
||||
ClearBackground((Color) { 0, 0, 10, 255 });
|
||||
rlClearColor(0, 0, 10, 255);
|
||||
rlClearScreenBuffers();
|
||||
|
||||
for (int i = 0; i < 1; i++) {
|
||||
XrTime const time = info->predicted_display_time;
|
||||
@@ -2406,6 +2415,8 @@ static bool render_layer(LunarWM *this, LunarWM_RenderLayerInfo *info, float dt)
|
||||
}
|
||||
|
||||
BeginTextureMode(this->renderer.tmp_rt);
|
||||
rlDisableColorBlend();
|
||||
ClearBackground(BLACK);
|
||||
BeginShaderMode(this->renderer.linear_srgb);
|
||||
DrawTexturePro(this->renderer.main_rt.texture,
|
||||
(Rectangle) {
|
||||
@@ -2423,6 +2434,7 @@ static bool render_layer(LunarWM *this, LunarWM_RenderLayerInfo *info, float dt)
|
||||
(Vector2) { 0, 0 }, 0, WHITE);
|
||||
EndShaderMode();
|
||||
EndTextureMode();
|
||||
rlEnableColorBlend();
|
||||
|
||||
// release swapchain images
|
||||
XrSwapchainImageReleaseInfo const ri
|
||||
|
||||
Reference in New Issue
Block a user