79 const GLuint program = glCreateProgram();
81 for (
int i = 0;
i < 2;
i++) {
82 const GLuint shader = glCreateShader(shaders[
i].type);
84 const string source_str = shaders[
i].source;
85 const char *c_str = source_str.c_str();
87 glShaderSource(shader, 1, &c_str,
nullptr);
88 glCompileShader(shader);
91 glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_status);
93 if (!compile_status) {
101 glAttachShader(program, shader);
105 glBindFragDataLocation(program, 0,
"fragColor");
108 glLinkProgram(program);
111 glGetProgramiv(program, GL_LINK_STATUS, &link_status);