Skip to content

Instantly share code, notes, and snippets.

@wjwwood
Created December 16, 2011 06:45
Show Gist options
  • Select an option

  • Save wjwwood/1484842 to your computer and use it in GitHub Desktop.

Select an option

Save wjwwood/1484842 to your computer and use it in GitHub Desktop.
diff -r a37008dd3341 ogre_tools_qt/CMakeLists.txt
--- a/ogre_tools_qt/CMakeLists.txt Thu Dec 15 17:29:28 2011 -0800
+++ b/ogre_tools_qt/CMakeLists.txt Fri Dec 16 00:45:13 2011 -0600
@@ -40,11 +40,11 @@
set(X11_LIBS ${X11_LIBRARIES})
endif(UNIX AND NOT APPLE)
-if(APPLE)
- include_directories(/usr/X11/include)
- link_directories(/usr/X11/lib)
- set(APPLE_X11_LIBS X11 GL)
-endif(APPLE)
+# if(APPLE)
+# include_directories(/usr/X11/include)
+# link_directories(/usr/X11/lib)
+# set(APPLE_X11_LIBS X11 GL)
+# endif(APPLE)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_PATH})
@@ -121,9 +121,9 @@
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${OGRE_TOOLS_GL_LIBS} ${OGRE_LIBRARIES} ${X11_LIBS})
-if(APPLE)
- target_link_libraries(${PROJECT_NAME} ${APPLE_X11_LIBS})
-endif(APPLE)
+# if(APPLE)
+# target_link_libraries(${PROJECT_NAME} ${APPLE_X11_LIBS})
+# endif(APPLE)
qt4_wrap_cpp(MOC_FILES
src/test/grid_test.h
diff -r a37008dd3341 ogre_tools_qt/src/ogre_tools/render_system.cpp
--- a/ogre_tools_qt/src/ogre_tools/render_system.cpp Thu Dec 15 17:29:28 2011 -0800
+++ b/ogre_tools_qt/src/ogre_tools/render_system.cpp Fri Dec 16 00:45:13 2011 -0600
@@ -27,12 +27,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+// This is required for QT_MAC_USE_COCOA to be set
+#include <QtCore/qglobal.h>
+
+#ifndef Q_OS_MAC
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/glx.h>
-
-// This is required for QT_MAC_USE_COCOA to be set
-#include <QtCore/qglobal.h>
+#endif
#include <ros/package.h> // This dependency should be moved out of here, it is just used for a search path.
@@ -62,12 +64,17 @@
setupRenderSystem();
ogre_root_->initialise(false);
setupResources();
+#ifndef Q_OS_MAC
+ makeRenderWindow( 0, 1, 1 );
+#else
makeRenderWindow( dummy_window_id_, 1, 1 );
+#endif
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
void RenderSystem::setupDummyWindowId()
{
+#ifndef Q_OS_MAC
Display *display = XOpenDisplay(0);
assert( display );
@@ -85,6 +92,7 @@
GLXContext context = glXCreateContext( display, visual, NULL, 1 );
glXMakeCurrent( display, dummy_window_id_, context );
+#endif
}
void RenderSystem::loadOgrePlugins()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment