Design a site like this with
Get started

Compiling SDL2 / image / mixer / ttf for the Raspberry Pi without X11

If you want accelerated SDL2 graphics when on the console, e.g. on Raspbian Lite you don’t want to use X11. You could get away with just installing SDL2 from the repository, but my SDL2 version had problems regarding touch screens, so I needed to recompile. Also if you install any of the libsdl2* libraries aContinue reading “Compiling SDL2 / image / mixer / ttf for the Raspberry Pi without X11”

(My personal) git cheat sheet

Create a repository from existing code and push it to remote Change into your code sub-directory and do: git init git add . git commit -m “First commit” git remote add origin https://REMOTE_HOST/REPO_NAME.git git push -u origin master Change a repositories origin remote url This is useful if you have cloned a remote repository, changeContinue reading “(My personal) git cheat sheet”

Running GUI applications over SSH on a Raspberry Pi

Sometimes you have a RPi attached to a screen, but no keyboard or mouse attached and want to run GUI applications on it via SSH. This will also let you cross-compile RPi applications on a development machine and test them on the real machine. Prepare the RPi for ssh access To enable SSH access onContinue reading “Running GUI applications over SSH on a Raspberry Pi”

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”

Calculate Catmull-Rom splines using forward differencing – UPDATE

I finally had the time to finish this post by whipping up a small JavaScript canvas example to show forward differencing in action. Not much to see there, actually, other than that the regularly drawn spline and the one drawn with forward differencing look the same. Here’s the part of the code that does theContinue reading “Calculate Catmull-Rom splines using forward differencing – UPDATE”