X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/806e2f154a201c4099c553130521a96bff7dfb0f..52c8d32a71bb7553dd89324fa6d56faac95eb5d0:/samples/opengl/cube/cube.cpp diff --git a/samples/opengl/cube/cube.cpp b/samples/opengl/cube/cube.cpp index 425865f280..20fb88d2be 100644 --- a/samples/opengl/cube/cube.cpp +++ b/samples/opengl/cube/cube.cpp @@ -9,11 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma implementation -#pragma interface -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -30,8 +25,9 @@ #endif #include "cube.h" +#include "../../sample.xpm" -#ifndef __WXMSW__ // for wxStopWatch, see remark below +#ifndef __WXMSW__ // for StopWatch, see remark below #if defined(__WXMAC__) && !defined(__DARWIN__) #include #include @@ -135,7 +131,7 @@ int ScanCodeDialog::GetValue() in time (in sec) (because current version of wxGetElapsedTime doesn´t works right with glibc-2.1 and linux, at least for me) -----------------------------------------------------------------------*/ -unsigned long wxStopWatch( unsigned long *sec_base ) +unsigned long StopWatch( unsigned long *sec_base ) { unsigned long secs,msec; @@ -182,7 +178,7 @@ unsigned long TestGLCanvas::m_gsynct; TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) - : wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style, name ) + : wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name ) { m_init = false; m_gllist = 0; @@ -190,13 +186,13 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id, m_rright = WXK_RIGHT; } -TestGLCanvas::TestGLCanvas(wxWindow *parent, const TestGLCanvas &other, +TestGLCanvas::TestGLCanvas(wxWindow *parent, const TestGLCanvas *other, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) - : wxGLCanvas(parent, other.GetContext(), id, pos, size, style, name) + : wxGLCanvas(parent, other->GetContext(), id, pos, size, style|wxFULL_REPAINT_ON_RESIZE , name) { m_init = false; - m_gllist = other.m_gllist; // share display list + m_gllist = other->m_gllist; // share display list m_rleft = WXK_LEFT; m_rright = WXK_RIGHT; } @@ -371,8 +367,8 @@ void TestGLCanvas::OnKeyDown( wxKeyEvent& event ) if (!m_TimeInitialized) { m_TimeInitialized = 1; - m_xsynct = event.m_timeStamp; - m_gsynct = wxStopWatch(&m_secbase); + m_xsynct = event.GetTimestamp(); + m_gsynct = StopWatch(&m_secbase); m_Key = evkey; m_StartTime = 0; @@ -380,7 +376,7 @@ void TestGLCanvas::OnKeyDown( wxKeyEvent& event ) m_LastRedraw = 0; } - unsigned long currTime = event.m_timeStamp - m_xsynct; + unsigned long currTime = event.GetTimestamp() - m_xsynct; if (evkey != m_Key) { @@ -393,9 +389,9 @@ void TestGLCanvas::OnKeyDown( wxKeyEvent& event ) Action( m_Key, m_LastTime-m_StartTime, currTime-m_StartTime ); #if defined(__WXMAC__) && !defined(__DARWIN__) - m_LastRedraw = currTime; // wxStopWatch() doesn't work on Mac... + m_LastRedraw = currTime; // StopWatch() doesn't work on Mac... #else - m_LastRedraw = wxStopWatch(&m_secbase) - m_gsynct; + m_LastRedraw = StopWatch(&m_secbase) - m_gsynct; #endif m_LastTime = currTime; } @@ -440,6 +436,7 @@ MyFrame::MyFrame(wxWindow *parent, const wxString& title, const wxPoint& pos, : wxFrame(parent, wxID_ANY, title, pos, size, style) { m_canvas = NULL; + SetIcon(wxIcon(sample_xpm)); } // Intercept menu commands @@ -457,11 +454,6 @@ void MyFrame::OnExit( wxCommandEvent& WXUNUSED(event) ) MyFrame *frame = new MyFrame(NULL, str, wxDefaultPosition, wxSize(400, 300)); - // Give it an icon -#ifdef __WXMSW__ - frame->SetIcon(wxIcon(_T("mondrian"))); -#endif - // Make a menubar wxMenu *winMenu = new wxMenu;