from geometry to pixels

Code Bits

Hacking 3D Touch Support into SDL2

I was playing around with SDL2 recently as it allows for simple cross platform development between desktop OSes (Linux, Windows, MacOS X) and even Android and iOS. Not using the native APIs has the disadvantage that new features are not available instantly and this is also the case for 3D Touch (aka ForceTouch) of the […]


, ,

(Simulating) KHR_debug on MacOS X

KHR_debug makes finding errors in OpenGL applications much simpler than the old glGetError method. Sadly, Apple does not yet support KHR_debug (or any other debug extension) natively in OS X 10.8 and it doesn’t look too well for 10.9 either. On most other systems the latest drivers will provide KHR_debug either as an extension or […]


, , , ,

OpenGL debugging with KHR_debug

Debugging OpenGL has always been a bit painful. In most cases an OpenGL error will just result in the offending call being ignored (unless the problem was too little memory, in which case anything could happen). To get informed of the problem, the application had to query an error number for OpenGL to get the […]


, , , , , ,

Adding analog inputs to your graphics app

When prototyping graphics applications it doesn’t take long until you want to control some parameters during runtime. Using the keyboard is often the first candidate as getting keystrokes is very easy for most toolkits used in graphics like GLFW or GLUT. But it doesn’t take long until the number of keys it so large that […]


, ,


I just needed a simple app to see what CUDA version is installed on a remote machine and what the GPU is capable of. My trivial solution compiles with nvcc -lcudart -o cudainfo and only consists of one file:   #include <iostream>   using namespace std;   void printDeviceProperties( int deviceNumber, cudaDeviceProp deviceProperties ) […]


, , ,

Photoshop Blendmodi in GLSL

I once wrote a texturing tool in which you could paint on a 3D model on multiple layers. These layers were composing the final texture just as you know it from photoshop, complete with alpha, opacity slider and: blend modes. these blend modes are quite simple to implement and it can be useful to use […]


, , , ,