[haiku-commits] haiku: hrev43937 - src/tests/kits/opengl/direct_mode

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 1 Apr 2012 22:09:39 +0200 (CEST)

hrev43937 adds 2 changesets to branch 'master'
old head: 3a8514d0c7473971f4fbb393e03157a4950d6773
new head: 25f1f961113e5b4b3eb92c56f43968214a62b4d8

----------------------------------------------------------------------------

3a7313e: Fix build

25f1f96: Move the view when hitting the space key. This shows that GLView in 
direct
  mode can't correctly handle the view being moved.

                               [ JackBurton <stefano.ceccherini@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 21 insertions(+), 1 deletions(-)
src/tests/kits/opengl/direct_mode/GLDirectMode.cpp |   21 +++++++++++++++-
src/tests/kits/opengl/direct_mode/Jamfile          |    1 +

############################################################################

Commit:      3a7313e1cc1c9c036932a0f43735af56abb92f13
URL:         http://cgit.haiku-os.org/haiku/commit/?id=3a7313e
Author:      JackBurton <stefano.ceccherini@xxxxxxxxx>
Date:        Sun Apr  1 18:23:44 2012 UTC

Fix build

----------------------------------------------------------------------------

diff --git a/src/tests/kits/opengl/direct_mode/Jamfile 
b/src/tests/kits/opengl/direct_mode/Jamfile
index 207899e..8303c3a 100644
--- a/src/tests/kits/opengl/direct_mode/Jamfile
+++ b/src/tests/kits/opengl/direct_mode/Jamfile
@@ -1,4 +1,5 @@
 SubDir HAIKU_TOP src tests kits opengl direct_mode ;
+SubDirSysHdrs $(HAIKU_MESA_HEADERS) ;
 
 SetSubDirSupportedPlatformsBeOSCompatible ;
 

############################################################################

Revision:    hrev43937
Commit:      25f1f961113e5b4b3eb92c56f43968214a62b4d8
URL:         http://cgit.haiku-os.org/haiku/commit/?id=25f1f96
Author:      JackBurton <stefano.ceccherini@xxxxxxxxx>
Date:        Sun Apr  1 20:05:27 2012 UTC

Move the view when hitting the space key. This shows that GLView in direct
mode can't correctly handle the view being moved.

----------------------------------------------------------------------------

diff --git a/src/tests/kits/opengl/direct_mode/GLDirectMode.cpp 
b/src/tests/kits/opengl/direct_mode/GLDirectMode.cpp
index e81a543..66fa509 100644
--- a/src/tests/kits/opengl/direct_mode/GLDirectMode.cpp
+++ b/src/tests/kits/opengl/direct_mode/GLDirectMode.cpp
@@ -18,6 +18,7 @@ public:
    virtual void   AttachedToWindow(void);
    virtual void   FrameResized(float newWidth, float newHeight);
    virtual void   MessageReceived(BMessage * msg);
+   virtual void   KeyDown(const char* bytes, int32 numBytes);
    
    void         Render(void);
    
@@ -132,6 +133,7 @@ void SampleGLView::AttachedToWindow(void)
    gInit();
    gReshape(width, height);
    UnlockGL();
+   MakeFocus();
 }
 
 
@@ -247,7 +249,24 @@ void SampleGLView::MessageReceived(BMessage * msg)
        }
 }
 
-
+void SampleGLView::KeyDown(const char *bytes, int32 numBytes)
+{
+       static bool moved = false;
+       switch (bytes[0]) {
+       case B_SPACE:
+               if (moved) {
+                       MoveBy(-30, -30);
+                       moved = false;
+               } else {
+                       MoveBy(30, 30);
+                       moved = true;
+               }
+               break;
+       default:
+               BView::KeyDown(bytes, numBytes);
+               break;
+       }
+}
 
 int main(int argc, char *argv[])
 {


Other related posts:

  • » [haiku-commits] haiku: hrev43937 - src/tests/kits/opengl/direct_mode - stefano . ceccherini