What I would like to do is within the same instance of the program fully initialize and delete an SDL+GLES instance twice within the run time of the same program. I have adapted the code base posted above to simply call the contents of main() twice with a slight pause in between. However on the second run the following assert fails:
Code: Select all
glShaderSource(dev->vert_shdr, 1, &vertex_shader, 0);
glShaderSource(dev->frag_shdr, 1, &fragment_shader, 0);
glCompileShader(dev->vert_shdr);
glCompileShader(dev->frag_shdr);
glGetShaderiv(dev->vert_shdr, GL_COMPILE_STATUS, &status);
assert(status == GL_TRUE);Code: Select all
if (status != GL_TRUE) {
GLint maxLength;
glGetShaderiv(dev->vert_shdr, GL_INFO_LOG_LENGTH, &maxLength);
GLchar infoLog[maxLength];
memset(&infoLog, 0, maxLength);
glGetShaderInfoLog(dev->vert_shdr, maxLength, &maxLength, infoLog);
printf("error: %s\n", infoLog);
}