diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index 900fe3b686..7298b2f286 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -44,7 +44,9 @@ bool MyApp::OnInit(void) wxMessageBox("No joystick detected!"); return FALSE; } +#if wxUSE_WAVE m_fire.Create("gun.wav"); +#endif // wxUSE_WAVE m_maxX = stick.GetXMax(); m_maxY = stick.GetYMax(); @@ -133,10 +135,12 @@ void MyCanvas::OnJoystickEvent(wxJoystickEvent& event) sprintf(buf, "Joystick (%ld, %ld)", pt.x, pt.y); frame->SetStatusText(buf); +#if wxUSE_WAVE if (event.ButtonDown() && wxGetApp().m_fire.IsOk()) { wxGetApp().m_fire.Play(); } +#endif // wxUSE_WAVE } BEGIN_EVENT_TABLE(MyFrame, wxFrame) diff --git a/samples/joytest/joytest.h b/samples/joytest/joytest.h index afa8a21a86..18a8a75e3c 100644 --- a/samples/joytest/joytest.h +++ b/samples/joytest/joytest.h @@ -19,7 +19,9 @@ class MyApp: public wxApp int m_maxX; int m_maxY; +#if wxUSE_WAVE wxWave m_fire; +#endif // wxUSE_WAVE }; DECLARE_APP(MyApp)