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 vaos 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.