=== modified file 'src/android.cpp'
@@ -105,11 +105,17 @@
return false;
}
- g_canvas->clear();
-
- scene->draw();
- scene->update();
-
+ if (scene->is_running()) {
+ g_canvas->clear();
+
+ scene->draw();
+ scene->update();
+ }
+
+ /*
+ * Need to recheck whether screen is running, because scene->update()
+ * may have changed the state.
+ */
if (!scene->is_running()) {
(*bench_iter)->teardown_scene();
Log::info("%s FPS: %u", scene->info_string().c_str(), scene->average_fps());
=== modified file 'src/scene-buffer.cpp'
@@ -343,6 +343,7 @@
Scene::setup();
+ bool should_run = true;
bool interleave = (options_["interleave"].value == "true");
Mesh::VBOUpdateMethod update_method;
Mesh::VBOUsage usage;
@@ -374,8 +375,8 @@
(GLExtensions::MapBuffer == 0 || GLExtensions::UnmapBuffer == 0))
{
Log::error("Requested MapBuffer VBO update method but GL_OES_mapbuffer"
- "is not supported!");
- return;
+ " is not supported!\n");
+ should_run = false;
}
priv_->wave = new WaveMesh(5.0, 2.0, nlength, nwidth,
@@ -393,7 +394,7 @@
glDisable(GL_CULL_FACE);
currentFrame_ = 0;
- running_ = true;
+ running_ = should_run;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
}