We need some tweaks to OpenGL. Should be still in time, since the OpenGL stuff is ‘new’.
Everytime an OpenGLContext is being passed around, we should actually be able to pass an OpenGLContext::NativeContext.
All the user classes just seem to dereference it anyway,
Then: NativeContext needs to be tweaked a hair to be used as an offscreen context - essentially very close to the existing CachedImage class that uses an FBO.
To be honest the cachedImage stuff should probably all use a centralized Context anyway. Currently, a lot of cached images means a lot of contexts, as I read it. That’s not good OpenGL practice - the number of contexts and the times they are switched should be minimized, and also, the current design may not permit the same image to be used in different contexts without some sort of anchoring window.
Best would be to have an anchoring context to share, and cached images should draw in the context that is currently active, so there’s no context switch, then linked to the anchoring context.
Bruce