OpenGL: Minor gles2 fixes
Jeffrey Pfau jeffrey@endrift.com
Sun, 08 Nov 2015 15:30:23 -0800
1 files changed,
11 insertions(+),
4 deletions(-)
jump to
M
src/platform/opengl/gles2.c
→
src/platform/opengl/gles2.c
@@ -139,6 +139,7 @@ glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else { glDisable(GL_BLEND); + glClear(GL_COLOR_BUFFER_BIT); } glGetIntegerv(GL_VIEWPORT, viewport);@@ -224,7 +225,6 @@ break;
} } glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - glBindFramebuffer(GL_FRAMEBUFFER, 0); glBindTexture(GL_TEXTURE_2D, shader->tex); glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); }@@ -241,6 +241,7 @@ for (n = 0; n < context->nShaders; ++n) {
_drawShader(&context->shaders[n]); } _drawShader(&context->finalShader); + glBindFramebuffer(GL_FRAMEBUFFER, 0); glUseProgram(0); }@@ -313,13 +314,19 @@ glAttachShader(shader->program, shader->fragmentShader);
char log[1024]; glCompileShader(shader->fragmentShader); glGetShaderInfoLog(shader->fragmentShader, 1024, 0, log); - printf("%s\n", log); + if (log[0]) { + printf("%s\n", log); + } glCompileShader(shader->vertexShader); glGetShaderInfoLog(shader->vertexShader, 1024, 0, log); - printf("%s\n", log); + if (log[0]) { + printf("%s\n", log); + } glLinkProgram(shader->program); glGetProgramInfoLog(shader->program, 1024, 0, log); - printf("%s\n", log); + if (log[0]) { + printf("%s\n", log); + } shader->texLocation = glGetUniformLocation(shader->program, "tex"); shader->positionLocation = glGetAttribLocation(shader->program, "position");