check the availability of GL extensions and primitives

Started by polskyman, November 05, 2006, 23:23:25

Previous topic - Next topic

polskyman

Hi,

I would like to check the availability of certain gl functions and wether they are present on the video card use them or not.
If you could give the little sample of code allowing to do this.
thanks a lot

example:
check the availability of glCompressedTexSubImage2D present in opengl 1.3

Matzon

glCompressedTexSubImage2D is ogl 1.3, so if your card support that you dont need to check for a specific function, though it can be done with: ContextCapabilities.OpenGL13

polskyman

thank you matzon but can you provide a sample code working.
I tried this:

boolean antialias=new org.lwjgl.opengl.GLContext().getCapabilities().GL_ARB_multisample;


but this fails and never work .

aldacron

boolean antialias = Display.getContext().getCapabilities().GL_ARB_multisample;

polskyman

no sorry this code does not work :(
please post a new one.

aldacron

Sorry about that. This is what you want:

boolean antialias = GLContext().getCapabilities().GL_ARB_multisample;


The problem with your original attempt was the 'new' you put in there. getCapabilities is a static method, so you don't need an instance of GLContext to use it.

polskyman

If i let the () before the GLcontext it does not work but without :

when i write that:

boolean antialias = GLContext.getCapabilities().GL_ARB_multisample;


I get a null error exception.


I can not make the detection working.
please help me.

Matzon

make sure you have created a display beforehand - or a pbuffer

polskyman

I use it in an applet not in an app.
is there a way to check the GL_ARB_multisample extension within an applet ?
thanks a lot.
please provide a sample of code.
thanks