Hello, I’ve been following Lazy Foo’s SDL2 tutorials and making games in Windows for a while now. The SDL stuff has always ran flawlessly on Windows. However, I recently got a Chromebook and installed Ubuntu xfce on it so I could test my games on a different operating system and with low computer specs and so I could use Valgrind to find memory leaks.
So I downloaded Lazy Foo’s Scrolling program, changed all instances of NULL to nullptr, and compiled it on my Linux build. However, when I ran the program, there were some problems. I could see each individual frame and the dot was jumping quite a distance each frame. Worse, a white line was continuously flashing at the top of the window.
I then modified the program to remove vsync and cap the frame rate manually to 60 fps like in Lazy Foo’s Capping Frame Rate tutorial. When I ran that program, the white flashing was gone and the dot moved more smoothly, but the program ran slower.
Worse, Valgrind is detecting memory leaks in both programs. Does anyone know where they might be?
Does anyone know what could be wrong with my Linux programs? How do I get them to behave like their Windows counterparts?
If anyone wants me to post the programs or videos of the programs in action, let me know and I’ll do it.