From a9a067ef8473628f170dfdab1f7692b53a5f130b Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Fri, 22 Feb 2013 22:11:26 +0100 Subject: [PATCH] Set depth and color mask before clearing. --- android/app-android.cpp | 3 +++ gfx_es2/fbo.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/android/app-android.cpp b/android/app-android.cpp index d65714d63f..6dc9843454 100644 --- a/android/app-android.cpp +++ b/android/app-android.cpp @@ -23,6 +23,7 @@ #include "math/math_util.h" #include "net/resolve.h" #include "android/native_audio.h" +#include "gfx_es2/gl_state.h" // For Xperia Play support enum AndroidKeyCodes { @@ -251,6 +252,8 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayRender(JN } else { ELOG("Ended up in nativeRender even though app has quit.%s", ""); // Shouldn't really get here. + glstate.depthWrite.set(GL_TRUE); + glstate.colorMask.set(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glClearColor(1.0, 0.0, 1.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); } diff --git a/gfx_es2/fbo.cpp b/gfx_es2/fbo.cpp index f0800e1bb9..81b23244dc 100644 --- a/gfx_es2/fbo.cpp +++ b/gfx_es2/fbo.cpp @@ -1,6 +1,7 @@ #include #include "base/logging.h" +#include "gfx/gl_common.h" #include "gfx_es2/fbo.h" #include "gfx/gl_common.h" #include "gfx_es2/gl_state.h" @@ -35,7 +36,6 @@ struct FBO { FBO *fbo_create(int width, int height, int num_color_textures, bool z_stencil, FBOColorDepth colorDepth) { CheckGLExtensions(); - FBO *fbo = new FBO(); fbo->width = width; fbo->height = height; @@ -175,4 +175,4 @@ void fbo_destroy(FBO *fbo) { void fbo_get_dimensions(FBO *fbo, int *w, int *h) { *w = fbo->width; *h = fbo->height; -} \ No newline at end of file +}