=== modified file 'main.cpp'
@@ -10,19 +10,17 @@
unsigned current_scene = 0;
Screen screen;
- SceneBuild scenebuild;
- SceneTexture scenetexture;
- SceneShading sceneshading;
-
printf("===================================================\n");
printf(" GLMark 08\n");
printf("===================================================\n");
-
- printf("===================================================\n");
if(!screen.init())
return 0;
printf("===================================================\n");
+ SceneBuild scenebuild(screen);
+ SceneTexture scenetexture(screen);
+ SceneShading sceneshading(screen);
+
if(!scenebuild.load() || !scenetexture.load() || !sceneshading.load())
return 0;
@@ -49,7 +47,6 @@
case 0:
current_scene++;
scenebuild.start();
-// scenebuild.mRunning = false;
break;
case 1:
scenebuild.update();
@@ -58,7 +55,6 @@
{
current_scene++;
scenetexture.start();
-// scenetexture.mRunning = false;
}
break;
case 2:
@@ -68,7 +64,6 @@
{
current_scene++;
sceneshading.start();
-// sceneshading.mRunning = false;
}
break;
case 3:
=== modified file 'scene.cpp'
@@ -1,6 +1,7 @@
#include "scene.h"
-Scene::Scene()
+Scene::Scene(Screen &pScreen) :
+ mScreen(pScreen)
{
}
=== modified file 'scene.h'
@@ -13,7 +13,7 @@
class Scene
{
public:
- Scene();
+ Scene(Screen &pScreen);
~Scene();
unsigned mPartsQty; // How many parts for the scene
@@ -33,11 +33,14 @@
protected:
double mStartTime;
double mElapsedTime;
+
+ Screen &mScreen;
};
class SceneBuild : public Scene
{
public:
+ SceneBuild(Screen &pScreen) : Scene(pScreen) {}
int load();
void start();
void update();
@@ -51,6 +54,7 @@
class SceneTexture : public Scene
{
public:
+ SceneTexture(Screen &pScreen) : Scene(pScreen) {}
int load();
void start();
void update();
@@ -67,6 +71,7 @@
class SceneShading : public Scene
{
public:
+ SceneShading(Screen &pScreen) : Scene(pScreen) {}
int load();
void start();
void update();