title: OpenGL: how to unbind a render buffer
body: <p>Using Frame Buffer objects, I have created render buffers for color and depth and attached them to the FBO.</p>
  
  <pre><code>//set up color buffer for rendering
  glGenRenderbuffers(1, &amp;my_fbo_params.color_rb[i]);
  glBindRenderbuffer(GL_RENDERBUFFER, my_fbo_params.color_rb[i]);
  glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB565, width, height);
  glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,           my_fbo_params.color_rb[i]);
  
  //set up depth buffer
  glGenRenderbuffers(1, &amp;my_fbo_params.depth_rb[i]);
  glBindRenderbuffer(GL_RENDERBUFFER, my_fbo_params.depth_rb[i]);
  glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
  glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, my_fbo_params.depth_rb[i]); 
  </code></pre>
  
  <p>This is all fine and working good. 
  When I proceed to the next scene, I want to keep the color buffer but detach and unbind the depth buffer. 
  I learnt that the following code will do the detach:</p>
  
  <pre><code>glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0); 
  </code></pre>
  
  <p>But how can I unbind the depth buffer while keeping the color buffer intact?</p>