I've been doing some experimentation with the OpenGLContext in a sample app trying to figure out how to best organize things if I'd like to mix Juce components and OpenGL rendering. I started out by trying to attach an OpenGLContext to the app's main window, which subclassed DocumentWindow, and that seemed to cause some weird behavior with OpenGL rendering. Everything worked fine if continuous repainting was enabled on the OpenGLContext, but if that was turned off, the only way I could get things to repaint correctly was after my component hierarchy changed, I'd have to call triggerRepaint() on the OpenGLContext on a timer; if I waited 100 msecs to call triggerRepaint(), the OpenGL code would repaint correctly (except the background color I set wouldn't take); a timer between 50 to 100 msec would work sometimes, and a timer less tha 50 msec wouldn't work .
I figured out that if I attached the OpenGLContext to the DocumentWindow's content component instead everything was fine, but it took me quite some time to realize that was the problem. So, I wanted to point out that I stumbled on this. Maybe, there's a bug there that needs to be fixed. Or maybe, a note could be made about this in the attachTo() method of OpenGLContext. In any case I have some sample code showing the problem if that would be helpful.