Maybe it will help someone: We need to put (surface->format)->format into the function.
(surface->format)->format