I have the MyGUI lib projects building for iOS after some tinkering with CMake-generated project (it's not at all set up for iOS), but can't get the demos/tools to build. I've spotted two main issues but there may be others:
- Carbon framework is referenced and I don't think iOS should use Carbon?
- Lots of dependency libs are missing
As a newbie to Mac development and Xcode I don't really know what I'm trying to achieve, or how to! I tried looking at the OgreSampleBrowser app settings for comparison, but got lost! Is getting the demos to build & run on iPad simulator a realistic aim or are there too many things to fix?
Building MyGUI demo apps for iOS?
-
- Greenskin
- Posts: 100
- Joined: Wed Jan 25, 2012 7:50 pm
- x 1
Re: Building MyGUI demo apps for iOS?
What was the tinkering you had to do?
I'm eagrly awaiting any developments on the MyGui iOs front.
I'm eagrly awaiting any developments on the MyGui iOs front.
-
- Ogre Magi
- Posts: 1235
- Joined: Fri Oct 26, 2007 12:36 am
- Location: Mountain View, CA
- x 10
Re: Building MyGUI demo apps for iOS?
This should be posted in the MyGUI forum: http://www.ogre3d.org/addonforums/viewforum.php?f=17
OgrePlatform.h
Good luck with integrating MyGUI. The library needs a few modifications before it's really usable on iOS.
Whenever I had this issue it was to do with the minimum iOS version which was causing the apple platform to be defined rather than iOS:d000hg wrote:- Carbon framework is referenced and I don't think iOS should use Carbon?
OgrePlatform.h
Code: Select all
# if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
# define OGRE_PLATFORM OGRE_PLATFORM_APPLE_IOS
# else
# define OGRE_PLATFORM OGRE_PLATFORM_APPLE
# endif
-
- Goblin
- Posts: 257
- Joined: Tue Sep 02, 2008 9:41 pm
- x 1
Re: Building MyGUI demo apps for iOS?
The only person who really seems to respond there is the developer and he's not working on iOS IIRCDanielSefton wrote:This should be posted in the MyGUI forum: http://www.ogre3d.org/addonforums/viewforum.php?f=17

I don't think changing that will magically change the project Linker settings generated by CMake, although I hope I'm wrong. It seems CMake script for MyGUI is almost totally ignoring iOS - it generates a Mac project and this requires a lot of changes to work.Whenever I had this issue it was to do with the minimum iOS version which was causing the apple platform to be defined rather than iOS:d000hg wrote:- Carbon framework is referenced and I don't think iOS should use Carbon?
OgrePlatform.hCode: Select all
# if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 # define OGRE_PLATFORM OGRE_PLATFORM_APPLE_IOS # else # define OGRE_PLATFORM OGRE_PLATFORM_APPLE # endif
Right nwo I just want to get it running - I have MyGUI in my own code - so I can evaluate it properly and at least have some iPad app running.Good luck with integrating MyGUI. The library needs a few modifications before it's really usable on iOS.
-
- Goblin
- Posts: 257
- Joined: Tue Sep 02, 2008 9:41 pm
- x 1
Re: Building MyGUI demo apps for iOS?
From memory I had to change in XCode:caseybasichis wrote:What was the tinkering you had to do?
Project Settings
=============
- Base SDK to "Latest iOS"
- Architectures to "armv6/armv7
Then fix lots of header and library search paths on MyGUIEngine, MyGUI.OgrePlatform & Common. IIRC MyGUIEngine actually built quite easily, the others needed more work. Remember to build STATIC from CMake, and point all the various parts to iOSDependencies.
In <my-gui-src>/CMake/CMakeLists.txt, comment out a line add_definitions(-msse) as this is not ARM-compatible.
For me, the CMake script was not good even for Mac... it tried to use my library name as a directory, etc. On Windows it was much different. Basically just a lot of small things to work through and I have libs built. Ideally someone would make CMake script have a BUILD_IOS option but I don't know enough CMake to do this.
-
- Kobold
- Posts: 31
- Joined: Thu Feb 02, 2012 9:34 pm
- x 6
Re: Building MyGUI demo apps for iOS?
I apologize up front ... this kinda strays from the topic a bit ... but I think it's worth saying.
Ya' know, I tried this ... and quickly realized it wasn't worth it. Cocoa's native UIKit framework is, IMO, far more powerful than any cross platform GUI library out there (for iOS apps, i mean). I was seriously surprised at the performance improvement in my project when I switch to a pure UIKit GUI. I was using a very simple system built on Ogre's overlays, but I was never really satisfied with it. With Cocoa's UIKit, my UI loads faster, looks better, and it also conforms to the Apple look & feel. But what I really liked, was how it forced me to separated the UI stuff from the Ogre stuff. If you're familiar with the MVC pattern, then making the transition will be even easier for you (if not ... well, it's a good thing to learn). Also, there's Xcode's interface builder (bit of a learning curve, but worth it).
Oh, and ... if you're worried about learning objective c ... don't. If you know C++ you'll pick it up in a few days. Then it's just a matter of learning a new API (namely the UIKit framework). Tying UI stuff into your C++ environment is also no big deal. You can declare a protocol and delegate for your view controllers and implement them in a PIMPL class similar to what I wrote in the wiki article about using a UIView for input handling and gesture detection.
The drawback, of course, is that you lose portability. But, even so, it's definitely worthwhile to consider writing platform dependent code for the "view" and "controller" part of a MVC-UI. You may find it's less work and a more elegant solution than hacking-up MyGUI to work in iOS (and perhaps re-hacking it should you go over to Android as well ... I haven't tried or read anything about MyGUI on Android).
Ya' know, I tried this ... and quickly realized it wasn't worth it. Cocoa's native UIKit framework is, IMO, far more powerful than any cross platform GUI library out there (for iOS apps, i mean). I was seriously surprised at the performance improvement in my project when I switch to a pure UIKit GUI. I was using a very simple system built on Ogre's overlays, but I was never really satisfied with it. With Cocoa's UIKit, my UI loads faster, looks better, and it also conforms to the Apple look & feel. But what I really liked, was how it forced me to separated the UI stuff from the Ogre stuff. If you're familiar with the MVC pattern, then making the transition will be even easier for you (if not ... well, it's a good thing to learn). Also, there's Xcode's interface builder (bit of a learning curve, but worth it).
Oh, and ... if you're worried about learning objective c ... don't. If you know C++ you'll pick it up in a few days. Then it's just a matter of learning a new API (namely the UIKit framework). Tying UI stuff into your C++ environment is also no big deal. You can declare a protocol and delegate for your view controllers and implement them in a PIMPL class similar to what I wrote in the wiki article about using a UIView for input handling and gesture detection.
The drawback, of course, is that you lose portability. But, even so, it's definitely worthwhile to consider writing platform dependent code for the "view" and "controller" part of a MVC-UI. You may find it's less work and a more elegant solution than hacking-up MyGUI to work in iOS (and perhaps re-hacking it should you go over to Android as well ... I haven't tried or read anything about MyGUI on Android).
-
- Goblin
- Posts: 257
- Joined: Tue Sep 02, 2008 9:41 pm
- x 1
Re: Building MyGUI demo apps for iOS?
Depending on your app, you can't always separate Ogre and GUI in the sense that "GUI always sits on top of the 3D scene"... my app is multi-viewport so conceptually I have GUI tied to a viewport. Even though I do in fact separate GUI from the logic, I still have circumstances one viewport/dialog/window is sitting on top of another.
Maybe you can fix this with OBJ-C anyway so you tie a view to a viewport in the same way? I am sure you're right it's a better way to go but it does mean you can't do a quick port of your app to iPad. Of course that's not really a great idea anyway for a production app - you should re-package your functionality as a proper App - but it's still very valuable IMHO that you can cross-build for iOS without changes.
If you considered putting your Ogre/UIKit stuff open-source I'm sure you'd get some new friends, I'd certainly be interested.
Maybe you can fix this with OBJ-C anyway so you tie a view to a viewport in the same way? I am sure you're right it's a better way to go but it does mean you can't do a quick port of your app to iPad. Of course that's not really a great idea anyway for a production app - you should re-package your functionality as a proper App - but it's still very valuable IMHO that you can cross-build for iOS without changes.
If you considered putting your Ogre/UIKit stuff open-source I'm sure you'd get some new friends, I'd certainly be interested.

-
- Greenskin
- Posts: 100
- Joined: Wed Jan 25, 2012 7:50 pm
- x 1
Re: Building MyGUI demo apps for iOS?
Thank you for your perspective. The idea of keeping the gui crossplatform and being able to render ui's on 3d objects is enticing, but it sounds like its not worth the performance hit. What a joykill that reality is.aleroy wrote:I apologize up front ... this kinda strays from the topic a bit ... but I think it's worth saying.
Ya' know, I tried this ... and quickly realized it wasn't worth it. Cocoa's native UIKit framework is, IMO, far more powerful than any cross platform GUI library out there (for iOS apps, i mean). I was seriously surprised at the performance improvement in my project when I switch to a pure UIKit GUI. I was using a very simple system built on Ogre's overlays, but I was never really satisfied with it. With Cocoa's UIKit, my UI loads faster, looks better, and it also conforms to the Apple look & feel. But what I really liked, was how it forced me to separated the UI stuff from the Ogre stuff. If you're familiar with the MVC pattern, then making the transition will be even easier for you (if not ... well, it's a good thing to learn). Also, there's Xcode's interface builder (bit of a learning curve, but worth it).
Oh, and ... if you're worried about learning objective c ... don't. If you know C++ you'll pick it up in a few days. Then it's just a matter of learning a new API (namely the UIKit framework). Tying UI stuff into your C++ environment is also no big deal. You can declare a protocol and delegate for your view controllers and implement them in a PIMPL class similar to what I wrote in the wiki article about using a UIView for input handling and gesture detection.
The drawback, of course, is that you lose portability. But, even so, it's definitely worthwhile to consider writing platform dependent code for the "view" and "controller" part of a MVC-UI. You may find it's less work and a more elegant solution than hacking-up MyGUI to work in iOS (and perhaps re-hacking it should you go over to Android as well ... I haven't tried or read anything about MyGUI on Android).
I'm still waiting on some hardware to get my mac up and running so I can just commit to iOS dev as a primary target and loosen the grips on the need for fully crossplatform code.
I would also greatly appreciate any more info on working with Ogre and the UIKit. I read your wiki article a while back, is the method of integrating uikit similar? I'm at the point where I know what a MVC is but I've never used it. I have a lot of 3d experience from working in VFX but c++ is a new and strange beast.
-
- Greenskin
- Posts: 100
- Joined: Wed Jan 25, 2012 7:50 pm
- x 1
Re: Building MyGUI demo apps for iOS?
Thinking about it,
Is it a matter of following the standard Cocoa gui, an then rendering Ogre to a texture (as per the tutorials) and displaying that in a UIKit object?
How flexible is the UIKit for skinning and making custom controls?
Is it a matter of following the standard Cocoa gui, an then rendering Ogre to a texture (as per the tutorials) and displaying that in a UIKit object?
How flexible is the UIKit for skinning and making custom controls?