How reliable is gl.isFunctionAvailable?

        System.out.println("Checking minmax");
        hasMinMax = WurmClient.extensions.contains("GL_EXT_blend_minmax");
        if (!gl.isFunctionAvailable("glBlendEquation")) hasMinMax = false;

“Checking minmax” gets printed. Yet, still, later on:

javax.media.opengl.GLException: Method "glBlendEquation" not available
  at com.sun.opengl.impl.GLImpl.glBlendEquation(GLImpl.java:562)
  at class.ax.e(SourceFile:177)
  at class.ax.a(SourceFile:75)
  at class.F.c(SourceFile:507)
  at class.I.a(SourceFile:69)
  at com.wurmonline.client.WurmClient.f(SourceFile:262)
  at com.wurmonline.client.WurmClient.run(SourceFile:147)
  at java.lang.Thread.run(Unknown Source)

At the following line:

                    gl.glBlendEquation(GL.GL_MAX);

I had to solve it by wrapping that entire block in a try{ … } catch (GLExcepition e) { hasMinMax = false; }

Is it possible the function is available, but just not for that parameter, and the thrown exception is wrong?

glBlendEquation is declared in core OpenGL 1.2, so you would need to test for gl.isExtensionAvailable(“GL_VERSION_1_2”) to see if glBlendEquation is available. glBlendEquationEXT isn’t exposed any more in JSR-231 because it’s one of the extensions folded into core OpenGL <= 1.3.

Still, shouldn’t gl.isFunctionAvailable(“glBlendEquation”) return false, when calling it throws “javax.media.opengl.GLException: Method “glBlendEquation” not available”?

Yes, it should. The attached test case works properly on my machine, i.e., isFunctionAvailable(“glBlendEquation”) returns true when isExtensionAvailable(“GL_VERSION_1_2”) returns true. Does this report different results on your machine, or does calling glBlendEquation throw an exception when isFunctionAvailable(“glBlendEquation”) returns true?

It’s not on my machine, but…

[quote=“Ken Russell,post:4,topic:27170”]
That happens. I have to catch the exception and remember that the method failed, or the game fails for some people.
I’ve also had this happen to something else than glBlendEquation (I think it was glGenBuffers that time).