Refactored gfxdemo to use threeDlib