Wednesday, 17 January 2024

Double trouble

Teemu 1.3 is in testing phase mainly, not much to change in gameplay, although there are some things still unfinished. I wrote a python script which successfully compiles Teemu in both Linux and OSX, although in OSX I had to compile and setup SDL2 from the source code which was tedious, because the wiki doesn't really tell the proper setup information, which I found from a random youtube video as always.

After testing Teemu in OSX and Linux I learned after 15 years of using SDL2 that it has a double buffer drawing. For whatever reason my Windows 10 PC which is my main development computer the second buffer always had the same data as the first, so I never noticed it. This means that all my carefully crafter drawing routines has to go and replaced with routines that make sure the entire area of the screen is always redrawn every time.

Luckily Teemu has extremely simple graphics routines so there isn't that much to rewrite, but some things need more graphical approach since it will be slower to use text output to draw background stuff.

I know some may be wondering how the source code compiled in different platforms. It was quite hilarious, because there were no errors, only couple of warnings. Linux gcc found one extra warning (I used -Wall) and OSX found two other warnings. Not bad.