remoteMesh :: ByteString -> IO GFX.Mesh
remoteMesh name = do
    let toVInt :: V.Vector Int32 -> V.Vector Int
        toVInt = V.map fromIntegral
    p <- BinaryProtocol <$> hOpen ("localhost", PortNumber 9090)
    Mesh (Just attrs) (Just prim) idx <- downloadMesh (p,p) $ SB.unpack name
    return $ GFX.Mesh (map unpackAttribute attrs) $ case (prim,idx) of
            (PT_Points,Nothing)        -> GFX.Points
            (PT_TriangleStrip,Nothing) -> GFX.TriangleStrip
            (PT_Triangles,Nothing)     -> GFX.Triangles
            (PT_TriangleStrip,Just i)  -> GFX.TriangleStripI $ toVInt $ toV i
            (PT_Triangles,Just i)      -> GFX.TrianglesI $ toVInt $ toV i
            _                          -> error "Invalid primitive!"
remoteMesh :: ByteString -> IO GFX.Mesh
remoteMesh name = do
    let toVInt :: V.Vector Int32 -> V.Vector Int
        toVInt = V.map fromIntegral
    p <- BinaryProtocol <$> hOpen ("localhost", PortNumber 9090)
    Mesh (Just attrs) (Just prim) idx <- downloadMesh (p,p) $ SB.unpack name
    return $ GFX.Mesh (map unpackAttribute attrs) $ case (prim,idx) of
            (PT_Points,Nothing)        -> GFX.Points
            (PT_TriangleStrip,Nothing) -> GFX.TriangleStrip
            (PT_Triangles,Nothing)     -> GFX.Triangles
            (PT_TriangleStrip,Just i)  -> GFX.TriangleStripI $ toVInt $ toV i
            (PT_Triangles,Just i)      -> GFX.TrianglesI $ toVInt $ toV i
            _                          -> error "Invalid primitive!"
remoteMesh name = do
    let toVInt :: V.Vector Int32 -> V.Vector Int
        toVInt = V.map fromIntegral
    p <- BinaryProtocol <$> hOpen ("localhost", PortNumber 9090)
    Mesh (Just attrs) (Just prim) idx <- downloadMesh (p,p) $ SB.unpack name
    return $ GFX.Mesh (map unpackAttribute attrs) $ case (prim,idx) of
            (PT_Points,Nothing)        -> GFX.Points
            (PT_TriangleStrip,Nothing) -> GFX.TriangleStrip
            (PT_Triangles,Nothing)     -> GFX.Triangles
            (PT_TriangleStrip,Just i)  -> GFX.TriangleStripI $ toVInt $ toV i
            (PT_Triangles,Just i)      -> GFX.TrianglesI $ toVInt $ toV i
            _                          -> error "Invalid primitive!"