Convert surface.cpp to surface.c