Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static GLuint createShader(const std::string &text, GLenum shaderType)
- {
- GLuint shader = glCreateShader(shaderType);
- if (shader == 0)
- std::cerr << "Error: Shader creation failed!" << std::endl;
- const GLchar *p[1];
- GLint pLengths[1];
- p[0] = text.c_str();
- pLengths[0] = text.length();
- glShaderSource(shader, 1, p, pLengths);
- glCompileShader(shader);
- checkShaderError(shader, GL_COMPILE_STATUS, false, "Error: Shader compilation failed: ");
- return shader;
- }
Advertisement
Add Comment
Please, Sign In to add comment