// save the current viewport and set the new
gl.glPushAttrib(GL2.GL_VIEWPORT_BIT);
gl.glViewport(0, 0, floorWidth, floorHeight);
// bind the FBO
gl.glBindFramebuffer(GL2.GL_DRAW_FRAMEBUFFER, frameBufferID[0]);
int[] attachmentID = new int[1];
attachmentID[0] = GL2.GL_COLOR_ATTACHMENT0;
gl.glDrawBuffers(1, attachmentID, 0);
// clear
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
gl.glBlendEquation(GL2.GL_MIN);
gl.glColor3f(0.0f, 0.0f, 0.0f);
// render
gl.glBegin(GL2.GL_TRIANGLES);
gl.glVertex3f(0.0f, 1.0f, 0.0f);
gl.glVertex3f(1.0f, 0.0f, 0.0f);
gl.glVertex3f(0.0f, 0.0f, 0.0f);
gl.glEnd();
gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, 0);
gl.glReadBuffer(GL2.GL_BACK);
gl.glDrawBuffer(GL2.GL_BACK);
// restore viewport
gl.glPopAttrib();