Browse Source

update RGFW

pull/4688/head
ColleagueRiley 6 months ago
parent
commit
5965f6f222
2 changed files with 23 additions and 8 deletions
  1. +22
    -7
      src/external/RGFW.h
  2. +1
    -1
      src/platforms/rcore_desktop_rgfw.c

+ 22
- 7
src/external/RGFW.h View File

@ -1729,6 +1729,10 @@ RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, RGFW_windowFlag
RGFWDEF void RGFW_window_basic_init(RGFW_window* win, RGFW_rect rect, RGFW_windowFlags flags); RGFWDEF void RGFW_window_basic_init(RGFW_window* win, RGFW_rect rect, RGFW_windowFlags flags);
#if defined(RGFW_X11) || defined(RGFW_WINDOWS)
RGFW_mouse* RGFW_hiddenMouse = NULL;
#endif
/* do a basic initialization for RGFW_window, this is to standard it for each OS */ /* do a basic initialization for RGFW_window, this is to standard it for each OS */
void RGFW_window_basic_init(RGFW_window* win, RGFW_rect rect, RGFW_windowFlags flags) { void RGFW_window_basic_init(RGFW_window* win, RGFW_rect rect, RGFW_windowFlags flags) {
/* clear out dnd info */ /* clear out dnd info */
@ -1756,6 +1760,13 @@ void RGFW_window_basic_init(RGFW_window* win, RGFW_rect rect, RGFW_windowFlags f
if (flags & RGFW_windowFullscreen) if (flags & RGFW_windowFullscreen)
rect = RGFW_RECT(0, 0, screenR.w, screenR.h); rect = RGFW_RECT(0, 0, screenR.w, screenR.h);
#if defined(RGFW_X11) || defined(RGFW_WINDOWS)
if (RGFW_hiddenMouse == NULL) {
u8 RGFW_blk[] = { 0, 0, 0, 0 };
RGFW_hiddenMouse = RGFW_loadMouse(RGFW_blk, RGFW_AREA(1, 1), 4);
}
#endif
/* set and init the new window's data */ /* set and init the new window's data */
win->r = rect; win->r = rect;
win->event.inFocus = 1; win->event.inFocus = 1;
@ -1973,14 +1984,8 @@ RGFW_gamepadType RGFW_getGamepadType(RGFW_window* win, u16 controller) {
#if defined(RGFW_X11) || defined(RGFW_WINDOWS) #if defined(RGFW_X11) || defined(RGFW_WINDOWS)
void RGFW_window_showMouse(RGFW_window* win, i8 show) { void RGFW_window_showMouse(RGFW_window* win, i8 show) {
static void* mouse = NULL;
if (mouse == NULL) {
u8 RGFW_blk[] = { 0, 0, 0, 0 };
mouse = RGFW_loadMouse(RGFW_blk, RGFW_AREA(1, 1), 4);
}
if (show == 0) if (show == 0)
RGFW_window_setMouse(win, mouse);
RGFW_window_setMouse(win, RGFW_hiddenMouse);
else else
RGFW_window_setMouseDefault(win); RGFW_window_setMouseDefault(win);
} }
@ -4299,6 +4304,11 @@ void RGFW_window_close(RGFW_window* win) {
close(RGFW_gamepads[i]); close(RGFW_gamepads[i]);
} }
#endif #endif
if (RGFW_hiddenMouse != NULL) {
RGFW_freeMouse(RGFW_hiddenMouse);
RGFW_hiddenMouse = 0;
}
} }
RGFW_clipboard_switch(NULL); RGFW_clipboard_switch(NULL);
@ -6812,6 +6822,11 @@ void RGFW_window_close(RGFW_window* win) {
RGFW_FREE_LIBRARY(RGFW_wgl_dll); RGFW_FREE_LIBRARY(RGFW_wgl_dll);
RGFW_root = NULL; RGFW_root = NULL;
if (RGFW_hiddenMouse != NULL) {
RGFW_freeMouse(RGFW_hiddenMouse);
RGFW_hiddenMouse = 0;
}
} }
RGFW_clipboard_switch(NULL); RGFW_clipboard_switch(NULL);

+ 1
- 1
src/platforms/rcore_desktop_rgfw.c View File

@ -669,7 +669,7 @@ void SetClipboardText(const char *text)
} }
// Get clipboard text content // Get clipboard text content
// NOTE: returned string is allocated and freed by GLFW
// NOTE: returned string is allocated and freed by RGFW
const char *GetClipboardText(void) const char *GetClipboardText(void)
{ {
return RGFW_readClipboard(NULL); return RGFW_readClipboard(NULL);

Loading…
Cancel
Save