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
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)