The CPU and the GPU

In summary, here are all of the steps needed to configure the GPU to render a 3D model.

These are initialization tasks. Once done, they should not be repeated.

  1. Initialize the GL context
  2. Initialize the program object
  3. Initialize the buffer objects
  4. Copy vertex data to the GPU
  5. Copy triangle data to the GPU

These are the attribute setup tasks. If the application is trivial and renders only a single model, then it suffices to perform these tasks only once during initialization. However, if multiple models are drawn then these steps must be repeated for each model each frame.

  1. Bind the buffer objects
  2. Set the vertex attribute pointers
  3. Enable the vertex attributes

This, finally, is the rendering task. It must be done for each frame.

  1. Draw the triangles