Multiple GLCanvas on one JFrame

hi

I have a small application with four GLCanvas objects. Each one resists in a JPanel with GridLayout(1,1) and these are added to Separators, so that I get a similar view to a 3DModeler application (three with wireframe mode, one textured). This model is put onto a JFrame. Everything is rendered from the same (dedicated) rendering thread.

Unfortunately this application doesn’t live longer than exaclty three frames. When the fourth frame is to be rendered, the app makes problems or even crashes.

On my Linux machine (Java 6, Java 5, ATI proprietary drivers) the following message is dumped to stdout:


fglX11AllocateManagedSurface: __FGLTexMgrAllocMem failed!!

On my Windows machine (Java 5, NVIDIA) the app crashes with a HotSpot error.

Is there anything, that needs to be paid attention to (needs to be done) when more than one GLCanvas is used at the same time or when they are on a JFrame?

Any help would be appreciated. Thanks in advance.

Marvin

No, nothing special needs to be done for this case. I’ve seen some repainting problems on Intel integrated graphics chipsets with multiple GLCanvases in the same Frame but these clear up when you force a repaint. I suspect your app is incorrectly sharing OpenGL textures between contexts which were not set up to share textures and display lists, or something similar. The DebugGL may help, though the hs_err backtrace should give you an indication of which OpenGL call in your app is encountering the first major problem.

I am also facing the same problem .

I have created Multiple Canvas ,each having its own View , Universe etc.
All the canvases share the same scene -Graph that is share Same BranchGroup.

I am calling these Multiple View --> view.renderOnce() method in separate threads.

Everything is working fine , I am able to display my scene in different Canvas on a single Panel with different View direction.
I am using Intel Graphics Card : version 6.14.10.3691.

But when i run the same code on newer version of Graphics Card say :6.14.10.4543
my application crashes with error message.


#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0bdf4938, pid=1176, tid=2972
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-rc-b104 mixed mode, sharing)
# Problematic frame:
# C  [ialmgicd.dll+0x84938]
#
# An error report file with more information is saved as hs_err_pid1176.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

Is this because of Incompatibility of Intel newer Graphics Card with JOGl .

Again, I strongly suspect incorrect OpenGL code (in Xith?) in the case where multiple GLCanvases are viewing the same scene, not a bug in JOGL specifically. The demos.testContextSharing.TestContextSharing test in the jogl-demos workspace can be used as something of a stress test if you repeatedly click the “swap components” button; does that demo run correctly?

I will check it out. Thanks for the hint.

Yaa Marvin , Russell is right as today only i tried my example but without sharing the Branch-Group and it
was running fine on newer Intel Graphic Card .

So the problem is when we share a Branch-Group and render it with two views on different canvases.
It has nothing to do with JOGL part .

I haven’t looked into Xith rendering but i feel that its because sharing of memory in
texture rendering .

Then let’s put this topic into the Xith-forum: http://www.java-gaming.org/forums/index.php?topic=15643.0

Marvin