fix initialization order by passing renderer to setupOpenGL