MyGUI on OS X

Wannes

02-07-2008 13:14:14

Did anyone get mygui to work on OS X yet?
I tried compiling it, but the confiure script quits because it can't find ogre (checking for Ogre ... no).
So I can't continue the compilation process.

can I get the configure script to work or will an xcode project be needed for this?

Altren

02-07-2008 15:05:44

Finally.
Did anyone get mygui to work on OS X yet?
I tried compiling it, but the confiure script quits because it can't find ogre (checking for Ogre ... no).
So I can't continue the compilation process.

can I get the configure script to work or will an xcode project be needed for this?
I think no. I was waiting that someone ask about it. Actually I even newer seen MacOS and I don't know how compile goes there :)
This is part in automake scripts where we check Ogre. I don't know is it portable or not...AC_DEFUN([MYGUI_CHECK_OGRE], [
PKG_CHECK_MODULES(OGRE, OGRE >= 1.4.0,,exit)
AC_SUBST(OGRE_CFLAGS)
AC_SUBST(OGRE_LIBS)
])
Hm, I think I should see how automake work in Ogre and try to make same if noone tell me how to tell properly...

P.S. I think there won't be problems with compilation because MyGUI code is platform independent.

Wannes

02-07-2008 15:34:28

well, to compile ogre on OS X you need the xcode project (much like a visual studio project), you can't use the makefiles atm.

I'm willing to invest some time in getting this to work on OS X, but I could use all help I can get as I'm far from a specialist in this.

I'll first try to get the makefiles to work and see how that works out.

Any tips or pointers like how to get configure to find ogre are greatly appreciated.

Wannes

02-07-2008 18:39:15

Joy! I got it to work :D

proof:

