GlCapabilities and Hardware Acceleration

I am new to JOGL but am very excited about what I’ve seen so far! There is a topic, though, that I have not found information on and I would appreciate any help or references.

Specifically, I am interested to know if there is a way to determine the results of the GLCapabilities negotiation and more specifically whether there is a way to determine which aspects of the negotiated GLCapabilites are hardware accelerated if hardware acceleration was requested.

With the removal of GLContext from the public API, it is not clear to me how I get feedback from something like the following:

GLCapabilities desired = new GLCapabilities();
desired.setHardwareAccelerated(true);
desired.setDoubleBuffered(true);
desired.setStencilBits(1);

GLCanvas canvas =

GLDrawableFactory.getFactory().createGLCanvas(desired);

In this example, is there a way for me to determine whether the stencil buffer was actually setup and if so, if it is hardware accelerated?

Thanks for any help.

glGetIntegerv with a parameter of GL_STENCIL_BITS will tell you if you have a stencil buffer. There is no way for you to know whether that buffer is accelerated or if any part of the GL is accelerated. OpenGL is black box in that respect. On a modern card I think it would be safe to assume that a stencil buffer is accelerated.

The way JOGL supports this is not after the fact but during the pixel format selection process. You can write a GLCapabilitiesChooser which can look at all of the available pixel formats and choose one. See the alternate constructors in the GLDrawableFactory. A DefaultGLCapabilitiesChooser is used if one is not supplied.