diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 19: Associate each Scene with the Screen it is going to draw on.

Message ID 20110721123631.17019.43221.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Alexandros Frantzis July 21, 2011, 12:36 p.m. UTC
------------------------------------------------------------
revno: 19
committer: Alexandros Frantzis <alf82@freemail.gr>
timestamp: Thu 2010-07-08 16:04:49 +0300
message:
  Associate each Scene with the Screen it is going to draw on.
modified:
  main.cpp
  scene.cpp
  scene.h


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'main.cpp'
--- main.cpp	2010-07-07 12:30:48 +0000
+++ main.cpp	2010-07-08 13:04:49 +0000
@@ -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'
--- scene.cpp	2010-07-07 10:32:18 +0000
+++ scene.cpp	2010-07-08 13:04:49 +0000
@@ -1,6 +1,7 @@ 
 #include "scene.h"
 
-Scene::Scene()
+Scene::Scene(Screen &pScreen) :
+    mScreen(pScreen)
 {
 }
 

=== modified file 'scene.h'
--- scene.h	2010-07-07 10:32:18 +0000
+++ scene.h	2010-07-08 13:04:49 +0000
@@ -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();