Global callbacks called when OpenGL context (like Lazarus TCastleControl or TCastleWindow) is open/closed. Useful for things that want to be notified about OpenGL context existence, but cannot refer to a particular instance of TCastleControl or TCastleWindow.
Note that we may have many OpenGL contexts (TCastleWindow or TCastleControl) open simultaneously. They all share OpenGL resources. OnGLContextOpen is called when first OpenGL context is open, that is: no previous context was open. OnGLContextClose is called when last OpenGL context is closed, that is: no more contexts remain open. Note that this implies that they may be called many times: e.g. if you open one window, then close it, then open another window then close it.
Callbacks on OnGLContextOpen are called from first to last. Callbacks on OnGLContextClose are called in reverse order, so OnGLContextClose[0] is called last.