diff options
author | Jesse Barker <jesse.barker@linaro.org> | 2012-10-19 07:41:02 -0700 |
---|---|---|
committer | Jesse Barker <jesse.barker@linaro.org> | 2012-10-19 07:41:02 -0700 |
commit | 149d52c460b32ca2d93cb66a8bf8dd2939deca06 (patch) | |
tree | b3b3174eef1fd25a0f820a5c8f2196a2a03713da | |
parent | bd764cff0bd3ee3def85317ec4e84cd2d941824d (diff) | |
download | glmark2-149d52c460b32ca2d93cb66a8bf8dd2939deca06.tar.gz |
SceneShadow: Hook up the supported() member properly. Make setup() depend
upon it as well, as the current main-loop logic only calls supported if the
scene isn't marked as running (typically only happens if setup fails).
-rw-r--r-- | src/scene-shadow.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/scene-shadow.cpp b/src/scene-shadow.cpp index f7c303c..18f2cb5 100644 --- a/src/scene-shadow.cpp +++ b/src/scene-shadow.cpp @@ -21,6 +21,9 @@ // #include "scene.h" #include "util.h" +#include "log.h" + +using std::string; class ShadowPrivate { @@ -40,7 +43,19 @@ SceneShadow::~SceneShadow() bool SceneShadow::supported(bool show_errors) { - return show_errors; + static const string oes_depth_texture("GL_OES_depth_texture"); + static const string arb_depth_texture("GL_ARB_depth_texture"); + if (!GLExtensions::support(oes_depth_texture) && + !GLExtensions::support(arb_depth_texture)) + { + if (show_errors) + { + Log::error("We do not have the depth texture extension!!!\n"); + } + + return false; + } + return true; } bool @@ -58,8 +73,11 @@ SceneShadow::unload() bool SceneShadow::setup() { - if (!Scene::setup()) + // If the scene isn't supported, don't bother to go through setup. + if (!supported(false) || !Scene::setup()) + { return false; + } priv_ = new ShadowPrivate(); // Set core scene timing after actual initialization so we don't measure |