public void bindFramebuffer(int fbuf, int width, int height) { if (fbuf != lastFramebuffer) { flush(true); // flush and deactivate any shader rendering to the old framebuffer checkGLError("bindFramebuffer"); bindFramebufferImpl(lastFramebuffer = fbuf, curFbufWidth = width, curFbufHeight = height); } }