Hey! raylib forum is closing!
After a year with not much movement in the forum I decided to close it.
The cost of maintaining the hosting is a bit high for the usage of the platform, updating the forum and managing it is also a bit cumbersome and the truth is that I'm already trying to maintain multiple other networks pretty more active than this forum.
I'll recommend you to move to the other raylib networks:
- For a forum style, use Reddit: https://www.reddit.com/r/raylib/
- For direct messaging and questions, use Discord: https://discord.gg/VkzNHUE
- To report issues, use GitHub: https://github.com/raysan5/raylib
- Also, remember you can contact me personally on Twitter: https://twitter.com/raysan5
or directly by mail to ray[at]raylib.com
If you feel generous, you can also contribute to the project on my Patreon: https://www.patreon.com/raylib
Thanks to you all for joining the project and help to improve it with your questions. Keep it up! :)
PD. Closing will be effective by October 31th.
Performance quirk with BeginTextureMode()
On a RaspberryPi 3 i have been using BeginTextureMode() to draw a framebuffer and had it running inside of a game loop with 2d and 3d graphics in it. However i noticed that as soon as i did anything to the framebuffer (Even as simple as writing a single character of text) made it slow down so it could never keep 60 fps.
I toggled a GPIO pin in the game loop so that i could time how long things take using a oscilloscope. However i soon found out that OpenGL does everything at its own pace at the end of the frame, including waiting tor frame sync so it didn't tell me much. To fix that i added a call to glFinish() right after and that let me measure frame render time.
I tried drawing the framebuffer both before everything else or between the BeginDrawing() EndDrawing() and it had no effect. Also found that calling glFinish() between those causes graphical glitches. However when i called glFinish() after i was done with drawing my framebuffer and before BeginDrawing() the performance came back to a solid 60fps. Infact if i looped my framebuffer drawing function 10 times, but still resulted in a higher FPS than if i called it just once without the flFinish trick. Even if the 10 passes draw lots of textures while the single pass draws a single text character its still faster to do those 10 passes.
Later on i found out that glFlush() works just as well while not halting the program so the CPU can be used to do useful stuff in that time.
Does anyone have an explanation of why performance would drop so badly when using a framebufer and why glFlush() somehow fixes it? The hack of calling glFlush myself works fine for me, but im putting it out there in case someone else runs in to the same issue.