Basic rendering and math functions