Category: Tetzle (Page 2 of 5)

Tetzle says goodbye to OpenGL

Posted on June 22, 2024, under Tetzle

Many long years ago I tried using QGraphicsView to make a simple puzzle game. But I found it to be unbearably slow, possibly because I wasn’t using it correctly. Who knows. So I decided to use OpenGL to accelerate the graphics. After all, OpenGL is all about accelerating graphics! And all was good.

Well, sort of. OpenGL is not the easiest to work with. And it changed a lot over the years, forcing me to mimic my use of the old fixed-function pipeline with the newer programmable pipeline. Tetzle’s code has always been a bit hard to debug because, well, again, OpenGL is not the easiest to work with. It has also caused many issues for users over the years that I have sadly not been able to solve.

Plus, it never really sat well with me that my simple 2D puzzle game used a graphics framework that is better suited to 3D gaming. Sure, you can accelerate 2D graphics with it, but it is overkill. Especially with modern CPUs. This is just blitting 2D graphics, for sanity’s sake!

So! Every few years I would think about porting Tetzle away from OpenGL, sift through the old code I have archived, look at the mess of the QGraphicsView version and think, “Maybe later.” And, of course, later never came.

Until now.

Because Qt 6.7 doesn’t work with the current Tetzle code. Well, it does if you run Tetzle as OpenGL 1.1 or 1.3, which is just absurd. And not supported everywhere, since it’s the old fixed-function pipeline that was dropped years ago. Instead of spending time fixing it, I decided: “Now. Now is the time to finally get Tetzle free from OpenGL’s clutches.”

But…

I still didn’t like the idea of trying to clean up the ancient QGraphicsView code that bore absolutely no resemblance to the current game. And then I had a brainwave: why not just use QPainter? It has an interface close enough to how I was using OpenGL that I can reuse most of the current code, and everything should Just Work™. And… it does! 🎉

It is embarrassing just how easy it was to get Tetzle free from OpenGL. I should have looked at QPainter before, since I do use it for some of my games instead of QGraphicsView. Hindsight is 20/20, and all that. In less than 24 hours from the initial idea, I am pleased to say that future releases of Tetzle will no longer require OpenGL!

I was planning on following the new format for the release announcements, but since almost every single app has the same changes, it would be quite repetitive. I updated basically every single program to have better installers on Windows and the Mac, and fixed the compile process to not have extra warnings during release builds.

The important thing is that I updated to Qt 5.11, and this means that FocusWriter should be able to save to Dropbox! I say should because the bug report is closed as fixed, but I don’t use Dropbox so I can’t test for myself. Enjoy!

I just realized I forgot to announce the releases I made at the beginning of the month! Oops. This poor, neglected blog.

I updated all of my projects, and for the most part it was a very minor release that fixed an installation bug in Linux or updated the translations. Of course, FocusWriter had a few more fixes than the rest, but that is to be expected as it is a much more complicated program. And Tanglet actually had a feature release, thanks to Markus Enzenberger. If you have not yet updated, enjoy!

Over the past week and a half, I have made releases for all of my projects. Most of them were pretty minor, and just amounted to updating the translations (and fixing an issue where the Qt-supplied translations were not being properly loaded). Packagers will now need to depend on lrelease, because I no longer include the precompiled binary .qm files.

The projects with actual feature releases were CuteMaze, Hexalate, Tanglet, and Tetzle. For the most part, the features added will not be obvious unless you have a 4K monitor, because the biggest thing I added was support for high-DPI displays. I did also finish moving my projects to be Qt 5 only, and to use C++11.

As usual, report any issues you have. Enjoy!

Categories