I follow the book \"OpenGL SuperBible 5th Edition\" to study openGL, the capture 6th demo to create shader by hand all not work. Like the demo of \"ShadedTriangle\", to create
1.50 requires OpenGL 3.2 support. Unless you can get a newer driver (or a GPU), I think you're out of luck on this one.
On Mac you need to tell OpenGL which version to use before creating the window.
This answer explains how to do it with GLFW:
I'm still searching for a way to do this with GLUT.
something like this:
glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 4)
glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 1)
glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, GL_TRUE)
glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
window = glfw.create_window(800,600,"My OpenGL Window", None, None)
macOS' system GLUT does not have the capability of creating an OpenGL 3+ context.
FreeGLUT provides a way to do it, taken from here:
glutInitContextVersion(3,2); /* or later versions, core was introduced only with 3.2 */
glutInitContextProfile(GLUT_CORE_PROFILE);
Or you can take @izzy's advice and use GLFW.