Compare commits

..

68 Commits

Author SHA1 Message Date
Slendi f3c13b915a epic cursor lock fail
Signed-off-by: Slendi <slendi@socopon.com>
2025-10-01 00:13:36 +03:00
Slendi df00037296 SDf
Signed-off-by: Slendi <slendi@socopon.com>
2025-10-01 00:13:29 +03:00
Slendi 670848e924 format
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 23:29:33 +03:00
Slendi d28bb6f8ee format
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 23:29:15 +03:00
Slendi c6365c0cc1 add surface damage
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 22:30:39 +03:00
Slendi f9dff4265a remove cursor delta debug lgo
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 18:22:03 +03:00
Slendi 6cd7099c39 fix bug
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 17:35:42 +03:00
Slendi 3fcf769aff More 2D improvements
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 17:32:06 +03:00
Slendi 389c1f9934 yea
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 16:49:29 +03:00
Slendi 4ddd9a0ca7 tweaks
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 16:43:32 +03:00
Slendi 2ed9a495bf 2D rendering (kinda, hud brokey)
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 16:36:41 +03:00
Slendi ed429d6a30 Get window up and running
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 15:26:30 +03:00
Slendi d193ef0295 SDFas
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 09:54:06 +03:00
Slendi a253869c24 yea
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 09:53:53 +03:00
Slendi e072b1f6e0 dbug thign
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 02:49:34 +03:00
Slendi 9b00e30b97 Format
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 01:36:51 +03:00
Slendi e8ee25cd88 update gitignore
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 01:24:37 +03:00
Slendi 66a46a9912 fuck...
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-30 01:24:27 +03:00
Slendi 72a6ac3d00 sdf
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-29 23:28:39 +03:00
Slendi 22c005999c add wlroots as a submodule for reference
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-29 23:28:39 +03:00
Slendi 159bd314e5 update wlrotos
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-29 20:40:07 +03:00
Slendi b0a1c2cb27 oops
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-29 18:58:49 +03:00
Slendi 28a9f54227 Organization, render cursor above all else
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-29 18:51:43 +03:00
Slendi a6949eeda0 Mouse cursor
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-04 15:11:29 +03:00
Slendi 1af7357301 Chagne defaujlt
Signed-off-by: Slendi <slendi@socopon.com>
2025-09-03 21:21:25 +03:00
Slendi 70ff013dbc Fallback
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-11 11:00:15 +03:00
Slendi 971040e038 Optizmiatoin
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-11 09:56:45 +03:00
Slendi bf3ed0dd0c Yay
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-11 09:52:57 +03:00
Slendi 794178668e Add recentering
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-11 09:29:38 +03:00
Slendi e3b2f44621 fix some cleanup bugs
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-11 07:12:04 +03:00
Slendi ef96c51566 Stuff
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-11 06:39:52 +03:00
Slendi c9590037aa Stuff
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-11 01:24:53 +03:00
Slendi aa80a4c9d0 Temporarily prevent z fighting
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 13:08:52 +03:00
Slendi 39a27eaae6 Make HUD draw over everything
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 13:07:20 +03:00
Slendi e9a31ac4a6 Enable lazy xwayland by default
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 13:03:05 +03:00
Slendi ec61c13aa6 Add xwayland, fix naming
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 12:58:55 +03:00
Slendi 025ee9da91 Fix defaults
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 12:24:43 +03:00
Slendi ad0d09ebd2 Fix crashing
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 08:45:45 +03:00
Slendi ab7ca71ba2 Clean-up
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 08:00:07 +03:00
Slendi 3e4d4514ad Remove unnecessary lua eval
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 07:45:37 +03:00
Slendi 3a50e5e403 stuff
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 07:40:40 +03:00
Slendi 146c4e27cf Use Lua for config
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 07:25:01 +03:00
Slendi 4e23877697 C++, BYE BYE!! BYE BYE!!!
Signed-off-by: Slendi <slendi@socopon.com>
2025-08-10 06:38:23 +03:00
Slendi d154db1422 Stuff, have to rewrite DHOS config parser
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-23 23:23:56 +03:00
Slendi 14f2e52722 Stuff
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-23 15:57:12 +03:00
Slendi 78c86aaabd Add hands idk they broken
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-16 11:53:27 +03:00
Slendi 7dc90058b2 Add linter and fix issues
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-14 01:05:22 +03:00
Slendi c21397cef5 Get windows to render propely
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-10 07:11:56 +03:00
Slendi c1e331ca7e Manage to get first frame of clients rendering
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-10 05:12:56 +03:00
Slendi 1cc97753a5 Use custom wlroots fork
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-10 02:07:58 +03:00
Slendi dd6cadb50d Input handling
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-09 07:54:10 +03:00
Slendi 9fa2a1e8c7 Raylib
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-09 07:20:12 +03:00
Slendi cecea144e4 Get OpenXR fully up and running
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-09 04:29:40 +03:00
Slendi ccffc7908a wlroots
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-08 00:56:33 +03:00
Slendi 2ebc752cc7 Fix wrong index bug
lmao.

