I’m currently working on a app that needs 4 or more OpenGLComponents, all located in the same main app window.
I’m using some extra Timer thread to make the OpenGLComponents animate smoothly. Actually I use my own OpenGLComponentEx class, but it’s more or less the same as the JUCE one.
Now my problem: The more OpenGLComponents are on the screen, the slower the animations get. It has nothing to do with the rendering complexity, but it seems that the OpenGL context switching is the culprit. I have tried to share the contexts between each other, but performancewise it didn’t change anything. The only true solution I could imagine is to create an OpenGLComponent type that uses the whole app’s main window size, but whose viewport would be adapted to match the different rectangular areas for drawing as it is being drawn. Is this idea something that is feasible (remember, there will be other components, probably laid over that OpenGL component), or is this approach completely irrealistic? Or maybe, is there another approach, much more simple, I’m not thinking of?
Correct me if I’m wrong, but AFAIK one OpenGL context is always bound to one native window (DC - device context), so it’s not possible to use the same OpenGL context with different native windows.