// in the global space
ShaderInfo noLight[] = {
{ GL_VERTEX_SHADER, "move.vert" },
{ GL_FRAGMENT_SHADER, "move.frag"},
{ GL_NONE, NULL}
};
ShaderInfo ambient[] = {
{ GL_VERTEX_SHADER, "move.vert" },
{ GL_FRAGMENT_SHADER, "ambient.glsl"},
{ GL_NONE, NULL}
};
// in setup
switch (ShaderNumber) {
case 1:
Program = LoadShaders(ambient);
break;
case 0:
default:
Program = LoadShaders(noLight);
break;
}
...
if (ShaderNumber > 0) {
AmbientLoc = glGetUniformLocation(Program, "Ambient");
}
// in main
if (argc > 1) {
ShaderNumber = atoi(argv[1]);
} else {
ShaderNumber = 0;
}