LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: darkprophet on January 26, 2007, 11:14:57

Title: Generated.isSupported();
Post by: darkprophet on January 26, 2007, 11:14:57
Hi all,
Would it be possible to add a "boolean isSupported()" method to all generated classes (including GL11 to GL21) that simply calls GLContext.getCapabilities().GL_.... ?

I am doing some reflection bonanza and I only have the extension class that is needed, not the string.

DP :)
Title: Re: Generated.isSupported();
Post by: Evil-Devil on January 30, 2007, 10:46:29
When you create an instance of gl or whatever gl class you setup first, you can query GL for all supported extensions. I see no need an isSupported() method.
Title: Re: Generated.isSupported();
Post by: darkprophet on January 30, 2007, 12:56:46
There is no instance of GL, its all static variables. I am slightly familiar with the workings of LWJGL and I am already using GLContext.getCapabilities().GL_.... However, Generated.isSupported() just seems a nicer way of doing the same thing + gives you the opportunity to do some reflection on the capabilities.

In any case, I dont think the developers want to add any new features as they are trying to stabilise the API for the 1.0 release. Maybe for 1.1 :)
Title: Re: Generated.isSupported();
Post by: Evil-Devil on January 30, 2007, 14:16:53
Yea they are all static, but i meant if you create a context via pbuffer or display or applet you can get the supported extensions by a simple glGetString(GL11.GL_EXTENSIONS); call.
Title: Re: Generated.isSupported();
Post by: darkprophet on January 30, 2007, 18:47:35
I know of that GL constant, its pretty widely used. :)

If I was to use that then I have to split the string (not a big deal) and convert from GL names to class names (which is a big deal) at runtime. Reflection is a much nicer solution.

DP