Detecting whether stereo is available

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Detecting whether stereo is available

blainebell
I am trying to detect whether stereo is available using JoGL so that I can use it if it exists, but not use it if its unavailable.

The idea is to set the GLCapabilities.setStereo() to true, then try to evaluate whether stereo is working.

On OSX with hardware stereo not available, both gl.glGetBooleanv(GL2.GL_STEREO,...) and gLDrawable.getChosenGLCapabilities().getStereo() return true, which is not what I am expecting.

On Linux-x86 64bit when hardware stereo is not available, calling setStereo(true) on the capabilities passed to GLCanvas, I am getting a flickering effect (similar, but not the same as when I remove the -Dsun.awt.noerasebackground=true argument).

I am more concerned with the OSX problem, since I am using a relatively old graphics card on Linux-x86 64bit.

Thanks for your response in advance,

Blaine Bell
Reply | Threaded
Open this post in threaded view
|

Re: Detecting whether stereo is available

blainebell
I believe I figured this out.  This is a very simple solution, after the GLCanvas has been constructed, it can be queried by getting the profile, creating a GLCapabilities object, and querying it for stereo.

new GLCapabilities(_canvas.getGLProfile()).getStereo()

will return whether the GLCanvas is doing stereo.  I will see if this can get rid o the Linux-x86 64bit issue. (I might need to reinitialize the GLCanvas)

Blaine