In my application, I have ResliceCursourWidget (3 genericRenderWindows) + a genericRenderWindow to display 3 3D actors,
In this application the users may have many interactions with those renderWindows, (change the Reslice center, the colorWindow, colorLevel…)
Also I’m deleting actors / renderWindows to display others depending on what the user picks
Sometimes all work just fine, but sometimes I’m getting this Warning:
RenderWindow.js:248 WARNING: Too many active WebGL contexts. Oldest context will be lost.
and the the ResliceCursourWidget renderWindows stop displaying actors, and they become just white …
My two cents: you reached your browser’s limit. Chromium, for instance, has a limit of 16 contexts if I’m not mistaken. Other browsers likely have limits in the same order of magnitude. So, I believe you have to design your application to make use of fewer contexts (one is ideal). BTW, why do you need so many contexts? Take a look at this: javascript - Allowing more WebGL contexts - Stack Overflow
Thank you so much for your answer, yes what you said looks convenient,
Sorry I didn’t specify it before,
In my application I have a X number of patients, each patient has 3 files (A brain-MRI.vti, a brain-segmentation.vtk and a face-surface.vtk)
The user can choose from the list of patients a patient to display, so I charge the N patient files and I delete what is previously rendered (N-1) in order to render the new actors, (I delete the actors, mappers, widget (ResliceCursorWidget) and the OpenGLRenderWindow and the GenericRenderWindow),
I don’t know if this the right way to do it,
PS: in the 3D view I have:
PLANS VIEW: Plans actors + Sphere actor
CERVEAU VIEW: Polydata actor + Sphere actor
PEELING VIEW: 2 Poly data actors + Sphere actor