Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created December 16, 2011 06:33
Show Gist options
  • Save ashgti/1484803 to your computer and use it in GitHub Desktop.
Save ashgti/1484803 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:55:18 2011 -0600
@@ -40,12 +40,6 @@
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)
-
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_PATH})
@@ -121,10 +115,6 @@
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)
-
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:55:18 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.
@@ -68,6 +70,9 @@
void RenderSystem::setupDummyWindowId()
{
+#ifdef Q_OS_MAC
+ dummy_window_id_ = 0;
+#else
Display *display = XOpenDisplay(0);
assert( display );
@@ -85,6 +90,7 @@
GLXContext context = glXCreateContext( display, visual, NULL, 1 );
glXMakeCurrent( display, dummy_window_id_, context );
+#endif
}
void RenderSystem::loadOgrePlugins()
@@ -159,7 +165,7 @@
Ogre::ResourceGroupManager::getSingleton().addResourceLocation( ogre_tools_path + "/media/materials/programs", "FileSystem", ROS_PACKAGE_NAME );
}
-Ogre::RenderWindow* RenderSystem::makeRenderWindow( unsigned int window_id, unsigned int width, unsigned int height )
+Ogre::RenderWindow* RenderSystem::makeRenderWindow( intptr_t window_id, unsigned int width, unsigned int height )
{
static int windowCounter = 0; // Every RenderWindow needs a unique name, oy.
diff -r a37008dd3341 ogre_tools_qt/src/ogre_tools/render_system.h
--- a/ogre_tools_qt/src/ogre_tools/render_system.h Thu Dec 15 17:29:28 2011 -0800
+++ b/ogre_tools_qt/src/ogre_tools/render_system.h Fri Dec 16 00:55:18 2011 -0600
@@ -30,6 +30,7 @@
#define RENDER_SYSTEM_H
#include <OGRE/OgreRoot.h>
+#include <stdint.h>
namespace ogre_tools
{
@@ -39,7 +40,7 @@
public:
static RenderSystem* get();
- Ogre::RenderWindow* makeRenderWindow( unsigned int window_id, unsigned int width, unsigned int height );
+ Ogre::RenderWindow* makeRenderWindow( intptr_t window_id, unsigned int width, unsigned int height );
Ogre::Root* root() { return ogre_root_; }
diff -r a37008dd3341 ogre_tools_qt/src/ogre_tools/render_widget.cpp
--- a/ogre_tools_qt/src/ogre_tools/render_widget.cpp Thu Dec 15 17:29:28 2011 -0800
+++ b/ogre_tools_qt/src/ogre_tools/render_widget.cpp Fri Dec 16 00:55:18 2011 -0600
@@ -81,8 +81,8 @@
void RenderWidget::showEvent(QShowEvent *event)
{
-#if Q_OS_MAC
- unsigned int win_id = winId();
+#ifdef Q_OS_MAC
+ uintptr_t win_id = winId();
#else
unsigned int win_id = renderFrame->winId();
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment