Whenever I call glGenVertexArrays(), I get the following exception:

Exception in thread "main" java.lang.IllegalStateException: This functionality is not available. at org.lwjgl.system.Checks.checkFunctionality(Checks.java:36) at org.lwjgl.opengl.GL30.getInstance(GL30.java:651) at org.lwjgl.opengl.GL30.nglGenVertexArrays(GL30.java:3101) at org.lwjgl.opengl.GL30.glGenVertexArrays(GL30.java:3128) at me.package.name.ClassName.methodName(ClassName.java:ANY_LINE_NUMBER)

The operating system is OS X Yosemite 10.10.2, Java 7. I think that this problem is OS X specific.

Immediate mode drawing does work.

I am using LWJGL 3.

  • \$\begingroup\$ OSX has his own Drivers and some serious problems, for example you can either use a modern OpenGL context, then you can't use legacy functionality, or you can use a legacy context, then you can't use modern functionality. Unfortunately i don't know if/how you can specify which version or mode (compat/core) you want in lwjgl. \$\endgroup\$ – tkausl Jul 26 '15 at 14:20

The glGenVertexArrays() interface was added to OpenGL core contexts in version 3.0, the same version in which immediate mode rendering was removed from OpenGL (although it had long since been deprecated, 3.0 is where it finally absolutely went away)

So you are correct. If immediate mode drawing works, then you are using an OpenGL context old enough that glGenVertexArrays() hasn't yet been added to the standard, and may therefore be unavailable.

Some drivers may provide the old immediate-mode rendering interfaces in a 3.x context via a compatibility context, or may provide 3.0-style interfaces via EXT or ARB extensions on a 2.1 context, but neither of these are guaranteed to be available on any particular hardware/driver/OS. (OSX's OpenGL drivers in particular don't currently provide compatibility contexts or debug contexts. But the OpenGL spec doesn't mandate that anyone has to provide those, so you can't assume that anyone has them on any platform, not just OSX. You could quite possibly run into exactly the same problem on any computer in the world, if their video drivers simply didn't implement support for an OpenGL compatibility profile.)

Really, you want to pick whether you're going to use old-style OpenGL rendering or new-style OpenGL rendering, and stick with that choice for a whole program; not try to mix between immediate-mode fixed-function rendering and modern VBO-and-shader-based rendering.

| improve this answer | |
  • \$\begingroup\$ And a link to the documentation for how to specify what context you want in lwjgl, with some extra notes about requirements to make it work on OS X. (I've never used lwjgl personally and so can't vouch for its accuracy, but it looks reasonable to me) \$\endgroup\$ – Trevor Powell Jul 26 '15 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.