Revision: 1541
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1541&view=rev
Author:   rorthomas
Date:     2010-10-06 16:06:18 +0000 (Wed, 06 Oct 2010)

Log Message:
-----------
rorviewer compiling under linux

Modified Paths:
--------------
    trunk/source/viewer/CMakeLists.txt
    trunk/source/viewer/RoRViewer.cpp
    trunk/source/viewer/panel_meshprop.h
    trunk/source/viewer/wxutils.cpp

Modified: trunk/source/viewer/CMakeLists.txt
===================================================================
--- trunk/source/viewer/CMakeLists.txt  2010-09-12 09:02:51 UTC (rev 1540)
+++ trunk/source/viewer/CMakeLists.txt  2010-10-06 16:06:18 UTC (rev 1541)
@@ -28,6 +28,14 @@
  PKG_CHECK_MODULES  (Ogre OGRE REQUIRED)
  PKG_CHECK_MODULES  (Ois OIS REQUIRED)
 
+ # find wxwidgets
+ SET(wxWidgets_USE_UNICODE ON)
+ FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS base core html net adv propgrid 
aui)
+ include_directories(${wxWidgets_INCLUDE_DIRS})
+ add_definitions("-D${wxWidgets_DEFINITIONS}" ${wxWidgets_CXX_FLAGS})
+ link_directories (${wxWidgets_LIB_DIR})
+ set(OS_LIBS "${OS_LIBS};${wxWidgets_LIBRARIES}")
+
  set(OS_SOURCE "")
 ENDIF(WIN32)
 
@@ -80,7 +88,7 @@
    add_definitions("/wd4305 /wd4244 -DNOMINMAX")
 ELSEIF(UNIX)
    include_directories(${GTK_INCLUDE_DIRS})
-   set(OS_LIBS "X11")
+   set(OS_LIBS "${OS_LIBS};X11")
 ENDIF(WIN32)
 
 # required components

Modified: trunk/source/viewer/RoRViewer.cpp
===================================================================
--- trunk/source/viewer/RoRViewer.cpp   2010-09-12 09:02:51 UTC (rev 1540)
+++ trunk/source/viewer/RoRViewer.cpp   2010-10-06 16:06:18 UTC (rev 1541)
@@ -48,20 +48,11 @@
 
        String logFilename   = SETTINGS.getSetting("Log Path") + 
Ogre::String("RoRViewer.log");
        String programPath   = SETTINGS.getSetting("Program Path");
-       String pluginsConfig = ""; // important to be empty 
//SETTINGS.getSetting("plugins.cfg");
+       String pluginsConfig = SETTINGS.getSetting("plugins.cfg");
        
        String ogreConfig    = SETTINGS.getSetting("ogre.cfg");
        ogre_root = new Ogre::Root(pluginsConfig, ogreConfig, logFilename);
 
-       // load plugins by hand
-#ifdef WIN32
-       ogre_root->loadPlugin(programPath + "RenderSystem_Direct3D9");
-#endif // WIN32
-       ogre_root->loadPlugin(programPath + "RenderSystem_GL");
-       ogre_root->loadPlugin(programPath + "Plugin_ParticleFX");
-       ogre_root->loadPlugin(programPath + "Plugin_OctreeSceneManager");
-       ogre_root->loadPlugin(programPath + "Plugin_CgProgramManager");
-
        ogre_root->restoreConfig();
        ogre_root->initialise(false);
 

Modified: trunk/source/viewer/panel_meshprop.h
===================================================================
--- trunk/source/viewer/panel_meshprop.h        2010-09-12 09:02:51 UTC (rev 
1540)
+++ trunk/source/viewer/panel_meshprop.h        2010-10-06 16:06:18 UTC (rev 
1541)
@@ -119,7 +119,7 @@
                        wxPropertyGridPage *pgp = pgman->AddPage(wxT("Mesh"));
 
                        // bounds
-                       pgp->Append(new wxPropertyCategory("Bounds"));
+                       pgp->Append(new wxPropertyCategory("Bounding Box"));
 
                        AxisAlignedBox bounds = current_mesh->getBounds();
                        Vector3 bounds_min = bounds.getMinimum();

Modified: trunk/source/viewer/wxutils.cpp
===================================================================
--- trunk/source/viewer/wxutils.cpp     2010-09-12 09:02:51 UTC (rev 1540)
+++ trunk/source/viewer/wxutils.cpp     2010-10-06 16:06:18 UTC (rev 1541)
@@ -17,83 +17,83 @@
 You should have received a copy of the GNU General Public License
 along with Rigs of Rods.  If not, see <http://www.gnu.org/licenses/>.
 */
