Detecting max multisamples

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

Detecting max multisamples

justin
Is there a preferred method of detecting the max number of samples a machine can use? This seems to be something OpenGL cannot do (at least not in GL2), but perhaps the JOGL code has it buried somewhere?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Detecting max multisamples

gouessej
Administrator
Hi

You can use the constant MAX_SAMPLES with glGetInt to get this value with any version of OpenGL supporting GL_ARB_texture_multisample. I disagree with your remark about GL2.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Detecting max multisamples

Sven Gothel
Administrator
On Monday, September 26, 2011 09:33:43 AM gouessej [via jogamp] wrote:
>
> Hi
>
> You can use the constant MAX_SAMPLES with glGetInt to get this value with
> any version of OpenGL supporting GL_ARB_texture_multisample. I disagree with
> your remark about GL2.
>

For the GL query, use Julien's above.

Here you can see how you gather all available GLCapabilities:
  http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java;hb=HEAD#l58

Here is a test whether a list of such caps has any multisample support in it:
  http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java;hb=HEAD

Applied here for one NEWT window's GLDrawable
  http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleNEWT.java;hb=HEAD

.. but you can check on all available caps (see above) as well.

~Sven
Reply | Threaded
Open this post in threaded view
|

Re: Detecting max multisamples

justin
Thanks, both answers were helpful. I think my mistake was in using a system with a driver that did not properly detect GL_MAX_SAMPLES, and it reported a value that was too high to be correct. This is quite useful though.
Reply | Threaded
Open this post in threaded view
|

Re: Detecting max multisamples

gouessej
Administrator
I assume it returned something close to the biggest integer.
Julien Gouesse | Personal blog | Website