Merge lp:~glmark2-dev/glmark2/scene-clear into lp:glmark2/2011.11

Proposed by Jesse Barker
Status: Merged
Merged at revision: 271
Proposed branch: lp:~glmark2-dev/glmark2/scene-clear
Merge into: lp:glmark2/2011.11
Diff against target: 131 lines (+96/-0)
4 files modified
src/android.cpp (+1/-0)
src/main.cpp (+1/-0)
src/scene-clear.cpp (+81/-0)
src/scene.h (+13/-0)
To merge this branch: bzr merge lp:~glmark2-dev/glmark2/scene-clear
Reviewer Review Type Date Requested Status
Alexandros Frantzis Pending
Review via email: mp+164246@code.launchpad.net

Description of the change

SceneClear: Add new simple "null" scene. Useful as a sort of template for instantiating new scenes, as well as potentially evaluating a theoretical maximum frame rate for the framework itself (basically, it will just clear, swap buffers, and update timestamps).

To post a comment you must log in.
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

8 + scenes.push_back(new SceneClear(canvas));

We should also do the same in src/android.cpp (and, yes, we have to fix this to have a single point for registering scenes).

Other than that, it looks good.

lp:~glmark2-dev/glmark2/scene-clear updated
272. By Jesse Barker

SceneClear: Need to instantiate the new scene for Android as well.

Revision history for this message
Jesse Barker (jesse-barker) wrote :

OK, done.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/android.cpp'
2--- src/android.cpp 2012-12-07 19:57:44 +0000
3+++ src/android.cpp 2013-05-17 14:56:22 +0000
4@@ -277,6 +277,7 @@
5 scenes.push_back(new SceneJellyfish(canvas));
6 scenes.push_back(new SceneShadow(canvas));
7 scenes.push_back(new SceneRefract(canvas));
8+ scenes.push_back(new SceneClear(canvas));
9 }
10
11
12
13=== modified file 'src/main.cpp'
14--- src/main.cpp 2013-04-03 16:53:35 +0000
15+++ src/main.cpp 2013-05-17 14:56:22 +0000
16@@ -77,6 +77,7 @@
17 scenes.push_back(new SceneJellyfish(canvas));
18 scenes.push_back(new SceneShadow(canvas));
19 scenes.push_back(new SceneRefract(canvas));
20+ scenes.push_back(new SceneClear(canvas));
21
22 for (vector<Scene*>::const_iterator iter = scenes.begin();
23 iter != scenes.end();
24
25=== added file 'src/scene-clear.cpp'
26--- src/scene-clear.cpp 1970-01-01 00:00:00 +0000
27+++ src/scene-clear.cpp 2013-05-17 14:56:22 +0000
28@@ -0,0 +1,81 @@
29+//
30+// Copyright © 2013 Linaro Limited
31+//
32+// This file is part of the glmark2 OpenGL (ES) 2.0 benchmark.
33+//
34+// glmark2 is free software: you can redistribute it and/or modify it under the
35+// terms of the GNU General Public License as published by the Free Software
36+// Foundation, either version 3 of the License, or (at your option) any later
37+// version.
38+//
39+// glmark2 is distributed in the hope that it will be useful, but WITHOUT ANY
40+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
41+// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
42+// details.
43+//
44+// You should have received a copy of the GNU General Public License along with
45+// glmark2. If not, see <http://www.gnu.org/licenses/>.
46+//
47+// Authors:
48+// Jesse Barker
49+//
50+#include "scene.h"
51+#include "util.h"
52+
53+SceneClear::SceneClear(Canvas& canvas) :
54+ Scene(canvas, "clear")
55+{
56+}
57+
58+bool
59+SceneClear::load()
60+{
61+ running_ = false;
62+ return true;
63+}
64+
65+void
66+SceneClear::unload()
67+{
68+}
69+
70+bool
71+SceneClear::setup()
72+{
73+ if (!Scene::setup())
74+ return false;
75+
76+ // Add scene-specific setup code here
77+
78+ // Set up the frame timing values and
79+ // indicate that the scene is ready to run.
80+ running_ = true;
81+ startTime_ = Util::get_timestamp_us() / 1000000.0;
82+ lastUpdateTime_ = startTime_;
83+ return true;
84+}
85+
86+void
87+SceneClear::teardown()
88+{
89+ // Add scene-specific teardown code here
90+ Scene::teardown();
91+}
92+
93+void
94+SceneClear::update()
95+{
96+ Scene::update();
97+ // Add scene-specific update code here
98+}
99+
100+void
101+SceneClear::draw()
102+{
103+}
104+
105+Scene::ValidationResult
106+SceneClear::validate()
107+{
108+ return Scene::ValidationUnknown;
109+}
110
111=== modified file 'src/scene.h'
112--- src/scene.h 2012-12-17 16:08:05 +0000
113+++ src/scene.h 2013-05-17 14:56:22 +0000
114@@ -589,4 +589,17 @@
115 ValidationResult validate();
116 };
117
118+class SceneClear : public Scene
119+{
120+public:
121+ SceneClear(Canvas &pCanvas);
122+ bool load();
123+ void unload();
124+ bool setup();
125+ void teardown();
126+ void update();
127+ void draw();
128+ ValidationResult validate();
129+};
130+
131 #endif

Subscribers

People subscribed via source and target branches

to all changes: