refactored to build polygon and sprite rendering system and change api of GL renderer to flush both separately