Skip to content

Commit

Permalink
update wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Jan 13, 2025
1 parent 88ee203 commit f927710
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ ifeq ($(RGFW_WAYLAND),1)
NO_VULKAN = 1
NO_GLES = 0
NO_OSMESA = 0
LIBS += -D RGFW_WAYLAND relative-pointer-unstable-v1-client-protocol.c xdg-decoration-unstable-v1.c xdg-shell.c -lwayland-cursor -lwayland-client -lxkbcommon
LINK_GL1 = -lEGL -lGL -lwayland-egl
LIBS += -D RGFW_WAYLAND relative-pointer-unstable-v1-client-protocol.c xdg-decoration-unstable-v1.c xdg-shell.c -lwayland-cursor -lwayland-client -lxkbcommon -lwayland-egl
LINK_GL1 = -lEGL -lGL

endif

Expand Down
14 changes: 10 additions & 4 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -2315,10 +2315,10 @@ void RGFW_createOpenGLContext(RGFW_window* win) {
#elif defined(RGFW_MACOS)
win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType)0);
#elif defined(RGFW_WAYLAND)
if (RGFW_useWaylandBool)
win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.wl_display);
else
win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.display);
if (RGFW_useWaylandBool)
win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.wl_display);
else
win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.display);
#else
win->src.EGL_display = eglGetDisplay((EGLNativeDisplayType) win->src.display);
#endif
Expand Down Expand Up @@ -4516,6 +4516,8 @@ RGFW_GOTO_WAYLAND(0);
}

void RGFW_window_moveMouse(RGFW_window* win, RGFW_point p) {
RGFW_GOTO_WAYLAND(1);
#ifdef RGFW_X11
RGFW_ASSERT(win != NULL);

XEvent event;
Expand All @@ -4530,6 +4532,10 @@ void RGFW_window_moveMouse(RGFW_window* win, RGFW_point p) {
return;

XWarpPointer(win->src.display, None, win->src.window, 0, 0, 0, 0, (int) p.x - win->r.x, (int) p.y - win->r.y);
#endif
#ifdef RGFW_WAYLAND
wayland:
#endif
}

b32 RGFW_window_setMouseDefault(RGFW_window* win) {
Expand Down
1 change: 0 additions & 1 deletion examples/first-person-camera/camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ int main(void) {
glMatrixMode(GL_MODELVIEW);

RGFW_window_mouseHold(win, RGFW_AREA(win->r.w / 2, win->r.h / 2));

while (RGFW_window_shouldClose(win) == 0) {
while (RGFW_window_checkEvent(win)) {
if (win->event.type == RGFW_quit)
Expand Down

0 comments on commit f927710

Please sign in to comment.