Exception creating Canvas

I am running RedHat 9.0 using the Sept. 5th Jogl binaries, and the default Linux graphics drivers.

I recently debugged the following exception to trying to create a GLCanvas with some cababilities that the graphics driver can’t fulfill. In particular, if I request stereo buffers, then I get the expected “GLException: Unable to select one of the provided GLCapabilities.” But, if I request a stencil buffer (non-zero stencil bits) or request over 6 alpha bits for the color buffer, I get the following error. Strangely though, requesting a seemingly unreasonable number of depth buffer bits doesn’t have this effect (requesting 100 depth buffer bits does not result in an exception).

I am wondering if Jogl uses some method to determine if the canvas specified by the GLCapabilities can be provided and either returns it or the closest thing to it. Or if it is up to the client to make this decision. Judging from the error, it seems to be the latter. If that’s the case, are there any plans to provide this functionality?

The problem is that I vaguely know what my graphics card is capable of, but I haven’t installed the matching vendor drivers, so don’t know what are the default Linux drivers capable of (or didn’t until debugging this error) and therfore what is a reasonable canvas to request.

Sean

net.java.games.jogl.GLException: Error making context current
at net.java.games.jogl.impl.x11.X11GLContext.makeCurrent(X11GLContext.java:141)
at net.java.games.jogl.impl.x11.X11OnscreenGLContext.makeCurrent(X11OnscreenGLContext.java:111)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java(Compiled Code))
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java(Inlined Compiled Code))
at net.java.games.jogl.GLCanvas.display(GLCanvas.java(Inlined Compiled Code))
at net.java.games.jogl.Animator$1.run(Animator.java(Compiled Code))
at java.lang.Thread.run(Thread.java:568)

Hi,
I’m having the same problem asking more than 4 alpha bits.

Jogl uses DefaultGLCapabilitiesChooser if you do not provide one calling createGLCanvas.

Anyway it does not seems, in my case at least, a bad choice problem: the chosen capabilities is reported as

GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 8, Red: 8, Green: 8, Blue: 8, Alpha: 8, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 16 ]

so I should be able to use 8 bits.

Do not know.

Problem is with latest cvs version, linux 2.4.20, xfree
4.2.1, nvidia opengl drivers 4363.

Bye

This problem has been reported several times when running in 24bit mode X.

see:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=newbies;action=display;num=1062001166

Kev

Thanks for the pointer to that posting. Switching to a 16-bit display got rid of that exception.

Sean