Created
April 21, 2014 07:01
-
-
Save EddyLuten/11134505 to your computer and use it in GitHub Desktop.
Chapter 2, Snippet 12 - OpenGLBook.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void DestroyShaders(void) | |
{ | |
GLenum ErrorCheckValue = glGetError(); | |
glUseProgram(0); | |
glDetachShader(ProgramId, VertexShaderId); | |
glDetachShader(ProgramId, FragmentShaderId); | |
glDeleteShader(FragmentShaderId); | |
glDeleteShader(VertexShaderId); | |
glDeleteProgram(ProgramId); | |
ErrorCheckValue = glGetError(); | |
if (ErrorCheckValue != GL_NO_ERROR) | |
{ | |
fprintf( | |
stderr, | |
"ERROR: Could not destroy the shaders: %s \n", | |
gluErrorString(ErrorCheckValue) | |
); | |
exit(-1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment