duration = 0.0 image_saved = False def render_scene(): tile = next_tile() if tile is None: global image_saved if not image_saved: film = ren.get_film() film.tone_map() blt_float_img_to_window(0, 0, film.image, win) save_image(film, "Image5.png") image_saved = True return start = time.clock() path_tracer(tile) end = time.clock() global duration duration = duration + (end - start) print(tile, duration) film = ren.get_film() blt_float_img_to_window(0, 0, film.image, win) win = renmas.gui.MainWindow(600, 400, "Test") win.redraw() win.render_handler(render_scene) winlib.MainLoop()
def main_loop(): winlib.MainLoop()