I have used the Mac M1 and M4. Developing OpenGL projects on machines running macOS 15.2 and 13.6. Call the OpenGL library functions of Mac. glTexImage2D If you use GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_ALPHA these three textures, you will get an error gl 500. It makes me unable to draw normally on Mac. What's the reason for this? Don't they support it?
Can you show how you are creating your context? Keep in mind that, as documented, the legacy profile for OpenGL on macOS only supports the exact feature set that was available prior to macOS 10.7. You cannot create an OpenGl 3.2 or later compatibility context on macOS.
For what it’s worth, GL_LUMINANCE
, GL_ALPHA
, and GL_LUMINANCE_ALPHA
were deprecated in OpenGL 3.0. If you are using a shader-based pipeline, you can directly replace these with GL_RED
and GL_RG
.
Finally, please don’t use OpenGL for new applications on Apple platforms. OpenGL has been deprecated since macOS 10.14. Please use Metal instead.