]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/display/display.cpp
Enabled handling of drive letters on OS/2.
[wxWidgets.git] / samples / display / display.cpp
index 3b9fc584cdaf0648580c8951960f046262f30a21..1e1b8f20389fa7e28383a24334648fe7d594027c 100644 (file)
     #pragma hdrstop
 #endif
 
+#if !wxUSE_DISPLAY
+    #error "To compile this sample you must build the library with wxUSE_DISPLAY set to 1"
+#endif
+
 // for all others, include the necessary headers explicitly
 #ifndef WX_PRECOMP
     #include "wx/app.h"
@@ -161,6 +165,13 @@ IMPLEMENT_APP(MyApp)
 // 'Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
+#ifdef __WXMSW__
+    if ( argc == 2 && !wxStricmp(argv[1],  _T("/dx")) )
+    {
+        wxDisplay::UseDirectX(true);
+    }
+#endif // __WXMSW__
+
     // create the main application window
     MyFrame *frame = new MyFrame(_("Display wxWindows Sample"),
                                  wxPoint(50, 50), wxSize(450, 340));
@@ -306,13 +317,6 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 {
-    wxDisplay dpy(1);
-    if ( !dpy.ChangeMode(wxVideoMode(800, 600)) )
-    {
-        wxLogError("Failed!");
-        return;
-    }
-
     wxMessageBox(_T("Demo program for wxDisplay class.\n\n(c) 2003 Vadim Zeitlin"),
                  _T("About Display Sample"),
                  wxOK | wxICON_INFORMATION,