Comments (6)
Hello,
If you mean directly from raylib, then I don't think so. I believe the input queue itself is managed by GLFW and just polled by raylib (reference). You could try:
- including
GLFW/glfw3.h
and callingglfwPollEvents()
aftersleep()
, maybe that could work to empty the queue; - or calling raylib's
PollInputEvents()
aftersleep()
, but it definitely wasn't designed for that; - or try
PLATFORM_DESKTOP_SDL
.
Best regards.
from raylib.
Since the issue is in GLFW (the ticket you linked) we have to wait for them to fix it or use a different raylib core such as RGFW or SDL
from raylib.
I was thinking if raylib can call something right before initialize or terminate. Unfortunately I don't know enough about mac os to tell if it can be hacked around in raylib or not.
from raylib.
I'm afraid this issue is out-of-scope of raylib but on its underlying library GLFW, anything added in raylib side would be just a patch to circunvent GLFW issue.
from raylib.
Since the issue is in GLFW (the ticket you linked) we have to wait for them to fix it or use a different raylib core such as RGFW or SDL.
I had no success with changing raylib core to RGFW, but have tried RSGL alone, which uses RGFW. Unfortunately, it seems like there is the same issue. After closing a window, it hangs, freezes, and shows not desirable behavior.
If somebody interested, here is the code to reproduce the problem (based on RSGL/examples/basics/text.c
):
#include <stdio.h>
#define RSGL_IMPLEMENTATION
#include "RSGL.h"
int window_drawer__custom(void);
int main()
{
window_drawer__custom();
char input = '0';
while(input!='q')
{
input = getchar();
if ( (input != '\n') && input != EOF) { printf("input: %c\n", input); }
}
printf("finished. \n");
return 0;
}
int window_drawer__custom(void) {
RSGL_window* win = RSGL_createWindow("window 1", (RSGL_rect){500, 500, 500, 500}, RSGL_CENTER);
RSGL_setFont(RSGL_loadFont("Super Easy.ttf"));
for (;;) {
RSGL_window_checkEvent(win);
if (win->event.type == RGFW_quit)
break;
RSGL_drawText("Text example\nnewlines too", RSGL_CIRCLE(200, 200, 20), RSGL_RGB(255, 0, 0));
RSGL_window_clear(win, RSGL_RGB(255, 255, 255));
}
// RSGL_window_close(win);
// RGFW_window_close(win);
printf("\nRSGL window_drawer__custom : done \n");
return 0;
}
(font is inside the RSGL/examples
folder)
When // RSGL_window_close(win);
or // RGFW_window_close(win);
is uncommented, then window is normally closed, but application just finishes at that point, without going back to main()
.
While it stays commented, control goes back to main()
from the function, but window stays hanging.
So, switching to RSGL did not solve the problem, and I suppose raylib with RGFW under the hood won't do it either.
Don't know where to share that, hope it will save some time for somebody.
from raylib.
@raysolva Could you move the issue to the RGFW repo?
from raylib.
Related Issues (20)
- [core] Camera near/far values are hard-coded HOT 3
- [rcore][android] ALooper_pollAll has been deprecated on Android NDK Version 27 HOT 1
- [rmodels] access violation in UnloadMesh with mesh from GenMeshCube clone HOT 5
- [textures] Large image sizes (8192 x 8192) overflows GetPixelDataSize() HOT 11
- [rtext] Blurry text when drawing custom font to RenderTexture HOT 3
- [rtextures] `LoadImageSvg()` causes heap buffer overflow when reading from file HOT 3
- Minimizing the window causes a crash when using raylib 32 bit dll from Dolphin Smalltalk external interfacing HOT 1
- Backface culling now working HOT 3
- [build] next release version HOT 3
- [rcore] Provide FLAG_WINDOW_UNFOCUSED functionality for SDL backend HOT 1
- [Examples] Example "models_loading.c" does not build HOT 10
- [core] Memory leak when running first window sample (Nvidia Drivers on Linux) HOT 2
- [misc] statically linked raylib exposes functions from `src/external/*` HOT 11
- [WIP] [Examples] Update progress for v5.5 HOT 9
- [rcore] [desktop_GLFW] Window System Improvements HOT 9
- [docs] Documentation inconsistently uses Camera/Camera3D. HOT 2
- [rcore] Ability to rebind Capture/F12 hotkey HOT 1
- Request for a Evolve E2 85 Headset instead of the Evolve E2 65
- Truncating buffer in TextFormat might not work as intended HOT 2
- [rcore] Can't compile PLATFORM=PLATFORM_DRM GRAPHICS=GRAPHICS_API_OPENGL_21 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib.