]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/opengl/cube/cube.cpp
Added wxPostscriptDC to wxPython
[wxWidgets.git] / samples / opengl / cube / cube.cpp
index 75dde17d4e38004988d7cc07c1cd5ef7229c9351..886bbe12faa7c4f08fe784effaadaf46a6c59825 100644 (file)
 #include "cube.h"
 
 #ifndef __WXMSW__     // for wxStopWatch, see remark below
-#include <sys/time.h>
-#include <sys/unistd.h>
+  #if defined(__WXMAC__) && !defined(__DARWIN__)
+    #include <utime.h>
+    #include <unistd.h>
+  #else
+    #include <sys/time.h>
+    #include <sys/unistd.h>
+  #endif
 #else
 #include <sys/timeb.h>
 #endif
@@ -360,10 +365,7 @@ void TestGLCanvas::OnKeyDown( wxKeyEvent& event )
 
     unsigned long currTime = event.m_timeStamp - m_xsynct;
 
-    // we have to test for m_Key != 0 because otherwise the test would be
-    // always true because it is set to 0 in OnKeyUp() below - I don't know
-    // why is it like this, just fixing blindly (VZ)
-    if (evkey != m_Key && m_Key != 0)
+    if (evkey != m_Key)
     {
         m_Key = evkey;
         m_LastRedraw = m_StartTime = m_LastTime = currTime;
@@ -425,7 +427,7 @@ void MyFrame::OnExit(wxCommandEvent& event)
     Destroy();
 }
 
-void MyFrame::OnNewWindow()
+void MyFrame::OnNewWindow(wxCommandEvent& event)
 {
   MyFrame *frame = new MyFrame(NULL, "Cube OpenGL Demo Clone",
                                wxPoint(50, 50), wxSize(400, 300));
@@ -456,7 +458,7 @@ void MyFrame::OnNewWindow()
   frame->Show(TRUE);
 }
 
-void MyFrame::OnDefRotateLeftKey()
+void MyFrame::OnDefRotateLeftKey(wxCommandEvent& event)
 {
   ScanCodeDialog dial( this, -1, m_canvas->m_rleft,
                        wxString("Left"), "Define key" );
@@ -464,7 +466,7 @@ void MyFrame::OnDefRotateLeftKey()
   if( result == wxID_OK )
     m_canvas->m_rleft = dial.GetValue();
 }
-void MyFrame::OnDefRotateRightKey()
+void MyFrame::OnDefRotateRightKey(wxCommandEvent& event)
 {
   ScanCodeDialog dial( this, -1, m_canvas->m_rright,
                        wxString("Right"), "Define key" );