aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandros Frantzis <alexandros.frantzis@linaro.org>2012-08-15 12:45:06 +0300
committerAlexandros Frantzis <alexandros.frantzis@linaro.org>2012-08-15 12:45:06 +0300
commit2b0a1f08cf8a54a4a5b6465b4687d41b34100937 (patch)
treeda0b4215750070311b95755bd80e8a5ea38ec23d
parent24d4339f49fbb84f20af015dc72d33256320d5db (diff)
downloadglmark2-2b0a1f08cf8a54a4a5b6465b4687d41b34100937.tar.gz
Scene*: Change ::setup() to return a bool.
-rw-r--r--src/scene-buffer.cpp14
-rw-r--r--src/scene-build.cpp11
-rw-r--r--src/scene-bump.cpp73
-rw-r--r--src/scene-conditionals.cpp9
-rw-r--r--src/scene-default-options.cpp4
-rw-r--r--src/scene-desktop.cpp7
-rw-r--r--src/scene-effect-2d.cpp13
-rw-r--r--src/scene-function.cpp9
-rw-r--r--src/scene-grid.cpp7
-rw-r--r--src/scene-ideas.cpp12
-rw-r--r--src/scene-jellyfish.cpp7
-rw-r--r--src/scene-loop.cpp9
-rw-r--r--src/scene-pulsar.cpp13
-rw-r--r--src/scene-shading.cpp11
-rw-r--r--src/scene-terrain.cpp14
-rw-r--r--src/scene-texture.cpp15
-rw-r--r--src/scene.cpp8
-rw-r--r--src/scene.h47
18 files changed, 177 insertions, 106 deletions
diff --git a/src/scene-buffer.cpp b/src/scene-buffer.cpp
index 2214e53..ef3a0b9 100644
--- a/src/scene-buffer.cpp
+++ b/src/scene-buffer.cpp
@@ -355,17 +355,13 @@ SceneBuffer::unload()
{
}
-void
+bool
SceneBuffer::setup()
{
using LibMatrix::vec3;
- Scene::setup();
-
- bool should_run = true;
-
- if (!supported(true))
- should_run = false;
+ if (!Scene::setup())
+ return false;
bool interleave = (options_["interleave"].value == "true");
Mesh::VBOUpdateMethod update_method;
@@ -410,9 +406,11 @@ SceneBuffer::setup()
glDisable(GL_CULL_FACE);
currentFrame_ = 0;
- running_ = should_run;
+ running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene-build.cpp b/src/scene-build.cpp
index 39a5ae5..22c948a 100644
--- a/src/scene-build.cpp
+++ b/src/scene-build.cpp
@@ -80,12 +80,13 @@ SceneBuild::unload()
mesh_.reset();
}
-void
+bool
SceneBuild::setup()
{
using LibMatrix::vec3;
- Scene::setup();
+ if (!Scene::setup())
+ return false;
/* Set up shaders */
static const std::string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/light-basic.vert");
@@ -102,7 +103,7 @@ SceneBuild::setup()
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
Model model;
@@ -110,7 +111,7 @@ SceneBuild::setup()
bool modelLoaded = model.load(whichModel);
if(!modelLoaded)
- return;
+ return false;
// Now that we're successfully loaded, there are a few quirks about
// some of the known models that we need to account for. The draw
@@ -187,6 +188,8 @@ SceneBuild::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene-bump.cpp b/src/scene-bump.cpp
index 6512684..2b6c01f 100644
--- a/src/scene-bump.cpp
+++ b/src/scene-bump.cpp
@@ -58,7 +58,7 @@ SceneBump::unload()
{
}
-void
+bool
SceneBump::setup_model_plain(const std::string &type)
{
static const std::string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/bump-poly.vert");
@@ -78,7 +78,7 @@ SceneBump::setup_model_plain(const std::string &type)
high_poly_filename : low_poly_filename;
if(!model.load(poly_filename))
- return;
+ return false;
model.calculate_normals();
@@ -100,16 +100,18 @@ SceneBump::setup_model_plain(const std::string &type)
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
std::vector<GLint> attrib_locations;
attrib_locations.push_back(program_["position"].location());
attrib_locations.push_back(program_["normal"].location());
mesh_.set_attrib_locations(attrib_locations);
+
+ return true;
}
-void
+bool
SceneBump::setup_model_normals()
{
static const std::string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/bump-normals.vert");
@@ -118,7 +120,7 @@ SceneBump::setup_model_normals()
Model model;
if(!model.load("asteroid-low"))
- return;
+ return false;
/* Calculate the half vector */
LibMatrix::vec3 halfVector(lightPosition.x(), lightPosition.y(), lightPosition.z());
@@ -147,7 +149,7 @@ SceneBump::setup_model_normals()
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
std::vector<GLint> attrib_locations;
@@ -155,11 +157,16 @@ SceneBump::setup_model_normals()
attrib_locations.push_back(program_["texcoord"].location());
mesh_.set_attrib_locations(attrib_locations);
- Texture::load("asteroid-normal-map", &texture_,
- GL_NEAREST, GL_NEAREST, 0);
+ if (!Texture::load("asteroid-normal-map", &texture_,
+ GL_NEAREST, GL_NEAREST, 0))
+ {
+ return false;
+ }
+
+ return true;
}
-void
+bool
SceneBump::setup_model_normals_tangent()
{
static const std::string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/bump-normals-tangent.vert");
@@ -168,7 +175,7 @@ SceneBump::setup_model_normals_tangent()
Model model;
if(!model.load("asteroid-low"))
- return;
+ return false;
model.calculate_normals();
@@ -197,7 +204,7 @@ SceneBump::setup_model_normals_tangent()
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
std::vector<GLint> attrib_locations;
@@ -207,11 +214,16 @@ SceneBump::setup_model_normals_tangent()
attrib_locations.push_back(program_["tangent"].location());
mesh_.set_attrib_locations(attrib_locations);
- Texture::load("asteroid-normal-map-tangent", &texture_,
- GL_NEAREST, GL_NEAREST, 0);
+ if (!Texture::load("asteroid-normal-map-tangent", &texture_,
+ GL_NEAREST, GL_NEAREST, 0))
+ {
+ return false;
+ }
+
+ return true;
}
-void
+bool
SceneBump::setup_model_height()
{
static const std::string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/bump-height.vert");
@@ -220,7 +232,7 @@ SceneBump::setup_model_height()
Model model;
if(!model.load("asteroid-low"))
- return;
+ return false;
model.calculate_normals();
@@ -251,7 +263,7 @@ SceneBump::setup_model_height()
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
std::vector<GLint> attrib_locations;
@@ -261,27 +273,38 @@ SceneBump::setup_model_height()
attrib_locations.push_back(program_["tangent"].location());
mesh_.set_attrib_locations(attrib_locations);
- Texture::load("asteroid-height-map", &texture_,
- GL_NEAREST, GL_NEAREST, 0);
+ if (!Texture::load("asteroid-height-map", &texture_,
+ GL_NEAREST, GL_NEAREST, 0))
+ {
+ return false;
+ }
+
+ return true;
}
-void
+bool
SceneBump::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
const std::string &bump_render = options_["bump-render"].value;
Texture::find_textures();
Model::find_models();
+
+ bool setup_succeeded = false;
+
if (bump_render == "normals")
- setup_model_normals();
+ setup_succeeded = setup_model_normals();
else if (bump_render == "normals-tangent")
- setup_model_normals_tangent();
+ setup_succeeded = setup_model_normals_tangent();
else if (bump_render == "height")
- setup_model_height();
+ setup_succeeded = setup_model_height();
else if (bump_render == "off" || bump_render == "high-poly")
- setup_model_plain(bump_render);
+ setup_succeeded = setup_model_plain(bump_render);
+ if (!setup_succeeded)
+ return false;
mesh_.build_vbo();
@@ -296,6 +319,8 @@ SceneBump::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene-conditionals.cpp b/src/scene-conditionals.cpp
index 61367a8..778cb33 100644
--- a/src/scene-conditionals.cpp
+++ b/src/scene-conditionals.cpp
@@ -89,10 +89,11 @@ get_fragment_shader_source(int steps, bool conditionals)
return source.str();
}
-void
+bool
SceneConditionals::setup()
{
- SceneGrid::setup();
+ if (!SceneGrid::setup())
+ return false;
/* Parse options */
bool vtx_conditionals = options_["vertex-conditionals"].value == "true";
@@ -104,7 +105,7 @@ SceneConditionals::setup()
std::string frg_shader(get_fragment_shader_source(frg_steps, frg_conditionals));
if (!Scene::load_shaders_from_strings(program_, vtx_shader, frg_shader))
- return;
+ return false;
program_.start();
@@ -115,6 +116,8 @@ SceneConditionals::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
Scene::ValidationResult
diff --git a/src/scene-default-options.cpp b/src/scene-default-options.cpp
index 78a7ac5..0cc8c89 100644
--- a/src/scene-default-options.cpp
+++ b/src/scene-default-options.cpp
@@ -23,7 +23,7 @@
#include "benchmark.h"
#include "log.h"
-void
+bool
SceneDefaultOptions::setup()
{
const std::map<std::string, Scene *> &scenes = Benchmark::scenes();
@@ -50,6 +50,8 @@ SceneDefaultOptions::setup()
}
}
}
+
+ return true;
}
bool
diff --git a/src/scene-desktop.cpp b/src/scene-desktop.cpp
index 64e7550..b1431f8 100644
--- a/src/scene-desktop.cpp
+++ b/src/scene-desktop.cpp
@@ -792,10 +792,11 @@ SceneDesktop::unload()
{
}
-void
+bool
SceneDesktop::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
/* Parse the options */
unsigned int windows(0);
@@ -868,6 +869,8 @@ SceneDesktop::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene-effect-2d.cpp b/src/scene-effect-2d.cpp
index 27275dc..9185d7b 100644
--- a/src/scene-effect-2d.cpp
+++ b/src/scene-effect-2d.cpp
@@ -295,10 +295,11 @@ SceneEffect2D::unload()
glDeleteTextures(1, &texture_);
}
-void
+bool
SceneEffect2D::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
Texture::find_textures();
@@ -312,7 +313,7 @@ SceneEffect2D::setup()
if (!parse_matrix(options_["kernel"].value, kernel,
kernel_width, kernel_height))
{
- return;
+ return false;
}
/* Normalize the kernel matrix if needed */
@@ -330,12 +331,12 @@ SceneEffect2D::setup()
kernel_height));
if (frg_source.str().empty())
- return;
+ return false;
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
std::vector<int> vertex_format;
@@ -358,6 +359,8 @@ SceneEffect2D::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene-function.cpp b/src/scene-function.cpp
index 58412be..0bd9468 100644
--- a/src/scene-function.cpp
+++ b/src/scene-function.cpp
@@ -116,10 +116,11 @@ get_fragment_shader_source(int steps, bool function, std::string &complexity)
return source.str();
}
-void
+bool
SceneFunction::setup()
{
- SceneGrid::setup();
+ if (!SceneGrid::setup())
+ return false;
/* Parse options */
bool vtx_function = options_["vertex-function"].value == "true";
@@ -136,7 +137,7 @@ SceneFunction::setup()
frg_complexity));
if (!Scene::load_shaders_from_strings(program_, vtx_shader, frg_shader))
- return;
+ return false;
program_.start();
@@ -147,6 +148,8 @@ SceneFunction::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
Scene::ValidationResult
diff --git a/src/scene-grid.cpp b/src/scene-grid.cpp
index a7cc105..a9d07e0 100644
--- a/src/scene-grid.cpp
+++ b/src/scene-grid.cpp
@@ -53,10 +53,11 @@ SceneGrid::unload()
{
}
-void
+bool
SceneGrid::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
int grid_size(Util::fromString<int>(options_["grid-size"].value));
double grid_length(Util::fromString<double>(options_["grid-length"].value));
@@ -78,6 +79,8 @@ SceneGrid::setup()
currentFrame_ = 0;
rotation_ = 0.0f;
+
+ return true;
}
void
diff --git a/src/scene-ideas.cpp b/src/scene-ideas.cpp
index 91eb34e..af716bd 100644
--- a/src/scene-ideas.cpp
+++ b/src/scene-ideas.cpp
@@ -58,6 +58,7 @@ public:
void update_time();
void update_projection(const mat4& proj);
void draw();
+ bool valid() { return valid_; }
private:
void postIdle();
@@ -223,12 +224,17 @@ SceneIdeas::unload()
{
}
-void
+bool
SceneIdeas::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
+
priv_ = new SceneIdeasPrivate();
priv_->initialize(options_);
+ if (!priv_->valid())
+ return false;
+
priv_->update_projection(canvas_.projection());
// Core Scene state
@@ -236,6 +242,8 @@ SceneIdeas::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene-jellyfish.cpp b/src/scene-jellyfish.cpp
index 5253dd9..bb8f17a 100644
--- a/src/scene-jellyfish.cpp
+++ b/src/scene-jellyfish.cpp
@@ -54,10 +54,11 @@ SceneJellyfish::unload()
{
}
-void
+bool
SceneJellyfish::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
// Set up our private object that does all of the lifting
priv_ = new JellyfishPrivate();
@@ -68,6 +69,8 @@ SceneJellyfish::setup()
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
running_ = true;
+
+ return true;
}
void
diff --git a/src/scene-loop.cpp b/src/scene-loop.cpp
index 5e3f095..564a2fe 100644
--- a/src/scene-loop.cpp
+++ b/src/scene-loop.cpp
@@ -110,10 +110,11 @@ get_vertex_shader_source(int steps, bool loop, bool uniform)
}
-void
+bool
SceneLoop::setup()
{
- SceneGrid::setup();
+ if (!SceneGrid::setup())
+ return false;
/* Parse options */
bool vtx_loop = options_["vertex-loop"].value == "true";
@@ -130,7 +131,7 @@ SceneLoop::setup()
frg_uniform));
if (!Scene::load_shaders_from_strings(program_, vtx_shader, frg_shader))
- return;
+ return false;
program_.start();
@@ -144,6 +145,8 @@ SceneLoop::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
Scene::ValidationResult
diff --git a/src/scene-pulsar.cpp b/src/scene-pulsar.cpp
index 7d10dbd..6ab661c 100644
--- a/src/scene-pulsar.cpp
+++ b/src/scene-pulsar.cpp
@@ -73,10 +73,11 @@ ScenePulsar::unload()
{
}
-void
+bool
ScenePulsar::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
// Disable back-face culling
glDisable(GL_CULL_FACE);
@@ -119,8 +120,8 @@ ScenePulsar::setup()
if (options_["texture"].value == "true") {
frg_shader_filename = GLMARK_DATA_PATH"/shaders/light-basic-tex.frag";
Texture::find_textures();
- Texture::load("crate-base", &texture_,
- GL_NEAREST, GL_NEAREST, 0);
+ if (!Texture::load("crate-base", &texture_, GL_NEAREST, GL_NEAREST, 0))
+ return false;
} else {
frg_shader_filename = GLMARK_DATA_PATH"/shaders/light-basic.frag";
@@ -136,7 +137,7 @@ ScenePulsar::setup()
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
create_and_setup_mesh();
@@ -148,6 +149,8 @@ ScenePulsar::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene-shading.cpp b/src/scene-shading.cpp
index e760209..22b5ad5 100644
--- a/src/scene-shading.cpp
+++ b/src/scene-shading.cpp
@@ -132,10 +132,11 @@ get_fragment_shader_source(const string& frg_file, unsigned int lights)
return source.str();
}
-void
+bool
SceneShading::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
static const LibMatrix::vec4 lightPosition(20.0f, 20.0f, 10.0f, 1.0f);
static const LibMatrix::vec4 materialDiffuse(0.0f, 0.0f, 1.0f, 1.0f);
@@ -181,7 +182,7 @@ SceneShading::setup()
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
Model model;
@@ -189,7 +190,7 @@ SceneShading::setup()
bool modelLoaded = model.load(whichModel);
if(!modelLoaded)
- return;
+ return false;
// Now that we're successfully loaded, there are a few quirks about
// some of the known models that we need to account for. The draw
@@ -257,6 +258,8 @@ SceneShading::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene-terrain.cpp b/src/scene-terrain.cpp
index 8cea0fb..bf8e18b 100644
--- a/src/scene-terrain.cpp
+++ b/src/scene-terrain.cpp
@@ -261,17 +261,11 @@ SceneTerrain::unload()
Scene::unload();
}
-void
+bool
SceneTerrain::setup()
{
- Scene::setup();
-
- if (!supported(true)) {
- currentFrame_ = 0;
- startTime_ = Util::get_timestamp_us() / 1000000.0;
- running_ = false;
- return;
- }
+ if (!Scene::setup())
+ return false;
/* Parse options */
float repeat = Util::fromString<double>(options_["repeat-overlay"].value);
@@ -322,6 +316,8 @@ SceneTerrain::setup()
currentFrame_ = 0;
startTime_ = Util::get_timestamp_us() / 1000000.0;
running_ = true;
+
+ return true;
}
void
diff --git a/src/scene-texture.cpp b/src/scene-texture.cpp
index 62bd6eb..12aec1b 100644
--- a/src/scene-texture.cpp
+++ b/src/scene-texture.cpp
@@ -103,10 +103,11 @@ SceneTexture::unload()
mesh_.reset();
}
-void
+bool
SceneTexture::setup()
{
- Scene::setup();
+ if (!Scene::setup())
+ return false;
static const std::string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/light-basic.vert");
static const std::string vtx_shader_texgen_filename(GLMARK_DATA_PATH"/shaders/light-basic-texgen.vert");
@@ -138,8 +139,8 @@ SceneTexture::setup()
}
const string& whichTexture(options_["texture"].value);
- Texture::load(whichTexture, &texture_,
- min_filter, mag_filter, 0);
+ if (!Texture::load(whichTexture, &texture_, min_filter, mag_filter, 0))
+ return false;
// Load shaders
bool doTexGen(options_["texgen"].value == "true");
@@ -168,14 +169,14 @@ SceneTexture::setup()
if (!Scene::load_shaders_from_strings(program_, vtx_source.str(),
frg_source.str()))
{
- return;
+ return false;
}
Model model;
const string& whichModel(options_["model"].value);
bool modelLoaded = model.load(whichModel);
if(!modelLoaded)
- return;
+ return false;
// Now that we're successfully loaded, there are a few quirks about
// some of the known models that we need to account for. The draw
@@ -251,6 +252,8 @@ SceneTexture::setup()
running_ = true;
startTime_ = Util::get_timestamp_us() / 1000000.0;
lastUpdateTime_ = startTime_;
+
+ return true;
}
void
diff --git a/src/scene.cpp b/src/scene.cpp
index a842efd..975537d 100644
--- a/src/scene.cpp
+++ b/src/scene.cpp
@@ -93,7 +93,7 @@ Scene::unload()
{
}
-void
+bool
Scene::setup()
{
duration_ = Util::fromString<double>(options_["duration"].value);
@@ -108,6 +108,12 @@ Scene::setup()
ShaderSource::ShaderTypeFragment
);
+ currentFrame_ = 0;
+ running_ = false;
+ startTime_ = Util::get_timestamp_us() / 1000000.0;
+ lastUpdateTime_ = startTime_;
+
+ return supported(true);
}
void
diff --git a/src/scene.h b/src/scene.h
index ebd8e82..a455fbd 100644
--- a/src/scene.h
+++ b/src/scene.h
@@ -104,9 +104,12 @@ public:
* This method also prepares a scene for a benchmark run.
* It should be called just before running a scene/benchmark.
*
- * @return the operation status
+ * The base Scene::setup() method also checks whether a scene
+ * configuration is supported by calling ::supported(true).
+ *
+ * @return whether setting the scene up succeeded
*/
- virtual void setup();
+ virtual bool setup();
/**
* Performs option-dependent resource unloading.
@@ -241,7 +244,7 @@ class SceneDefaultOptions : public Scene
public:
SceneDefaultOptions(Canvas &pCanvas) : Scene(pCanvas, "") {}
bool set_option(const std::string &opt, const std::string &val);
- void setup();
+ bool setup();
private:
std::list<std::pair<std::string, std::string> > defaultOptions_;
@@ -253,7 +256,7 @@ public:
SceneBuild(Canvas &pCanvas);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -281,7 +284,7 @@ public:
SceneTexture(Canvas &pCanvas);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -309,7 +312,7 @@ public:
SceneShading(Canvas &pCanvas);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -336,7 +339,7 @@ public:
SceneGrid(Canvas &pCanvas, const std::string &name);
virtual bool load();
virtual void unload();
- virtual void setup();
+ virtual bool setup();
virtual void teardown();
virtual void update();
virtual void draw();
@@ -355,7 +358,7 @@ class SceneConditionals : public SceneGrid
{
public:
SceneConditionals(Canvas &pCanvas);
- void setup();
+ bool setup();
ValidationResult validate();
~SceneConditionals();
@@ -365,7 +368,7 @@ class SceneFunction : public SceneGrid
{
public:
SceneFunction(Canvas &pCanvas);
- void setup();
+ bool setup();
ValidationResult validate();
~SceneFunction();
@@ -375,7 +378,7 @@ class SceneLoop : public SceneGrid
{
public:
SceneLoop(Canvas &pCanvas);
- void setup();
+ bool setup();
ValidationResult validate();
~SceneLoop();
@@ -387,7 +390,7 @@ public:
SceneBump(Canvas &pCanvas);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -402,10 +405,10 @@ protected:
float rotation_;
float rotationSpeed_;
private:
- void setup_model_plain(const std::string &type);
- void setup_model_normals();
- void setup_model_normals_tangent();
- void setup_model_height();
+ bool setup_model_plain(const std::string &type);
+ bool setup_model_normals();
+ bool setup_model_normals_tangent();
+ bool setup_model_height();
};
class SceneEffect2D : public Scene
@@ -414,7 +417,7 @@ public:
SceneEffect2D(Canvas &pCanvas);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -435,7 +438,7 @@ public:
ScenePulsar(Canvas &pCanvas);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -464,7 +467,7 @@ public:
SceneDesktop(Canvas &canvas);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -485,7 +488,7 @@ public:
bool supported(bool show_errors);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -505,7 +508,7 @@ public:
SceneIdeas(Canvas &pCanvas);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -526,7 +529,7 @@ public:
bool supported(bool show_errors);
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();
@@ -547,7 +550,7 @@ public:
~SceneJellyfish();
bool load();
void unload();
- void setup();
+ bool setup();
void teardown();
void update();
void draw();