Ogitor on Mac

Ogitor on Mac

Postby wilkolak » Sun Jun 12, 2011 5:27 pm

Hi,
I've managed to compile Ogitor on Mac... it was a little hell to manage all CMake dependencies but I'm successful now. For this part at least.
After compilation it doesn't run. Splash screen and crash to dbg.

The log says this (last few lines):
Code: Select all
Loading library /Users/oskar/Ogre/Ogitor/build/qtOgitor/RelWithDebInfo/qtOgitor.app/Contents/Plugins/Ogitor/libOgModularZone.dylib
Loading library /Users/oskar/Ogre/Ogitor/build/qtOgitor/RelWithDebInfo/qtOgitor.app/Contents/Plugins/Ogitor/libOgSkyx.dylib
Could not resolve property : linearGradient4112
Could not resolve property : linearGradient4112
Could not resolve property : linearGradient4112
Could not resolve property : linearGradient4112
GLRenderSystem::_createRenderWindow "Primary1", 1x1 windowed  miscParams: border=none externalWindowHandle=4756555936

and afterwards is crash on line 310 of MainWindow.cpp of qtOgitor.
Code: Select all
Ogre::RenderWindow* pPrimary = Ogre::Root::getSingletonPtr()->createRenderWindow("Primary1",1,1,false,&hiddenParams);

What info can I provide you to make it easier to iron this bug?
For compilation I was using:
OgreSDK 1.7.3 as downloaded precompiled from Ogre site
Qt 4.7.3 also precompiled
Ogitor from mercurial v0-4 branch
Boost 1.46.1 compiled using MacPorts
CMake 1.8.4 precompiled
Xcode 4.0.2 with files generated by CMake

I was also trying to use custom compiled Ogre from sinbad 1-7 branch with exactly same results.
Also get some minor errors with QMessegeBox::Icon::Critical (or sth like that) which needed to be changed to QMessegeBox::Critical I don't know if that matters.
BTW, during compilation I've received about 875 minor errors related to plugins and Ogitor itself (Caelum plugin was the only target without warnings). :P
I've compiled to x86_64 as with i386 target I was getting ld errors related to Qt as precompiled version is 64bit only binary. I may compile 32 bits Qt and try Ogitor again if this may be the reason.

Looking forward for your answers. ;) Sorry for so long post, was trying to say everything what may matter as you probably don't have Macs. :P I'm new to Ogre but it is my tool of choice for my BSc project starting in a year so I'm determined to make my pipeline as efficient as possible. ;)

W.
wilkolak
 
Posts: 5
Joined: 12 Jun 2011

Re: Ogitor on Mac

Postby spacegaier » Sun Jun 12, 2011 6:19 pm

As you alread guessed, none of the team members has a Mac at their disposal (at least none I am aware of ;) ).

So, yes: We have to shoot in the dark here. All I know is that this is not an Mac issue and can be ignored:
Code: Select all
Could not resolve property : linearGradient4112


Regarding the line where it crashes: Does that also happen in a pure Ogre app?
User avatar
spacegaier
Ogitor Team
 
Posts: 1054
Joined: 12 Mar 2010
Location: Germany

Re: Ogitor on Mac

Postby wilkolak » Sun Jun 12, 2011 7:47 pm

Yea it does but I don't know if my test wasn't just a garbage.
I've putted this line into a demo app from the template for Xcode. I don't know how to use this method :oops: yet. I've put this into:
Code: Select all
void DemoApp::setupDemoScene()
{
   /* TEST */
   
   Ogre::NameValuePairList hiddenParams;
    hiddenParams["border"] = "none";
   
   Ogre::RenderWindow* pPrimary = Ogre::Root::getSingletonPtr()->createRenderWindow("Primary1",1,1,false, &hiddenParams);
   
   /* TEST */
   
   OgreFramework::getSingletonPtr()->m_pSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox");
   
   OgreFramework::getSingletonPtr()->m_pSceneMgr->createLight("Light")->setPosition(75,75,75);
   
   m_pCubeEntity = OgreFramework::getSingletonPtr()->m_pSceneMgr->createEntity("Cube", "ogrehead.mesh");
   m_pCubeNode = OgreFramework::getSingletonPtr()->m_pSceneMgr->getRootSceneNode()->createChildSceneNode("CubeNode");
   m_pCubeNode->attachObject(m_pCubeEntity);
}
Please don't laugh. :P I'm with Ogre for two weeks now, mainly reading about it and making compares to another frameworks...
If you have any pure Ogre app with this call I would be very happy to check it. ;)
wilkolak
 
Posts: 5
Joined: 12 Jun 2011

Re: Ogitor on Mac

Postby spacegaier » Sun Jun 12, 2011 9:50 pm

It looks as if the code you posted is part of my BasicOgreFramework ( :) ), so in order for the test to make sense [*] you have to put it in the initOgre() and replace the lines that were previously used to create the render window (m_pRoot->initialize(...)).

Then test the app again, if it still works with that createRenderWindow call, it is most likely an Ogitor issue.

[*] Your current test just creates a second render window but that is not yet used for anthing, since the test app still renders through the render window created in initOgre().
User avatar
spacegaier
Ogitor Team
 
Posts: 1054
Joined: 12 Mar 2010
Location: Germany

Re: Ogitor on Mac

Postby wilkolak » Mon Jun 13, 2011 3:27 am

I thought it would do something like that.
You see where your code is used? :P I've done as you asked.
Code: Select all
//   m_pRenderWnd = m_pRoot->initialise(true, wndTitle);
   m_pRenderWnd = Ogre::Root::getSingletonPtr()->createRenderWindow(wndTitle,1,1,false);

And this crashes also. I've done this with custom compiled Ogre to get more debug info and there it is.
The crash starts at createRenderWindow() and goes through:

OgreRoot.cpp, 1199:
Code: Select all
ret = mActiveRenderer->_createRenderWindow(name, width, height, fullScreen, miscParams);

OgreGLRenderSystem.cpp, 1011:
Code: Select all
attachRenderTarget( *win );

OgreRenderSystem.cpp, 402:
It is the closing bracket of switch statement in RenderSystem::_setTextureUnitSettings().

Through STLs stl_tree.h, 304:
Code: Select all
allocator_type get_allocator() const { return allocator_type(_M_get_Node_allocator()); }

To the OgreRenderSystem.cpp, 242 in method RenderSystem::attachRenderTarget():
Code: Select all
assert( target.getPriority() < OGRE_NUM_RENDERTARGET_GROUPS );


So I assume this is not Ogitor specific bug... Hope it helps with identification of it.
wilkolak
 
Posts: 5
Joined: 12 Jun 2011

Re: Ogitor on Mac

Postby spacegaier » Mon Jun 13, 2011 7:53 am

Since Ogre generally runs on Mac, your best bet is to search the Ogre (!) forums and the Ogre wiki for help on that, since none here has a Mac. Once you got a simple Ogre Mac application running, show us the code and/or tell us the differences to our Ogitor code and we should be able to adapt Ogitor to handle Mac as well :) .

Good starting point: http://www.ogre3d.org/tikiwiki/Setting% ... 0Mac%20OSX
User avatar
spacegaier
Ogitor Team
 
Posts: 1054
Joined: 12 Mar 2010
Location: Germany

Re: Ogitor on Mac

Postby wilkolak » Mon Jun 13, 2011 9:45 pm

Yea... I've managed Ogitor to run... everything is better then learning to test at 8am tomorrow. -.-'
When I look on what had to be changed... gash it is so little. Wish I knew this 48h ago. So here it is my first and I hope not the last patch for Ogre and Ogitor community. ;) Next thing will be preparing a proper CMake scripts... what is now is hell. Almost everything has to be setup by hand. Wonder if you could prepare it some kind similar to Ogre build scripts which look for all dependencies in one dir. It would be handful if you can put or rather symlink all your stuff (OgreSDK, plugins, boost, OIS, etc.) into Dependencies dir, run CMake and be happy that everything is setup properly.

Ok, I have test tomorrow. Going to do some Ogitor... learn to test.

ogrewidget.cpp - line 162, add:
Code: Select all
#if defined(Q_WS_MAC)
   params["macAPI"] = "cocoa";   
   params["macAPICocoaUseNSView"] = "true";
#endif

mainwindow.cpp - line 309, add:
Code: Select all
#if defined(Q_WS_MAC)
   hiddenParams["macAPICocoaUseNSView"] = "true";   
   hiddenParams["macAPI"] = "cocoa";
#endif


This one isn't mac related IMO but general Qt 4.7.3 error.
shortcuts.cpp - line 51, replace
Code: Select all
       msgBox.setIcon(QMessageBox::Icon::Critical);
with
       msgBox.setIcon(QMessageBox::Critical);
Attachments
OgitorMacFirstRun!.png
Ogitor on OS X!
wilkolak
 
Posts: 5
Joined: 12 Jun 2011

Re: Ogitor on Mac

Postby spacegaier » Mon Jun 13, 2011 10:12 pm

If none beats me to it, I will add those changes tomorrow. Thanks for reporting!
User avatar
spacegaier
Ogitor Team
 
Posts: 1054
Joined: 12 Mar 2010
Location: Germany

Re: Ogitor on Mac

Postby spacegaier » Tue Jun 14, 2011 10:05 am

Okay, I commited the changes now, although I am not 100%ly sure about the part in shortcuts.cpp. I now used the code there, that was at the same place in the dev branch as I thought that might be the best option. If that's not the case, just tell me and I will change it again:

http://hg.ogitor.org/v0-4/rev/9e7e3734a992
User avatar
spacegaier
Ogitor Team
 
Posts: 1054
Joined: 12 Mar 2010
Location: Germany

Re: Ogitor on Mac

Postby jacmoe » Thu Jun 16, 2011 6:47 pm

Really awesome to see Ogitor running on the Mac again - thanks Wilkolak! :)
I am sure that our Mac users will be happy that you managed to fix it.
User avatar
jacmoe
Ogitor Team
 
Posts: 1750
Joined: 25 Jan 2010
Location: Denmark

Next

Return to Bugs and Patches

Who is online

Users browsing this forum: No registered users and 1 guest

cron