void PipelineState::set_framebuffer(const Framebuffer *f)
{
- set(framebuffer, f, FRAMEBUFFER|VIEWPORT);
+ set(framebuffer, f, FRAMEBUFFER);
}
void PipelineState::set_viewport(const Rect *v)
}
}
- if(mask&VIEWPORT)
+ if(mask&(VIEWPORT|FRAMEBUFFER))
{
if(viewport)
glViewport(viewport->left, viewport->bottom, viewport->width, viewport->height);
glBlendEquation(get_gl_blend_equation(blend->equation));
glBlendFunc(get_gl_blend_factor(blend->src_factor), get_gl_blend_factor(blend->dst_factor));
glBlendColor(blend->constant.r, blend->constant.g, blend->constant.b, blend->constant.a);
+ ColorWriteMask cw = blend->write_mask;
+ glColorMask((cw&WRITE_RED)!=0, (cw&WRITE_GREEN)!=0, (cw&WRITE_BLUE)!=0, (cw&WRITE_ALPHA)!=0);
}
else
+ {
glDisable(GL_BLEND);
+ glColorMask(true, true, true, true);
+ }
}
last_applied = this;