title: How to draw a framebuffer object to the default framebuffer
body: <p>This code is supposed to clear the background with yellow color using framebuffer object and render buffers but what I get is black background.</p>
  
  <pre><code>#include &lt;SDL2/SDL.h&gt;
  #include &lt;GL/glew.h&gt;
  
  int main( int argc, char** argv)
      {
      SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 3);
      SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 3);
      SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
      SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1);
      SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1);
  
      SDL_Window* gWindow= SDL_CreateWindow( "Title",
          SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
          500, 500, SDL_WINDOW_OPENGL);
      SDL_GLContext gContext= SDL_GL_CreateContext( gWindow);
  
      glewExperimental= GL_TRUE;
      glewInit();
  
      GLuint fbo;
      glGenFramebuffers( 1, &amp;fbo);
      glBindFramebuffer( GL_FRAMEBUFFER, fbo);
  
      GLuint color_rbr;
      glGenRenderbuffers(1, &amp;color_rbr);
      glBindRenderbuffer( GL_RENDERBUFFER, color_rbr);
      glRenderbufferStorage( GL_RENDERBUFFER, GL_RGBA32UI, 500, 500);
      glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, color_rbr);
  
      GLuint depth_rbr;
      glGenRenderbuffers( 1, &amp;depth_rbr);
      glBindRenderbuffer( GL_RENDERBUFFER, depth_rbr);
      glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, 500, 500);
      glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depth_rbr);
  
      if( glCheckFramebufferStatus( GL_DRAW_FRAMEBUFFER)!= GL_FRAMEBUFFER_COMPLETE)
          return 1;
      if( glCheckFramebufferStatus( GL_READ_FRAMEBUFFER)!= GL_FRAMEBUFFER_COMPLETE)
          return 2;
  
      glViewport( 0, 0, 500, 500);
      glClearColor( 1, 1, 0, 0);
      SDL_GL_SetSwapInterval( 1);
  
      int quit= 0;
      SDL_Event event;
      glReadBuffer( GL_COLOR_ATTACHMENT0);
  
      while( !quit)
          {
          while( SDL_PollEvent( &amp;event))
              if( event.type== SDL_QUIT)
                  quit= 1;
  
          glBindFramebuffer( GL_DRAW_FRAMEBUFFER, fbo);
          glDrawBuffer( GL_COLOR_ATTACHMENT0);
          glClear( GL_COLOR_BUFFER_BIT);
          glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0);
          glDrawBuffer( GL_BACK);
          glBlitFramebuffer(
              0, 0, 500, 500,
              0, 0, 500, 500,
              GL_COLOR_BUFFER_BIT, GL_NEAREST);
          SDL_GL_SwapWindow( gWindow);
          }
      SDL_DestroyWindow( gWindow);
      return 0;
      }
  </code></pre>
  
  <p>It first clears the framebuffer object with the specified color then blits the framebuffer object to the default framebuffer. Is there something wrong in the code? I can't seem to find where exactly the problem is.</p>