The primary way the system works is callbacks. For example, you may build a drawing routine called mydraw. You tell OpenGL to use mydraw to display the information. Then mydraw is called by OpenGL at the times you specified.
Your code the OpenGL engine your callback routines
---------------- _______________ _____________________
| pass name |name | | | |
| of routine |=====>| |-------->| |
| | | | call | |
| call OpenGL |----->| | return | |
---------------- call _______________ _____________________
return