title: How do draw to a texture in OpenGL
body: <p>Now that my OpenGL application is getting larger and more complex, I am noticing that it's also getting a little slow on very low-end systems such as Netbooks. In Java, I am able to get around this by drawing to a BufferedImage then drawing that to the screen and updating the cached render every one in a while. How would I go about doing this in OpenGL with C++?</p>
  
  <p>I found a few guides but they seem to only work on newer hardware/specific Nvidia cards. Since the cached rendering operations will only be updated every once in a while, i can sacrifice speed for compatability.</p>
  
  <pre><code>glBegin(GL_QUADS);
         setColor(DARK_BLUE); 
         glVertex2f(0, 0);                  //TL
         glVertex2f(appWidth, 0);           //TR
         setColor(LIGHT_BLUE);
         glVertex2f(appWidth, appHeight);   //BR
         glVertex2f(0, appHeight);          //BR
  glEnd();
  </code></pre>
  
  <p>This is something that I am especially concerned about. A gradient that takes up the entire screen is being re-drawn many times per second. How can I cache it to a texture then just draw that texture to increase performance?</p>
  
  <p>Also, a trick I use in Java is to render it to a 1 X height texture then scale that to width x height to increase the performance and lower memory usage. Is there such a trick with openGL?</p>