Moved rendering from main to the render window class