I am attempting to update a game engine I made from OpenGL ES 2.0 to 3.0. I believe I have completed this process and it seems to work great on mobile, but when working internally, we had normally used OpenGL Desktop on Mac (gl.version: 4.1 Metal - 88.1)
I am doing this creation when I create the OpenGL manager object in my engine, so it is not occuriing every frame, but I am attempting to bind it every frame.
Of note, on Desktop, both the glVertexAttribPointer and glGenVertexArrays both give an OpenGL error code of 0x0502.
Ok, first. This is Apple Mac. They’ve stated their lack of support for OpenGL. So take whatever you observe on this platform with a pound of salt. Results on a desktop PC with an NVIDIA GPU+drivers might net you much more dependable results.
Second, are you absolutely certain that no GL error was posted “before” the GL calls that you think triggered one. Add a glGetError() before these calls to be sure. Part of why I suggest this is that, on Mac, sometimes the context init is actually what throws the GL error. For instance:
Seems a bit odd that these 2 OpenGL 4.1 Core driver reports don’t support ARB_vertex_array_object, when I believe VAOs were accepted into core in OpenGL 3.0.
If I were you, I’d try your desktop testing on something other than a Mac. For instance, a PC with an NVIDIA GPU+driver.
This Mac version is just for our artists and programmers to be able to do their development in the desktop, so unfortunately, I need to get it working on the poorly supported M series chips.
Does your CM_GL_CHECKERROR function call glGetError repeatedly until it returns GL_NO_ERROR? Or does it just call glGetError once? It should be the former; an implementation is allowed to store multiple errors.
GL_INVALID_OPERATION (0x0502) isn’t an allowed error for glGenVertexArrays; the only allowed error is GL_INVALID_VALUE if you request a negative number of arrays. So this error being reported for glGenVertexArrays is more likely to be an issue with the error reporting code (either yours or the implementation’s).