glGetShaderInfoLog is empty
Posted: Wed Aug 14, 2019 12:14 am
Hi all, I have been looking for a while for a solution to this problem but I cannot find it. The code base I am working on currently is nearly identical to the code base here: https://github.com/vurtun/nuklear/tree/ ... _opengles2.
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:
This can be found on line 116 in the file nuklear_sdl_gles2.h. I used the following code to print the error:
maxLength is zero after glGetShaderiv returns. Also if I manually set maxLength to a larger number glGetShaderInfoLog doesn't even touch infoLog. It leaves it completely empty. Any help would be greatly appreciated
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);
}