[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/games/astrododge/src
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2009-07-16 19:29:18
Message-ID: 1247772558.042232.14385.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 997986 by rivol:

Move setupOrthoView() to GLView class.

 M  +0 -16     gameguiview.cpp  
 M  +0 -3      gameguiview.h  
 M  +16 -0     glview.cpp  
 M  +2 -0      glview.h  


--- trunk/playground/games/astrododge/src/gameguiview.cpp #997985:997986
@@ -201,22 +201,6 @@
     mSpeedoMeter->setRect(speedRect);
 }
 
-void GameGUIView::setupOrthoView(int w, int h)
-{
-    if (w == -1) {
-        w = glWidget()->width();
-    }
-    if (h == -1) {
-        h = glWidget()->height();
-    }
-
-    glMatrixMode(GL_PROJECTION);
-    glLoadIdentity();
-    gluOrtho2D(0, w, h, 0);
-    glMatrixMode(GL_MODELVIEW);
-    glLoadIdentity();
-}
-
 void GameGUIView::render()
 {
     // The meters cannot be rendered while the textrender is active. So render them \
                first and then texts.
--- trunk/playground/games/astrododge/src/gameguiview.h #997985:997986
@@ -41,9 +41,6 @@
         virtual void resize(int w, int h);
         virtual void render();
 
-    protected:
-        void setupOrthoView(int w = -1, int h = -1);
-
     private:
         GameWorld* mWorld;
 
--- trunk/playground/games/astrododge/src/glview.cpp #997985:997986
@@ -80,3 +80,19 @@
 void GLView::render()
 {
 }
+
+void GLView::setupOrthoView(int w, int h)
+{
+    if (w == -1) {
+        w = glWidget()->width();
+    }
+    if (h == -1) {
+        h = glWidget()->height();
+    }
+
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    gluOrtho2D(0, w, h, 0);
+    glMatrixMode(GL_MODELVIEW);
+    glLoadIdentity();
+}
--- trunk/playground/games/astrododge/src/glview.h #997985:997986
@@ -58,6 +58,8 @@
         void setCamera(KGLLib::Camera* c);
         void setViewType(ViewType v);
 
+        void setupOrthoView(int w = -1, int h = -1);
+
     private:
         KGLLib::Camera* mCamera;
         ViewType mViewType;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic