- auto gl = mController.GetGL();
- gl->BindFramebuffer(GL_FRAMEBUFFER, mFramebufferId);
+ auto context = mController.GetCurrentContext();
+ auto gl = mController.GetGL();
+
+ if(gl && context)
+ {
+ context->BindFrameBuffer(GL_FRAMEBUFFER, mFramebufferId);
+ }