Added functions for converting between screen and surface coordinates