OpenGL: Reset clear color as needed

This commit is contained in:
Vicki Pfau 2019-05-15 23:43:20 -07:00
parent 25f0bc7f2b
commit b92a08e6f1
1 changed files with 2 additions and 2 deletions

View File

@ -88,8 +88,6 @@ static void mGLES2ContextInit(struct VideoBackend* v, WHandle handle) {
glBindBuffer(GL_ARRAY_BUFFER, context->vbo); glBindBuffer(GL_ARRAY_BUFFER, context->vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(_vertices), _vertices, GL_STATIC_DRAW); 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); struct mGLES2Uniform* uniforms = malloc(sizeof(struct mGLES2Uniform) * 4);
uniforms[0].name = "gamma"; uniforms[0].name = "gamma";
uniforms[0].readableName = "Gamma"; uniforms[0].readableName = "Gamma";
@ -236,6 +234,7 @@ void _drawShader(struct mGLES2Context* context, struct mGLES2Shader* shader) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} else { } else {
glDisable(GL_BLEND); glDisable(GL_BLEND);
glClearColor(0.f, 0.f, 0.f, 1.f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
} }
@ -459,6 +458,7 @@ void mGLES2ShaderAttach(struct mGLES2Context* context, struct mGLES2Shader* shad
size_t i; size_t i;
for (i = 0; i < nShaders; ++i) { for (i = 0; i < nShaders; ++i) {
glBindFramebuffer(GL_FRAMEBUFFER, context->shaders[i].fbo); glBindFramebuffer(GL_FRAMEBUFFER, context->shaders[i].fbo);
glClearColor(0.f, 0.f, 0.f, 1.f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
glBindVertexArray(context->shaders[i].vao); glBindVertexArray(context->shaders[i].vao);