Maximum size of a GLJPanel

Is there a way to retrieve the maximum size that can be set for a GLJPanel?

If I try to resize a GLJPanel with a very huge size (for example 10000 x 10000), as anyone can except, it fails.
That’s not a problem under windows because it only raises an OutOfMemoryException.
I can catch it and fall back to the previous size.

However, under Linux (with a Nvidia card, I didn’t test with other cards), it seems to also corrupts the GLContext.
I’ve got the excpetion: javax.media.opengl.GLException: Error making context current. Afterwards, I’m not able
to use any JOGL instructions anymore. Even with a new GLJPanel, tt always raises the previous excetion and then crashes the JVM.

I’m looking for a solution to prevent the behaviour under Linux. If I could find the maximum size for a GLJPanel, I could prevent the exceptions to appear.
Or maybe someone has already experienced such a preoblem and found a solution.

Thanks in advance,
Jean-Baptiste

I’m not sure of the details of GLJPanel, but it may be related to the maximum size of a texture. May I also ask why you need a window that is 10000 x 10000, what monitor allows for that screensize?

This should be bound by GL_MAX_VIEWPORT_DIMS and GL_MAX_RENDERBUFFER_SIZE (I am not sure about that, though). See http://mr.myogl.org/index.php?sid=&m=spit for your values.

That’s what I was looking for :slight_smile:

Thank you very much, I will try these two constants.

For information, I need to limitate the size because in my application (Scilab), users can specify the GLJPanel size.
I’m sure that nobody wants a size of 10000 x 10000, but if someone make a mistake it should not crash the whole application.

I’m now using the min of the two values and I haven’t errors any more.
On my computer, GL_MAX_VIEWPORT_DIMS is [32000, 32000] and GL_MAX_RENDERBUFFER_SIZE is 4096.

This far more tha, what I really need.

Thanks again.

Jean-Baptiste