Signed-off-by: Slendi <slendi@socopon.com>
2025-07-05 03:35:48 +03:00
Slendi 21c8c60369 Remove the CMake patching workaround
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-05 03:24:37 +03:00
Slendi 2e38196ea5 import std
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-05 03:17:42 +03:00
Slendi 9d39cd9a38 A lot.
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-05 02:41:08 +03:00
Slendi 470c248bcf yes
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-01 04:00:52 +03:00
Slendi bdb9d472de fuck rust
Signed-off-by: Slendi <slendi@socopon.com>
2025-07-01 00:08:34 +03:00
Slendi fdafccbdad Remove everything, going rustacean
Signed-off-by: Slendi <slendi@socopon.com>
2025-06-29 19:32:27 +03:00
Slendi 1fb48e2426 idk
Signed-off-by: Slendi <slendi@socopon.com>
2025-06-29 19:22:17 +03:00
Slendi d83e7f4337 Add helper scripts and wlroots integration
Signed-off-by: Slendi <slendi@socopon.com>
2025-06-29 17:34:45 +03:00
Slendi 1d99b16685 Fix openxr gl glue
Signed-off-by: Slendi <slendi@socopon.com>
2025-06-29 17:06:08 +03:00
Slendi 1a654ec009 Merge pull request #1 from slendidev/codex/write-glue-code-for-openxr-opengl-and-wlroots
Add OpenXR wlroots backend skeleton
2025-06-29 16:31:56 +03:00
Slendi cc1137c011 Refine OpenXR backend formatting 2025-06-29 16:30:23 +03:00
Slendi 9fdb148c89 add wlroots for reference
Signed-off-by: Slendi <slendi@socopon.com>
2025-06-29 16:00:43 +03:00
Slendi c93ab29a90 Initial commit
Signed-off-by: Slendi <slendi@socopon.com>
2025-06-29 15:57:38 +03:00
8 changed files with 154 additions and 75 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
[submodule "wlroots-lunar"]
path = wlroots-lunar
url = https://github.com/slendidev/wlroots-lunar
url = git@github.com:slendidev/wlroots-lunar
Generated
+3 -3
View File
@@ -97,11 +97,11 @@
]
},
"locked": {
"lastModified": 1759496058,
"narHash": "sha256-eVgGEO+KhJX307XQ0gbbCWguJfoSJlZRFQrpvalK7kM=",
"lastModified": 1759266345,
"narHash": "sha256-BJ+CTRXaFArVFgJfL19QpoR7Ebk8HU63Lz0+jQvhV3Y=",
"owner": "slendidev",
"repo": "wlroots-lunar",
"rev": "00d01dcc297e1991809ad2c0f6b50fb66478d748",
"rev": "1179ca07821decbff320eafd7ffb3caaadcefbf4",
"type": "github"
},
"original": {
-1
View File
@@ -36,7 +36,6 @@
ninja
(pkgs.llvmPackages_20.clang-tools.override { enableLibcxx = true; })
lldb
valgrind
lua
+1 -10
View File
@@ -120,9 +120,7 @@ static int l_recenter(lua_State *L)
{
(void)L;
if (g_wm.xr.available) {
LunarWM_set_recenter_from_camera(&g_wm);
}
LunarWM_set_recenter_from_camera(&g_wm);
lua_pushnil(L);
return 1;
@@ -268,13 +266,6 @@ void LunarWM_destroy(LunarWM *wm)
LunarWM_wayland_cleanup(wm);
cleanup_lua_cfg(wm);
for (size_t i = 0; i < ARRAY_SZ(wm->wm.workspaces); ++i) {
if (wm->wm.workspaces[i].v_windows) {
vector_free(wm->wm.workspaces[i].v_windows);
wm->wm.workspaces[i].v_windows = NULL;
}
}
memset(wm, 0, sizeof(*wm));
}
+9 -4
View File
@@ -328,13 +328,16 @@ void LunarWM_render_windows(LunarWM *this, bool alpha_check)
if (!tl || !tl->surface) {
continue;
}
if (IsTextureValid(tl->surface_rt.texture)) {
Texture2D tex = tl->surface_rt.texture;
if (tl->gles_texture) {
if (alpha_check && tl->composed_has_alpha) {
continue;
}
Texture2D tex = tl->rl_texture;
bool y_flip = false;
if (IsRenderTextureValid(tl->surface_rt)) {
tex = tl->surface_rt.texture;
tex.width = tl->surface_rt.texture.width;
tex.height = tl->surface_rt.texture.height;
tex.width = tl->rl_texture.width;
tex.height = tl->rl_texture.height;
y_flip = true;
}
if (!tex.id)
@@ -348,6 +351,8 @@ 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)
+7
View File
@@ -130,8 +130,15 @@ typedef struct {
} u;
struct wlr_surface *surface;
struct wlr_texture *texture;
struct wlr_buffer *locked_buffer;
struct wlr_gles2_texture_attribs attribs;
struct wlr_gles2_texture *gles_texture;
Texture2D rl_texture;
RenderTexture2D surface_rt;
struct wlr_box surface_extents;
bool composed_has_alpha;
} LunarWM_Toplevel;
typedef struct {
+132 -55
View File
@@ -10,7 +10,6 @@
#include <wlr/backend/x11.h>
#include <wlr/render/color.h>
#include <wlr/render/pass.h>
#include <wlr/xwayland/xwayland.h>
#include <assert.h>
#include <math.h>
@@ -428,6 +427,8 @@ static void LunarWM_Toplevel_release_surface_rt(LunarWM_Toplevel *tl)
UnloadRenderTexture(tl->surface_rt);
}
tl->surface_rt = (RenderTexture2D) { 0 };
tl->surface_extents = (struct wlr_box) { 0 };
tl->composed_has_alpha = false;
}
static void remove_windows_for_tl(LunarWM *wm, LunarWM_Toplevel *tl)
@@ -523,8 +524,16 @@ static void toplevel_unmap_notify(struct wl_listener *l, void *data)
if (tl->commit.link.prev || tl->commit.link.next)
wl_list_remove(&tl->commit.link);
if (tl->locked_buffer) {
wlr_buffer_unlock(tl->locked_buffer);
tl->locked_buffer = NULL;
}
tl->texture = NULL;
tl->gles_texture = NULL;
tl->rl_texture = (Texture) { 0 };
LunarWM_Toplevel_release_surface_rt(tl);
tl->surface = NULL;
tl->composed_has_alpha = false;
focus_fallback(tl->server);
}
@@ -592,13 +601,16 @@ bool LunarWM_Toplevel_destroy(LunarWM_Toplevel *this)
wl_list_remove(&this->commit.link);
if (this->destroy.link.prev || this->destroy.link.next)
wl_list_remove(&this->destroy.link);
if (this->locked_buffer)
wlr_buffer_unlock(this->locked_buffer);
LunarWM_Toplevel_release_surface_rt(this);
this->composed_has_alpha = false;
return true;
}
struct SurfaceComposeCtx {
Vector2 size;
LunarWM *wm;
struct wlr_box extents;
bool *has_alpha;
};
char const *GLInternalFormatName(GLenum format)
@@ -635,14 +647,18 @@ static void surface_compose_draw(
struct wlr_surface *surface, int sx, int sy, void *user_data)
{
struct SurfaceComposeCtx *ctx = user_data;
if (!ctx) {
if (!ctx)
return;
}
struct wlr_texture *wlr_tex = wlr_surface_get_texture(surface);
if (!wlr_tex || wlr_tex->width == 0 || wlr_tex->height == 0) {
if (!wlr_tex || wlr_tex->width == 0 || wlr_tex->height == 0)
return;
}
struct wlr_gles2_texture *gles_tex = gles2_get_texture(wlr_tex);
if (!gles_tex)
return;
if (ctx->has_alpha && gles_tex->has_alpha)
*ctx->has_alpha = true;
struct wlr_gles2_texture_attribs attribs;
wlr_gles2_texture_get_attribs(wlr_tex, &attribs);
@@ -651,7 +667,8 @@ static void surface_compose_draw(
.width = (int)wlr_tex->width,
.height = (int)wlr_tex->height,
.mipmaps = 1,
.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
.format = gles_tex->has_alpha ? PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
: PIXELFORMAT_UNCOMPRESSED_R8G8B8,
};
float dest_w = (float)surface->current.width;
@@ -663,16 +680,16 @@ static void surface_compose_draw(
Rectangle src = { 0.0f, 0.0f, (float)tex.width, (float)tex.height };
Rectangle dst = {
sx,
sy,
(float)(sx - ctx->extents.x),
(float)(sy - ctx->extents.y),
dest_w,
dest_h,
};
if (attribs.target == GL_TEXTURE_EXTERNAL_OES) {
static bool external_draw_warned = false;
if (!draw_external_texture(
&attribs, tex.width, tex.height, src, dst, dest_w, dest_h)) {
if (!draw_external_texture(&attribs, tex.width, tex.height, src, dst,
ctx->extents.width, ctx->extents.height)) {
if (!external_draw_warned) {
TraceLog(LOG_WARNING,
"Failed to draw external texture, skipping frame");
@@ -681,29 +698,70 @@ 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();
DrawTexturePro(tex, src, dst, (Vector2) { 0.0f, 0.0f }, 0.0f, WHITE);
}
}
bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
{
if (!this->surface->mapped) {
if (!this || !this->surface)
return false;
this->texture = wlr_surface_get_texture(this->surface);
struct wlr_client_buffer *cl_buf = this->surface->buffer;
if ((this->texture == nullptr) || (cl_buf == nullptr)) {
return false;
}
int width = this->surface->current.width;
int height = this->surface->current.height;
if ((this->locked_buffer != nullptr)
&& this->locked_buffer != &cl_buf->base) {
wlr_buffer_unlock(this->locked_buffer);
this->locked_buffer = nullptr;
}
if (this->locked_buffer == nullptr) {
this->locked_buffer = wlr_buffer_lock(&cl_buf->base);
}
wlr_gles2_texture_get_attribs(this->texture, &this->attribs);
this->gles_texture = gles2_get_texture(this->texture);
if (this->gles_texture == nullptr) {
return false;
}
this->rl_texture.id = (unsigned int)this->attribs.tex;
this->rl_texture.width = (int)this->texture->width;
this->rl_texture.height = (int)this->texture->height;
this->rl_texture.mipmaps = 1;
this->rl_texture.format = this->gles_texture->has_alpha
? PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
: PIXELFORMAT_UNCOMPRESSED_R8G8B8;
SetTextureFilter(this->rl_texture, TEXTURE_FILTER_BILINEAR);
SetTextureWrap(this->rl_texture, TEXTURE_WRAP_CLAMP);
struct wlr_box extents = { 0 };
wlr_surface_get_extents(this->surface, &extents);
if (extents.width <= 0 || extents.height <= 0) {
LunarWM_Toplevel_release_surface_rt(this);
this->composed_has_alpha = this->gles_texture->has_alpha;
return true;
}
bool needs_alpha = this->gles_texture->has_alpha;
if (extents.x != 0 || extents.y != 0
|| extents.width != (int)this->texture->width
|| extents.height != (int)this->texture->height) {
needs_alpha = true;
}
bool const size_changed = !IsRenderTextureValid(this->surface_rt)
|| this->surface_rt.texture.width != width
|| this->surface_rt.texture.height != height;
|| this->surface_rt.texture.width != extents.width
|| this->surface_rt.texture.height != extents.height;
if (size_changed) {
LunarWM_Toplevel_release_surface_rt(this);
this->surface_rt = LoadRenderTexture(width, height);
this->surface_rt = LoadRenderTexture(extents.width, extents.height);
if (!IsRenderTextureValid(this->surface_rt)) {
this->composed_has_alpha = needs_alpha;
return true;
}
SetTextureFilter(this->surface_rt.texture, TEXTURE_FILTER_BILINEAR);
@@ -712,17 +770,22 @@ bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
BeginTextureMode(this->surface_rt);
ClearBackground(BLANK);
BeginBlendMode(BLEND_ALPHA);
struct SurfaceComposeCtx ctx = {
.size = (Vector2) { width, height },
.wm = this->server,
.extents = extents,
.has_alpha = &needs_alpha,
};
// 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);
EndBlendMode();
EndTextureMode();
this->surface_extents = extents;
Texture2D composed = this->surface_rt.texture;
composed.width = extents.width;
composed.height = extents.height;
this->rl_texture = composed;
this->composed_has_alpha = needs_alpha;
return true;
}
@@ -868,6 +931,14 @@ static void xwl_unmap_toplevel(LunarWM_Toplevel *tl)
if (tl->destroy.link.prev || tl->destroy.link.next)
wl_list_remove(&tl->destroy.link);
if (tl->locked_buffer) {
wlr_buffer_unlock(tl->locked_buffer);
tl->locked_buffer = NULL;
}
tl->texture = NULL;
tl->gles_texture = NULL;
tl->rl_texture = (Texture) { 0 };
LunarWM_Toplevel_release_surface_rt(tl);
tl->surface = NULL;
}
@@ -1564,19 +1635,42 @@ 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);
if (pass == NULL) {
wlr_output_state_finish(&state);
wlr_output_schedule_frame(wlr_output);
wlr_log(WLR_ERROR, "Failed to begin render pass for output %s",
wlr_output->name);
return;
}
GLint draw_fbo = 0;
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &draw_fbo);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GLint drawFboId = 0, readFboId = 0;
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFboId);
glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &readFboId);
rlMatrixMode(RL_MODELVIEW);
rlLoadIdentity();
wm->renderer.tmp_rt.id = draw_fbo;
// if (!IsTextureValid(wm->renderer.main_rt.texture)) {
// wm->renderer.main_rt = LoadRenderTexture(width, height);
// }
if (!wlr_render_pass_submit(pass)) {
wlr_output_state_finish(&state);
wlr_output_schedule_frame(wlr_output);
wlr_log(WLR_ERROR, "Failed to submit render pass for output %s",
wlr_output->name);
return;
}
if (!wlr_output_commit_state(wlr_output, &state)) {
wlr_output_state_finish(&state);
wlr_output_schedule_frame(wlr_output);
return;
}
wm->renderer.tmp_rt.id = drawFboId;
wm->renderer.tmp_rt.texture = (Texture) {
.id = draw_fbo,
.id = drawFboId,
.width = width,
.height = height,
.mipmaps = 1,
@@ -1594,18 +1688,6 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
if (!wm->xr.available && !wm->renderer.first_frame) {
wm->renderer.camera.target = SphericalToVector3(wm->wm.pointer);
Vector3 forward = Vector3Normalize(Vector3Subtract(
wm->renderer.camera.target, wm->renderer.camera.position));
Vector3 worldUp = (Vector3) { 0, 1, 0 };
if (fabsf(Vector3DotProduct(forward, worldUp)) > 0.999f) {
worldUp = (Vector3) { 0, 0, 1 };
}
Vector3 right = Vector3Normalize(Vector3CrossProduct(forward, worldUp));
wm->renderer.camera.up
= Vector3Normalize(Vector3CrossProduct(right, forward));
}
int const hud_size = wm->cman->cfg.displays.hud.size;
@@ -1614,7 +1696,7 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
}
BeginTextureMode(wm->renderer.hud_rt);
{
LunarWM_render_hud(wm, GetFrameTime(), hud_size);
LunarWM_render_hud(wm, GetFrameTime(), 1);
}
EndTextureMode();
@@ -1630,7 +1712,6 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
}
EndMode3D();
DrawFPS(0, 0);
rlDrawRenderBatchActive();
}
EndTextureMode();
@@ -1661,11 +1742,7 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
wm->renderer.camera.target, wm->cman->cfg.space.radius);
}
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)