<p>OpenGL version <code>2.1</code> does not support vertex arrays (vaos), you need OpenGL version <code>3.0+</code>. Try invoking a core profile and see if that helps. If not then your version might be maxed out at version <code>2.1</code> as Apple does not really support OpenGL well (And especially since your graphics card is directly vendored from Apple). Also a handy tip would to consider Apple's built in graphics API, <code>Metal</code>, because they have dedicated to supporting this graphics API.</p>

CC BY-SA 4.0
2021-08-28T09:19:58.263Z
2021-08-28T09:19:58.263Z
Dstarred
<p>I have been developing a c++, openg, glfw3 and GLEW project on ubuntu and everything has worked so far. Recently I moved to a mac computer (chip M1 if it's important) and things stopped working.</p>
<p>I have an error on runtime when trying to call <code>glGenVertexArrays</code>. The error code is 1282 (0x0502) which according to khronos' wiki means:</p>
<blockquote>
<p>GL_INVALID_OPERATION, 0x0502
Given when the set of state for a command is not legal for the parameters given to that command. It is also given for commands where combinations of parameters define what the legal parameters are.</p>
</blockquote>
<p>I printed the OpenGL version with <code>glGetString(GL_VERSION)</code> and results in:</p>
<blockquote>
<p>Version 2.1 Metal - 71.0.7</p>
</blockquote>
<p>Then I tried running <code>glewGetExtension(&quot;GL_ARB_vertex_array_object&quot;)</code> which returns FALSE. I am not sure, to be honest, what exactly this means but I add it in case it's useful.</p>
<p>Is there any way of forcing my mac to run OpenGL in a compatible way with my source code? I thought about stop using <strong>vao</strong>s but I am also depending on a library that is supposedly only tested in windows and linux which maybe uses vaos as well. Also, I guess that I probably have problems with other things which don't yet get the chance to run since the program halts on this error.</p>
<p>To add up, my intention is to have a runnable program in linux and I don't intend on developing for mac. So running a VM with linux should solve the problem. Anyway, if there is a way to also make it work in my macos environment it would be much better.</p>

CC BY-SA 4.0
2021-08-05T03:12:05.113Z
Is OpenGL still a thing on M1 MacOS? Why does the version string cite "Metal"? Lastly, why is it GL 2.1?
Nicol Bolas
<opengl>
OpenGL on mac gives me an error when calling glGenVertexArrays
Facundo Pedro Astiz Meyer
# OpenGL on mac gives me an error when calling glGenVertexArrays

(Asked by: username_0 on 2021-08-04)

I have been developing a c++, openg, glfw3 and GLEW project on ubuntu and everything has worked so far. Recently I moved to a mac computer (chip M1 if it's important) and things stopped working.

I have an error on runtime when trying to call `glGenVertexArrays`. The error code is 1282 (0x0502) which according to khronos' wiki means:

> GL\_INVALID\_OPERATION, 0x0502
> Given when the set of state for a command is not legal for the parameters given to that command. It is also given for commands where combinations of parameters define what the legal parameters are.

I printed the OpenGL version with `glGetString(GL_VERSION)` and results in:

> Version 2.1 Metal - 71.0.7

Then I tried running `glewGetExtension("GL_ARB_vertex_array_object")` which returns FALSE. I am not sure, to be honest, what exactly this means but I add it in case it's useful.

Is there any way of forcing my mac to run OpenGL in a compatible way with my source code? I thought about stop using **vao**s but I am also depending on a library that is supposedly only tested in windows and linux which maybe uses vaos as well. Also, I guess that I probably have problems with other things which don't yet get the chance to run since the program halts on this error.

To add up, my intention is to have a runnable program in linux and I don't intend on developing for mac. So running a VM with linux should solve the problem. Anyway, if there is a way to also make it work in my macos environment it would be much better.

**Tags:** opengl

> **Comments:**
> **username_1**: Is OpenGL still a thing on M1 MacOS? Why does the version string cite "Metal"? Lastly, why is it GL 2.1?  

---

## 1 answers

### Answer by username_2 on 2021-08-28. Score: 1

OpenGL version `2.1` does not support vertex arrays (vaos), you need OpenGL version `3.0+`. Try invoking a core profile and see if that helps. If not then your version might be maxed out at version `2.1` as Apple does not really support OpenGL well (And especially since your graphics card is directly vendored from Apple). Also a handy tip would to consider Apple's built in graphics API, `Metal`, because they have dedicated to supporting this graphics API.


---

