After I study the basics of oepngl shader programming, I found one hazard related to my project. As we know, there are different versions of opengl shaders. From the old 120 version to the newest 430 version. In windows, all the version is backward compatible, however it is not the case in MAC. In current mac OSX, the basic opengl core is 2.1. User can enable 4.1 core by using following syntax
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
After I enable the 4.1 core, the shader is no longer backward compatible. In other word, most of the online reference examples become useless. I have to make the choice : use old version of shader with less functions or use new version of shader with less tutorials and more complex. After one week of studying, I finally decide to use the old version, as a beginner for opengl, I need more reference examples.