all repos — mgba @ b92a08e6f1fddee946c93030fceab0af83aea7a0

mGBA Game Boy Advance Emulator

OpenGL: Reset clear color as needed
Vicki Pfau vi@endrift.com
Wed, 15 May 2019 23:43:20 -0700
commit

b92a08e6f1fddee946c93030fceab0af83aea7a0

parent

25f0bc7f2be32fdff2190b563d3bf996279a64fb

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/platform/opengl/gles2.csrc/platform/opengl/gles2.c

@@ -88,8 +88,6 @@ glGenBuffers(1, &context->vbo);

glBindBuffer(GL_ARRAY_BUFFER, context->vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(_vertices), _vertices, GL_STATIC_DRAW); - glClearColor(0.f, 0.f, 0.f, 1.f); - struct mGLES2Uniform* uniforms = malloc(sizeof(struct mGLES2Uniform) * 4); uniforms[0].name = "gamma"; uniforms[0].readableName = "Gamma";

@@ -236,6 +234,7 @@ glEnable(GL_BLEND);

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else { glDisable(GL_BLEND); + glClearColor(0.f, 0.f, 0.f, 1.f); glClear(GL_COLOR_BUFFER_BIT); }

@@ -459,6 +458,7 @@ context->nShaders = nShaders;

size_t i; for (i = 0; i < nShaders; ++i) { glBindFramebuffer(GL_FRAMEBUFFER, context->shaders[i].fbo); + glClearColor(0.f, 0.f, 0.f, 1.f); glClear(GL_COLOR_BUFFER_BIT); glBindVertexArray(context->shaders[i].vao);