{
Render_Engine_GL_Context *ctx = current_evgl_ctx;
+ if (!ctx)
+ {
+ ERR("No current context set.");
+ return;
+ }
+
// Take care of BindFramebuffer 0 issue
if (framebuffer==0)
{
if (gl_direct_enabled)
glBindFramebuffer(target, 0);
- else if (ctx)
- {
- glBindFramebuffer(target, ctx->context_fbo);
- ctx->current_fbo = 0;
- }
+ else
+ glBindFramebuffer(target, ctx->context_fbo);
+ ctx->current_fbo = 0;
}
else
{
glBindFramebuffer(target, framebuffer);
// Save this for restore when doing make current
- if (ctx)
- ctx->current_fbo = framebuffer;
+ ctx->current_fbo = framebuffer;
}
}