-#include "wxutils.h"
-
-#include <iostream>
-#include <sstream>
-
-// this is in a separate file to reduce the clutter in the global namespace 
and their conflicts
-
-#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
-# ifdef __WXGTK__
-#include <gdk/gdk.h>
-#include <gtk/gtk.h> // just this should suffice as it should include gdk.h 
itself
-/* Seems to be needed under Linux */
-//#include <wx/gtk/win_gtk.h>
-#include "wx/gtk/private/win_gtk.h"
-#include <gdk/gdkx.h>
-#include <GL/glx.h>
-
-#if  wxCHECK_VERSION(2, 9, 0)
-#define piz(wxwin) WX_PIZZA((wxwin)->m_wxwindow)
-#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
-           GDK_WINDOW_XWINDOW(((GtkWidget*)piz(wxwin))->window) : \
-           GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
-#else
-#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
-           GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
-           GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
-#endif
-
-#ifdef __WXX11__
-#include "wx/x11/privx.h"
-#define GetXWindow(wxwin)   ((Window)(wxwin)->GetHandle())
-#endif
-
-# endif //__WXGTK__
-#endif //OGRE_PLATFORM_LINUX
-
-std::string getWindowHandle(wxWindow *window)
-{
-#if WIN32
-    std::stringstream sstr;
-       size_t hWnd = (size_t)window->GetHandle();
-    sstr << hWnd;
-    std::string result = sstr.str();
-       return result;
-#else
-
-    // TODO: Someone test this. you might to use "parentWindowHandle" if this
-    // does not work.  Ogre 1.2 + Linux + GLX platform wants a string of the
-    // format display:screen:window, which has variable types ulong:uint:ulong.
-    GtkWidget* widget = window->GetHandle();
-    //gtk_widget_set_double_buffered (widget, FALSE);
-    gtk_widget_realize( widget );      // Mandatory. Otherwise, a segfault 
happens.
-    //XSync(GDK_WINDOW_XDISPLAY(widget->window), False);
-    
-    Display* display = GDK_WINDOW_XDISPLAY( widget->window );
-
-    
-    //Window wid = GetXWindow(window);
-    Window wid = GDK_WINDOW_XWINDOW( widget->window );
-
-    std::stringstream sstr;
-    /* Get the right display (DisplayString() returns ":display.screen") */
-    std::string displayStr = DisplayString( display );
-    displayStr = displayStr.substr( 1, ( displayStr.find( ".", 0 ) - 1 ) );
-
-    int screenNum = DefaultScreen( display );
-
-    /* Put all together */
-    printf("using display: %s\n", displayStr.c_str());
-    printf("using screen: %d\n", screenNum);
-    printf("using window: 0x%x\n", wid);
-
-    // old format:
-    sstr << displayStr << ':' << screenNum << ':' << wid;
-    std::string result = sstr.str();
-
-    printf("getWindowHandle() = %s\n", result.c_str());
-    return result;
-#endif
-}
+#include "wxutils.h"
+
+#include <iostream>
+#include <sstream>
+
+// this is in a separate file to reduce the clutter in the global namespace 
and their conflicts
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+# ifdef __WXGTK__
+#include <gdk/gdk.h>
+#include <gtk/gtk.h> // just this should suffice as it should include gdk.h 
itself
+/* Seems to be needed under Linux */
+//#include <wx/gtk/win_gtk.h>
+#include "wx/gtk/private/win_gtk.h"
+#include <gdk/gdkx.h>
+#include <GL/glx.h>
+
+#if  wxCHECK_VERSION(2, 9, 0)
+#define piz(wxwin) WX_PIZZA((wxwin)->m_wxwindow)
+#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
+           GDK_WINDOW_XWINDOW(((GtkWidget*)piz(wxwin))->window) : \
+           GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
+#else
+#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
+           GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
+           GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
+#endif
+
+#ifdef __WXX11__
+#include "wx/x11/privx.h"
+#define GetXWindow(wxwin)   ((Window)(wxwin)->GetHandle())
+#endif
+
+# endif //__WXGTK__
+#endif //OGRE_PLATFORM_LINUX
+
+std::string getWindowHandle(wxWindow *window)
+{
+#if WIN32
+    std::stringstream sstr;
+       size_t hWnd = (size_t)window->GetHandle();
+    sstr << hWnd;
+    std::string result = sstr.str();
+       return result;
+#else
+
+    // TODO: Someone test this. you might to use "parentWindowHandle" if this
+    // does not work.  Ogre 1.2 + Linux + GLX platform wants a string of the
+    // format display:screen:window, which has variable types ulong:uint:ulong.
+    GtkWidget* widget = window->GetHandle();
+    //gtk_widget_set_double_buffered (widget, FALSE);
+    gtk_widget_realize( widget );      // Mandatory. Otherwise, a segfault 
happens.
+    //XSync(GDK_WINDOW_XDISPLAY(widget->window), False);
+    
+    Display* display = GDK_WINDOW_XDISPLAY( widget->window );
+
+    
+    //Window wid = GetXWindow(window);
+    Window wid = GDK_WINDOW_XWINDOW( widget->window );
+
+    std::stringstream sstr;
+    /* Get the right display (DisplayString() returns ":display.screen") */
+    std::string displayStr = DisplayString( display );
+    displayStr = displayStr.substr( 1, ( displayStr.find( ".", 0 ) - 1 ) );
+
+    int screenNum = DefaultScreen( display );
+
+    /* Put all together */
+    printf("using display: %s\n", displayStr.c_str());
+    printf("using screen: %d\n", screenNum);
+    printf("using window: 0x%x\n", wid);
+
+    // old format:
+    sstr << displayStr << ':' << screenNum << ':' << wid;
+    std::string result = sstr.str();
+
+    printf("getWindowHandle() = %s\n", result.c_str());
+    return result;
+#endif
+}


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to