+ # set_icon needs to be called before set_mode on some platforms, but we
+ # can't use convert_alpha until we've created a window with set_mode
+ r = Loader('data')
+ r.CONVERT_ALPHA = False
+ icon_filename = 'robot_24.png'
+ # OSX accepts big icons, but scales up small icons smoothly
+ if sys.platform == 'darwin':
+ icon_filename = 'robot_512.png'
+ pygame.display.set_icon(r.get_image(icon_filename, basedir='icons'))
+