add clipping, still buggy
clean up renderer.cpp