When I use OpenGLContext::copyTexture and any paint() methods in the same app I get a crash. I can reproduce this (using latest JUCE) when running on OSX and iOS - I haven't tested yet on other platforms.
To reproduce:
* Set up new GUI project and set MainComponent to be an OpenGLRenderer and attach a context.
* Add a child component that uses the Graphics methods in it's paint (i.e stroking a path).
* Create OpenGLTextures when context is created
* Copy OpenGLTexture in the draw method
I then get a crash in juce_OpenGLGraphicsContext line 1249 (glDrawElements).
I've written some of my own OpenGL to test what the cause is and found that calling
Just saying what you've done in that way doesn't really help - you could have made all kinds of mistakes that would cause a crash.. If you can post some code that actually reproduces the problem, we could take a look.
You can't do openGL directly in paint() - at that point the juce rendering system doesn't expect you to mess around with the GL context state. Do your actual GL function calls only inside renderOpenGL, and in paint() just stick to juce Graphics commands.
What's the best way to use custom OpenGL in multiple different components?
I guess I could subclass Component and add a renderGL() method then build my hierarchy from those. I'd then probably have to write something to mark bits of the screen dirty unless I just constantly redraw everything.