@@ -1,5 +1,6 @@
|
|||||||
#include "LunarWM_wayland.h"
|
#include "LunarWM_wayland.h"
|
||||||
|
|
||||||
|
#include "LunarWM_core.h"
|
||||||
#include "LunarWM_render.h"
|
#include "LunarWM_render.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
@@ -1577,8 +1578,6 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!wlr_output_commit_state(wlr_output, &state)) {
|
if (!wlr_output_commit_state(wlr_output, &state)) {
|
||||||
wlr_log(WLR_ERROR, "Failed to commit state for output %s",
|
|
||||||
wlr_output->name);
|
|
||||||
wlr_output_state_finish(&state);
|
wlr_output_state_finish(&state);
|
||||||
wlr_output_schedule_frame(wlr_output);
|
wlr_output_schedule_frame(wlr_output);
|
||||||
return;
|
return;
|
||||||
@@ -1602,6 +1601,10 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
|
|||||||
rlFramebufferAttach(wm->renderer.tmp_rt.id, wm->renderer.tmp_rt.depth.id,
|
rlFramebufferAttach(wm->renderer.tmp_rt.id, wm->renderer.tmp_rt.depth.id,
|
||||||
RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0);
|
RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0);
|
||||||
|
|
||||||
|
if (!wm->xr.available) {
|
||||||
|
wm->renderer.camera.target = SphericalToVector3(wm->wm.pointer);
|
||||||
|
}
|
||||||
|
|
||||||
int const hud_size = wm->cman->cfg.displays.hud.size;
|
int const hud_size = wm->cman->cfg.displays.hud.size;
|
||||||
if (!IsTextureValid(wm->renderer.hud_rt.texture)) {
|
if (!IsTextureValid(wm->renderer.hud_rt.texture)) {
|
||||||
wm->renderer.hud_rt = LoadRenderTexture(hud_size, hud_size);
|
wm->renderer.hud_rt = LoadRenderTexture(hud_size, hud_size);
|
||||||
@@ -1647,6 +1650,13 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
|
|||||||
}
|
}
|
||||||
EndTextureMode();
|
EndTextureMode();
|
||||||
|
|
||||||
|
if (wm->renderer.first_frame) {
|
||||||
|
LunarWM_set_recenter_from_camera(wm);
|
||||||
|
wm->renderer.first_frame = false;
|
||||||
|
wm->wm.pointer = get_forward_spherical_with_nearest(
|
||||||
|
wm->renderer.camera.target, wm->cman->cfg.space.radius);
|
||||||
|
}
|
||||||
|
|
||||||
wlr_output_state_finish(&state);
|
wlr_output_state_finish(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user