正如标题所说,我可以在我的程序中这样做:
vertex = glCreateShader(GL_VERTEX_SHADER);
/* ... */
fragment = glCreateShader(GL_FRAGMENT_SHADER);
/* ... */
program = glCreateProgram();
glAttachShader(program, vertex);
glAttachShader(program, fragment);
glLinkProgram(program);
/* All things done */
glDeleteShader(vertex); /* <~ Can I do this now? */
glDeleteShader(vertex); /* <~ Can I do this now? */
/* And in render procedure */
glUseProgram(program); /* <~ Still use program without any problem? */
/* ... */