atm I did it the most hacky way possible, just copied all the headers and source files into my project (yes it's really really horrible).

I've had some minor compile errors (the logging class had an overload problem) and a some more worrying errors in the Dynlib class. Atm I just commented out all those lines so I could do a quick test.

I'll go do a bit of reading about xcode and compiling libraries in it so I can come up with a better solution than this : )


Where exactly is this Dynlib class used for?

Altren

02-07-2008 19:06:13

Cool!

Dynlib used for plugins. Currently there's only test plugin, so don't care about it at the moment.

Can you please send me PM with diff file or just send me your changes that you made it compiling at Mac OS X.

Wannes

02-07-2008 20:32:39

I just succeeded in producing a working library of MyGUI (on OS X) ...
I encountered alot more errors than during my previous attempt (when I just copied all files into my project). Got some quite obscure errors at times, but managed to fix those. Atm I had to comment out 2 operator<< overloads in the logging class, and quite alot of asserts and logs (ambigious overload) and offcourse the Dynlib stuff.

error log of things I had to comment out: http://rafb.net/p/9QfDTz55.html

The dynlib stuff should be easy to fix once we find out the OS X specific functions for loading libs.


I tried to make a diff but it totally freaks out (as usual) and outputs complete files (which I didn't edit or even open) as "changed", even with the minimal flag and ignore-tab-expand, white space blank lines etc etc (tried all the relevant flags). So well I just zipped the modified source code, maybe you have more success generating the diff on windows.

modified source code: http://webby.deds.nl/ogre/MyGUIEngine_OSX.zip


For people who'd like to use MyGui on OS X this is the xcode project I used to make the lib: http://webby.deds.nl/ogre/MyGUI_static_lib_xcode.zip
extract this to a new dir ("Mac"?) in the MyGui base dir, and drop the "Dependencies" folder from the ogre source release in it.

If anyone is interested I can upload the lib itself (its 51mb).


I hope we can get the commented out lines back in, they are not really essential, but it can be quite annoying when you have no clue why your app is messing up because the asserts and log messages are commented out.

Wannes

03-07-2008 16:21:39

I'm trying to get the layoutEditor to work on OS X now, after some error fixing in the mac only parts I got it to compile (and link, which was the biggest problem this time).

When I run it I get alot of warnings from malloc and something about unaligned pointers, don't know if this is really a problem though.

The part I'm stuck at atm is three xml files and a layout file which can't be found. They are nowhere in the MyGui package I downloaded and I'm not sure what exactly they should contain. I added an empty editor.xml file but that didn't do much good.

here is the error log btw: http://rafb.net/p/OUtlEk39.html the interesting part is at the very end.

the files i'm missing are:

  1. * editor.xml
    * settings.xml
    * widgets.xml
    * interface.layout
    [/list:u]

Wannes

03-07-2008 18:26:34

Ok I spent some time and managed to fix all errors (didn't comment anything out this time). I've put an OS test around the dynlib stuff, so currently on OS X there is no plugin support yet.

I managed to fix all warnings (got 4000 warnings on every compile of my project which uses the MyGUI library) most of em were symbol redefinitions and visibility warnings during linking.

I also managed to get the size down considerably, the zipped lib and header files are 4.5mb and can be found here: http://webby.deds.nl/ogre/libMyGui+headers.zip

The updated xcode project: http://webby.deds.nl/ogre/MyGUI_xcode.zip

And finally the modified source: http://webby.deds.nl/ogre/MyGUI%20modified%20source.zip

The modified source should still work perfectly on other platforms afaik so its probably a good idea to include the (little) changes in the main branch.

The diff file: http://webby.deds.nl/ogre/MyGUI_OSX_diff


If someone is using the library it and runs in to troubles, feel free to ask for help

querry43

27-07-2008 22:35:08

The modified source should still work perfectly on other platforms afaik so its probably a good idea to include the (little) changes in the main branch.

I am would really like to see these changes make it into the main branch as well before I begin working extensively with it.

querry43

28-07-2008 00:27:47

If someone is using the library it and runs in to troubles, feel free to ask for help

I had to enable "Inline Methods Hidden" in debug to match the binary dependancies distribution. Otherwise, I was getting 2000 (exactly, how unlikely) spurious visibility warnings during linking.

Otherwise, this seems to work great in my existing ogre projects. Good Work! Picking a GUI has been a lot of work for me, always glad to have more cross-platform options.

Altren

28-07-2008 11:09:23

The diff file: http://rafb.net/p/dxs9fY41.htmlCan you, please, re upload this file. This link is broken.

Wannes

29-07-2008 19:48:26

The diff file: http://rafb.net/p/dxs9fY41.htmlCan you, please, re upload this file. This link is broken.


Woops, bit stupid of me to put the changelog on a pastebot.

Here it is: http://webby.deds.nl/ogre/MyGUI_OSX_diff


When a new version of MyGUI is released I'll compile a new library for it and put it online.

Altren

30-07-2008 15:22:31

Thank you, applied your changes to MyGUI code. Try to download latest version from svn and test it.

P.S. Next time use svn diff format if possible.

banal

26-02-2009 10:29:28

Hello Altren

I'm encountering the same problems as the OP when trying to compile MyGUI on mac. Did you put the XCode project file on your svn repository (i wasn't able to find it)? Or is there another way to compile MyGUI on the mac?

Thanks

Altren

26-02-2009 11:03:22

No, we didn't added xcode project to svn repository, but you can try to play with project that was created by http://webby.deds.nl/ogre/MyGUI_xcode.zip Wannes (I'm sure that it's outdated, but it's better than nothing).

banal

26-02-2009 16:07:00

I created a new Xcode file for the current SVN trunk (Rev 1773). Anybody interested can grab it here:
http://bummzack.ch/misc/MyGUI_mac.zip

Here's the directory structure i used (if yours is different, you must change paths in XCode, otherwise it should work without changes):

<yourDirectory>
OgreSDK
OgreDependencies_OSX_Eihort_20080115
MyGUI
mac // contents of the MyGUI_mac.zip archive go here
MyGUI.xcodeproj
MyGUI_Prefix.pch


Other than that, there was an error in the mac-specific code in MyGUI_ResourcePath.cpp. The macBundlePath function is used there. This function is defined in the Ogre "ExampleApplication.h" which should not be a requirement IMHO.
I added it as a function in the MyGUI Namespace. There was also an error in the isResourceLocationExist function call (mac specific code).
You can grab the Patch here:
http://bummzack.ch/misc/MyGUI_ResourcePath.patch.zip

After trying to setup a simple application using MyGUI i get a lot of errors in the log, saying:

Texture 'Default' not found, set default texture


Here's the myGui code used in said application

MyGUI::Gui * mGUI = new MyGUI::Gui();
mGUI->initialise(mWindow);
MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button", 10, 10, 300, 26, MyGUI::Align::Default, "Main");
button->setCaption("exit");

The cursor and text show up though...
I already copied the MyGUI_Media Folder to my application dir and added it to the resources.cfg. To no avail.
Any help is appreciated. Thanks

EDIT: I was able to resolve the issue. I forgot to add the "Themes" folder to the resources.cfg file. Now everything works as expected.

banal

13-03-2009 15:08:34

I received a personal message from a mac user who asked me for the compiled binaries.
Since there might be others looking for compiled mac binaries, here's a link: http://bummzack.ch/misc/libMyGUI.a.zip
The file simply contains the compiled static library (intel only, not universal binary)

Altren

13-03-2009 15:40:48

You should also say what version is it.

banal

13-03-2009 16:03:59

You should also say what version is it.
Oh yes, I'm sorry about that.
It's actually a compiled version of rev. 1773 from SVN, but with the patch applied i posted previously.
Here's another build of the current SVN trunk (rev. 1805): http://bummzack.ch/misc/libMyGUI.a.1805.zip

Both binaries work with a simple test application i created (displaying a gui button on screen). If some code from trunk is unstable, i could also try to create a binary of the latest release.

banal

15-04-2009 22:16:57

I was wondering if there's a Mac release of the LayoutEditor as well, but I wasn't able to find one. So I gave it a try myself and I was able to build the LayoutEditor for mac. So if anybody is interested, I could provide the LayoutEditor as runnable Application for intel based macs (I built from the latest SVN Sources, Rev. 1889). Just post here or PM me if you need it.

@Altren: I also found a code error on mac. It's in Tools/LayoutEditor/BasisManager.cpp, Line 210. There you got:
ResourceGroupManager::getSingleton().addResourceLocation(String(MyGUI::helper::macBundlePath() + "/" + archName), typeName, secName);
But it should be:
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(Ogre::String(MyGUI::helper::macBundlePath() + "/" + archName), typeName, secName);

Sadly I'm not able to provide a patch, since your comments mess up my diff (are these comments in russian?). What is the file encoding? Anyway.. I only get ???? instead of your comments if I create a diff from your file.

banal

11-06-2009 10:32:13

Just downloaded the 2.2.2 source from sourceforge. The previously mentioned problem on Mac OS seems to still exist.. changing MyGUI_ResourcePath.h and LayoutEditor/BasisManager.cpp allowed me to successfully build MyGUI and the LayoutEditor for Mac OS X.

I just had a peek at trunk. Apparently the issue seems to be resolved there? I'm just bumping this, so it doesn't get lost :)