LWJGL Forum

Programming => OpenGL => Topic started by: polskyman on November 05, 2006, 23:23:25

Title: check the availability of GL extensions and primitives
Post by: polskyman on November 05, 2006, 23:23:25
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
Title: check the availability of GL extensions and primitives
Post by: Matzon on November 06, 2006, 08:52:59
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
Title: check the availability of GL extensions and primitives
Post by: polskyman on November 08, 2006, 00:14:52
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 .
Title: check the availability of GL extensions and primitives
Post by: aldacron on November 08, 2006, 01:49:24

boolean antialias = Display.getContext().getCapabilities().GL_ARB_multisample;
Title: check the availability of GL extensions and primitives
Post by: polskyman on November 08, 2006, 10:23:50
no sorry this code does not work :(
please post a new one.
Title: check the availability of GL extensions and primitives
Post by: aldacron on November 08, 2006, 12:07:15
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.
Title: check the availability of GL extensions and primitives
Post by: polskyman on November 08, 2006, 16:55:22
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.
Title: check the availability of GL extensions and primitives
Post by: Matzon on November 08, 2006, 17:42:34
make sure you have created a display beforehand - or a pbuffer
Title: check the availability of GL extensions and primitives
Post by: polskyman on November 08, 2006, 19:58:34
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