CsGL-based texture and rotation code