0
\$\begingroup\$

I have a question. I am following ThinMatrix's tutorial on YouTube which is about making a 3d game with lwjgl. He uses OpenGL v3.0 and higher. However, my built-in graphic card supports only OpenGL version 2.1.

Here is the question: why can I use GL30.glGenVertexArrays() but can not use GL30.glGenerateMipmap()?

When I use Mesa, print GL11.glGetString(GL11.GL_VERSION) it still shows 2.1 but I don't get any errors when I try to use GL30.glGenerateMipmap.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Can't use GL30.glGenerateMipmap() is not very descriptive. If you're getting a particular error message, edit to include that info. Though ultimately it probably doesn't matter - it sounds like you are trying to use a function that isn't supported by your hardware. The fact that it happens to provide some functionality that exceeds its specification is not a guarantee that it will provide the particular functionality that you happen to want. \$\endgroup\$
    – Pikalek
    Jun 11 at 23:09

2 Answers 2

0
\$\begingroup\$

Your graphics card driver implements the GL_ARB_vertex_array_object extension.

Couple of things to note.

First, there is no -ARB suffix on new entry points or tokens with this extension. The reason why is explained at issue #6 of the extension spec, linked above.

Second, this extension exists for the explicit purpose of providing a subset of OpenGL 3.0 functionality on hardware and drivers that can't implement the full OpenGL 3.0 specification. It shouldn't be surprising to find an OpenGL 2.1 implementation that supports it (it's probably more surprising to find OpenGL 2.1 hardware still in use and still working).

In a C/C++ program, attempting to use a GL call that doesn't exist in your driver will crash your program, due to it attempting to access a NULL pointer. I don't know LWJGL so I can't explain why trying to use glGenerateMipmap doesn't throw some kind of error; most likely it does but you're not looking in the right place.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you. I am new at OpenGL and you helped me and answered my question. \$\endgroup\$
    – Yuri
    Jun 12 at 15:50
1
\$\begingroup\$

Posting an objective answer to this is probably impossible. Most likely your GL driver might have some forward-compatibility, meaning that even though it's on version 2.1 it supports a few select things from later versions to speed up rendering. Most likely stuff that doesn't really add functionality, but that simplifies existing implementations, so for example (the following are not real functions) if previously you had to use glSetVertexArrayIndex(int index, float data) like so

glSetVertexArrayIndex(0, data_index0);
glSetVertexArrayIndex(1, data_index1);

but in new GL versions (let's pretend 3.0) they added a function glSetVertexArrayIndexes(int[] indexes, float[] data) that you could now use like so:

glSetVertexArrayIndexes([0, 1], [data_index0, data_index1]);

That means your GL driver might secretly implement support for the new glSetVertexArrayIndexes(int[], float[]) behind the scenes, since if it recognizes multiple calls of the old glSetVertexArrayIndex in a row it can just translate it to a single call of glSetVertexArrayIndexes and save some processing time.

But like I said, this is just a pure guess.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .