-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rcore] GetFrameTime() counts time since application was minimized #4588
Comments
All
Test case:
GLFW log (note how iconifying the window also stops `GetTime()`):
SDL log (note how iconifying the window doesn't stop processing):
|
Out of curiosity, I tried reproducing this issue directly with GLFW and the iconifying freeze didn't happen. GLFW test case:
Then I rolled back raylib as far as raylib 3.0.0 test case:
And then I returned to the current master branch (aeb33e6) and tested again removing raylib current master branch without SwapScreenBuffer test case:
So, looks like the issue is indeed with raylib ( |
Ok, found the issue. Inside the raylib/src/platforms/rcore_desktop_glfw.c Lines 1254 to 1255 in aeb33e6
Which is stopping execution because FLAG_WINDOW_ALWAYS_RUN is false by default. So, a simple SetWindowState(FLAG_WINDOW_ALWAYS_RUN); call solves this issue.
Fix test case:
@raysan5 Maybe the |
Wow well done, thanks for the fix! That being said, I think that ideally you should be able to set |
The It's much easier to just default it to |
Issue description
I'm using Raylib 5.0 with Rust but I'm presuming this is not a Rust specific bug. If it is then I'm sorry for wasting your time. If you minimize a Raylib application, when you unminimize the app, GetFrameTime() will return the total amount of time that has passed since you minimized the app. I feel like this probably shouldn't happen, anything that's moving based on frame time will move way too far when opening a minimized application, so you could probably clip through walls and stuff.
Environment
Raylib 5.0 with Rust (raylib-rs)
Windows 10
Platform backend: DESKTOP (GLFW)
Renderer: Intel(R) HD Graphics 530
Code Example
Just print GetFrameTime() to the console if it's more than one second, so something like:
The text was updated successfully, but these errors were encountered: