added rendering loop with hooks into rendering pipeline