I always had an issue with the OnPaint event not working for TOpenGLControl thus forcing me to use its parent's OnPaint event together with calling Invalidate on said parent. This was only an issue on Linux, while the OnPaint worked fine for TOpenGLControl on Windows. For the longest time this workaround worked fine. That is until I decided to update my Nvidia drivers from the older 535 version to the recommended 550 version on Linux Mint.
At first, the redrawing rate dropped tremendously when only using Invalidate. Alongside the performance drop, the OnPaint event seemingly began to work on the TOpenGLControl. Since I do all my redraw calls from a separate function which basically only calls Invalidate, if I force redrawing the control instead of invalidating it, everything redraws smooth as butter, but I'm wasting a lot of redraws since the way I have programmed till now was to overuse Invalidate calls on the assumption that despite the many calls it would redraw only once.
Am I abusing the Invalidate call/using it incorrectly? It's basically called on every mouse move event, and since it now chugs the most when I move my mouse a lot, I assume I'm doing something bad to the event queue? Like I mentioned before, it wasn't an issue before I updated my Nvidia driver since I haven't changed any of my code prior or just after the driver update.
---
Not really related to the issue, but after the Nvidia driver update my whole system runs way smoother and the screen isn't tearing as much as before despite having VSync off. Imagine my surprise when my own program started to chug like crazy lol
Edit:
I guess I rushed with my post. The OnPaint and Invalidate not working on TOpenGLControl was only a problem when I was still using SDL2. I recently replaced it with pure OpenGL 2.1 and apparently it works with both the older and newer Nvidia drivers.
Apparently reinstalling the Nvidia drivers for the third time either fixed something, or there was some issue with my Linux Mint install that is now gone, because only after reinstalling the drivers once again and not changing any of my code, it's working fine again. Go figure.