Design a site like this with
Get started

Setting up a Qt 5 CMake project for Visual Studio and Linux

CMake is cool, Qt is cool. Both together not so, if you don’t know what you’re doing. This describes how to build a Qt project CMakeLists.txt so everything works and how to run / debug your application in Linux and Visual Studio. Make sure to additionally check out the Qt5 CMake docs and the CMakeContinue reading “Setting up a Qt 5 CMake project for Visual Studio and Linux”


Decompose the OpenGL projection matrix

Sometimes you need to decompose the OpenGL projection matrix into its original components to adjust some values. Here’s how to do that. I found a thread on stackoverflow on the subject. The formulas there are in row-major format though, but OpenGL is column-major, so they need to be swapped around: For a perspective matrix: ForContinue reading “Decompose the OpenGL projection matrix”

Useful CMake functions

CMake is a great tool, but I always keep searching on how to do this and that. Time to make a list again… Checking the G++ compiler version: Appending entries to a list: Creating filters in Visual Studio projects: Custom install commands To print a message during the install process add: To run a shellContinue reading “Useful CMake functions”

Useful C++ tricks and helper functions

My brain sucks. It can remember the lyrics to songs or the power draw of a electronic component, but I keep forgetting those simple, useful helper functions you sometimes need. This sends me off Google again, searching through excellent sites like StackOverflow etc. Time to make a list… Remove characters from a string: Replace charactersContinue reading “Useful C++ tricks and helper functions”

Installing and switching gcc/g++ versions in Debian

Installing newer gcc/g++ versions is easy: If your system does not provide the new versions, you might still be able to get them via a different repository. Add the toolchain repository to your system and update your sources: Now you should be able to install gcc/g++. The real problem comes after that. How to makeContinue reading “Installing and switching gcc/g++ versions in Debian”

Reading the OpenGL backbuffer to system memory

Sometimes you are in the need to read back the OpenGL backbuffer, or other framebuffers. In my case the question was how to read back a downsampled framebuffer resp. its texture to system memory. There are different methods for this and I wrote a small benchmark to test them on various systems. UPDATE #1: AContinue reading “Reading the OpenGL backbuffer to system memory”

Writing a DLL containing C++ classes

Putting functions into a DLL is a good thing. It helps you to reuse stuff, save space on updates, save build time etc. To write a DLL the proper way you have to keep some things in mind though. Those hints are basically the “best-practice” from this page. A DLL is a library, a collectionContinue reading “Writing a DLL containing C++ classes”