We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#define REPORT_COMPILE_ERRORS ////////////////////////////////////////////////////////////////////////////////////////////// inline GLuint CompileGLSLShader( GLenum target, const char* shader) { GLuint object; object = glCreateShader( target); if (!object) return object; glShaderSource( object, 1, &shader, NULL); glCompileShader(object); // check if shader compiled GLint compiled = 0; glGetShaderiv(object, GL_COMPILE_STATUS, &compiled); if (!compiled) { #ifdef REPORT_COMPILE_ERRORS char temp[256] = ""; glGetShaderInfoLog( object, 256, NULL, temp); fprintf( stderr, "Compile failed:\n%s\n", temp); #endif glDeleteShader( object); return 0; } return object; } // Create a program composed of vertex and fragment shaders. inline GLuint LinkGLSLProgram( GLuint vertexShader, GLuint fragmentShader) { GLuint program = glCreateProgram(); glAttachShader(program, vertexShader); glAttachShader(program, fragmentShader); glLinkProgram(program); #ifdef REPORT_COMPILE_ERRORS // Get error log. GLint charsWritten, infoLogLength; glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLogLength); char * infoLog = new char[infoLogLength]; glGetProgramInfoLog(program, infoLogLength, &charsWritten, infoLog); printf(infoLog); delete [] infoLog; #endif // Test linker result. GLint linkSucceed = GL_FALSE; glGetProgramiv(program, GL_LINK_STATUS, &linkSucceed); if (linkSucceed == GL_FALSE) { glDeleteProgram(program); return 0; } return program; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: