Fixed all the bugs (i think). Now trying to minimize the datatransfer between kernels and opengl. Might also try to map openGL pointers using CUDA.