moved openGL init to render pass