So, I finally managed to do it somehow. I am pretty sure that my code is not elegant and there's a big room for optimizations. Particularly, I didn't understand why we need all those opaque , picture and plane parameters in callbacks. But at least it works. Oh, and it's in Pascal. All corrections ar...