Raylib 4.5 - Framerate somehow limited by monitor refresh rate #3041
-
No matter what I do, the FPS count will be no higher tah my monitor refresh rate: 75Hz Using 4.5 in C (compiling using N++, just the way it was downloaded this week, under Win10 (64) in a laptop with i7 (6gen) and nvidia 980m. Even not usin SetTargetFPS() or using a high value like 240 or whatever, I´ll get no more than 75 fps (even drawing a single moving circle)... and yes, when I draw 10k circles, it drops to like 10 fps... same speed I get with p5JS... so the fps seems right. With few balls, p5JS shows like 300fps, but raylib will nott go above 75, my monitor rate. The same result, measuring using getFPS(), calculation delta time or using GetFrameTime()... all 3 options I get the same values. Is it something my hardware? Vsync?? any trick I need to do to free it, like SetTargetFPS(-1)?? Another point: Using the exact same algorithm (very simple one, where I create arrays por random positions,radius, colors and velocities for N circles, draw de circles, apply velicity to change position, and check collision bith borders... child easy testing stuff, I get same performance for both C Raylib (desktop) and p5JS, BUT I get twice the performance (for any N, from 100 to 20000, does not matter) using Pygame2. I believe Pygame2 is using GPU, not old SDL anymore... also, I´m using standard interpreter, not Pypy, not compiling with Nuitka, not using jit through numba, not using numpy for the arrays, NOTHING... simply the very same translated simple code... and draws twice as fast. I was expecting C Raylib to be like 4x faster, not 0.5x I´ll try to paste the code later here, it´s local in another pc. I´ll try SetCofigFlags(FLAG_VSYNC_HINT) to disabe Vsync and see if it helps for my hw. Thank you guys!!!! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
meeting people half way with info on your hardware and OS will likely get you more help in future this issue is more complex than many people appreciate and the more information you can give the better. |
Beta Was this translation helpful? Give feedback.
-
ah! be careful with the 2d stuff, some of it isn't accelerated... sorry i missed your spec in the first post, not a windows user (except at work sigh) but I'd suggest digging around in the gpu settings... |
Beta Was this translation helpful? Give feedback.
-
I've just turned G-Sync off in NVIDIA Control panel, and now C Raylib is free to go above my monitor refresh rate! |
Beta Was this translation helpful? Give feedback.
ah! be careful with the 2d stuff, some of it isn't accelerated...
sorry i missed your spec in the first post, not a windows user (except at work sigh) but I'd suggest digging around in the gpu settings...