SHARE
TWEET

Untitled

a guest Nov 9th, 2012 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #if TARGET_PLATFORM_APPLE
  2. boost::shared_ptr<SceneVisualizer> osx_init(QGLWidget * sender)
  3. {
  4.     BOOST_ASSERT(sender);
  5.    
  6.     const int w = sender->width();
  7.     const int h = sender->height();
  8.    
  9.     BOOST_ASSERT(w > 0);
  10.     BOOST_ASSERT(h > 0);
  11.    
  12.     Ogre::String winHandle = Ogre::StringConverter::toString((unsigned long long)(sender->winId()));
  13.    
  14.     Ogre::NameValuePairList params;
  15.     //params["parentWindowHandle"]   = Ogre::StringConverter::toString((unsigned long)sender->parentWidget()->winId());
  16.     params["externalWindowHandle"] = winHandle;
  17.     params["macAPI"]               = "cocoa";
  18.     params["macAPICocoaUseNSView"] = "true";
  19.    
  20.     Ogre::String windowName = "QOgreSceneView_RenderWindow_#" + winHandle;
  21.  
  22.     // After this call we get:
  23.     // ********************************************
  24.     // ***  Starting Mac OS X OpenGL Subsystem  ***
  25.     // ********************************************
  26.     // Registering ResourceManager for type Texture
  27.     // GLRenderSystem::_createRenderWindow "QOgreSceneView_RenderWindow_#4410555008", 100x30 windowed
  28.     // miscParams: macAPI=cocoa macAPICocoaUseNSView=true parentWindowHandle=4410555008
  29.     // Creating a Cocoa Compatible Render System
  30.     // 2012-11-09 09:14:46.649 ARPlayer[4667:303] invalid drawable
  31.     boost::shared_ptr<SceneVisualizer> visualizer(SceneVisualizer::create(w, h, windowName, params));
  32.  
  33.     return visualizer;
  34. }
  35. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top